summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usb-i2c-sl018/statemachine.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usb-i2c-sl018/statemachine.c b/usb-i2c-sl018/statemachine.c
index 037eee2..fac0964 100644
--- a/usb-i2c-sl018/statemachine.c
+++ b/usb-i2c-sl018/statemachine.c
@@ -110,13 +110,14 @@ void statemachine_task_limits(void)
void statemachine_task_event(void)
{
- if (state == closing || state == opening)
- return; //waiting for action to finish
event_t event = eventqueue_pop();
switch(state) {
case closing:
case opening:
- //Not possibe, fuck gcc
+ if(event==move_timeout)
+ {
+ return change_state(state==opening?timeout_after_open:timeout_after_close);
+ }
case reset:
case error:
printf("Error: Not accepting commands in state %d\n\r",state);