summaryrefslogtreecommitdiff
path: root/usb-i2c-sl018/stepper.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-02-07 05:21:24 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-02-07 05:21:24 +0000
commit2ecef8fb8e925eb2942db3f7e0865fca553b7465 (patch)
tree018a3c2fdea026dca11da01f3688d03169b9e3e9 /usb-i2c-sl018/stepper.c
parentnaming convention for heartbeat (diff)
naming convention for stepper
git-svn-id: https://svn.spreadspace.org/avr/trunk@179 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/stepper.c')
-rw-r--r--usb-i2c-sl018/stepper.c12
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();
}