diff options
Diffstat (limited to 'usb-i2c-sl018/stepper.c')
-rw-r--r-- | usb-i2c-sl018/stepper.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usb-i2c-sl018/stepper.c b/usb-i2c-sl018/stepper.c index d2fd50f..d26815a 100644 --- a/usb-i2c-sl018/stepper.c +++ b/usb-i2c-sl018/stepper.c @@ -48,14 +48,14 @@ volatile uint16_t step_cnt = 0; #define STEP_CNT_OFF (STEP_CNT_STOP + 125) stepper_direction_t step_direction = dir_open; -inline void stop_stepper(void) +inline void stepper_stop(void) { STEPPER_PORT &= ~(0xF << STEPPER_FIRST_BIT | 1<<STEPPER_ENABLE_BIT); TCCR1B = 0; // no clock source TIMSK1 = 0; // disable timer interrupt } -static inline uint8_t handle_step(void) +static inline uint8_t stepper_handle(void) { static uint8_t step_idx = 0; @@ -89,13 +89,13 @@ static inline uint8_t handle_step(void) return 1; } -void init_stepper(void) +void stepper_init(void) { STEPPER_PORT &= ~(0xF << STEPPER_FIRST_BIT | 1<<STEPPER_ENABLE_BIT); STEPPER_DDR |= (0xF << STEPPER_FIRST_BIT) | (1<<STEPPER_ENABLE_BIT); } -uint8_t start_stepper(stepper_direction_t direction) +uint8_t stepper_start(stepper_direction_t direction) { step_cnt = 0; step_direction = direction; @@ -111,6 +111,6 @@ uint8_t start_stepper(stepper_direction_t direction) ISR(TIMER1_COMPA_vect) { - if(!handle_step()) - stop_stepper(); + if(!stepper_handle()) + stepper_stop(); } |