diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-02-07 00:51:15 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-02-07 00:51:15 +0000 |
commit | 048e16a12bf926cc122899dd96f1ba34fb5d7912 (patch) | |
tree | 71e813720cd8df16e84be3267eb1a80e85d1cd97 /usb-i2c-sl018/stepper.c | |
parent | stepper respects limits now (diff) |
fixed state machine
git-svn-id: https://svn.spreadspace.org/avr/trunk@163 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/stepper.c')
-rw-r--r-- | usb-i2c-sl018/stepper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usb-i2c-sl018/stepper.c b/usb-i2c-sl018/stepper.c index 7501feb..d555889 100644 --- a/usb-i2c-sl018/stepper.c +++ b/usb-i2c-sl018/stepper.c @@ -77,8 +77,14 @@ inline uint8_t handle_step(void) STEPPER_PORT = (STEPPER_PORT & STEPPER_OUTPUT_BITMASK ) | stepper_output; step_cnt++; - if(step_cnt >= STEP_CNT_OFF) + if(step_cnt >= STEP_CNT_OFF) { + if(step_direction == dir_open) + eventqueue_push(open_fin); + else + eventqueue_push(close_fin); + return 0; + } return 1; } |