From 048e16a12bf926cc122899dd96f1ba34fb5d7912 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 7 Feb 2013 00:51:15 +0000 Subject: fixed state machine git-svn-id: https://svn.spreadspace.org/avr/trunk@163 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- usb-i2c-sl018/stepper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'usb-i2c-sl018/stepper.c') 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; } -- cgit v1.2.3