diff options
author | Othmar Gsenger <otti@wirdorange.org> | 2013-02-07 00:25:58 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@wirdorange.org> | 2013-02-07 00:25:58 +0000 |
commit | 047328e170afb0253e60e6ce919957fa47eeb722 (patch) | |
tree | 14b51136818073dd11f7599633500129ffa75084 /usb-i2c-sl018/statemachine.c | |
parent | added event for moving timeout (diff) |
timeout implemented in statemachine
git-svn-id: https://svn.spreadspace.org/avr/trunk@161 aa12f405-d877-488e-9caf-2d797e2a1cc7
Diffstat (limited to 'usb-i2c-sl018/statemachine.c')
-rw-r--r-- | usb-i2c-sl018/statemachine.c | 7 |
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); |