From 047328e170afb0253e60e6ce919957fa47eeb722 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 7 Feb 2013 00:25:58 +0000 Subject: timeout implemented in statemachine git-svn-id: https://svn.spreadspace.org/avr/trunk@161 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- usb-i2c-sl018/statemachine.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usb-i2c-sl018/statemachine.c') 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); -- cgit v1.2.3