summaryrefslogtreecommitdiffhomepage
path: root/digital/io-hub/src/guybrush/top.c
diff options
context:
space:
mode:
authorNicolas Schodet2012-06-02 00:31:12 +0200
committerNicolas Schodet2012-06-02 00:31:59 +0200
commita1c8880ef806ba64f5f985cec8e845f01ebae228 (patch)
tree6401be7c226f300492ec9ddd69ba577c8270b303 /digital/io-hub/src/guybrush/top.c
parent263fa4fa5472cd013f2ac2993e6cee0f8d73a2fb (diff)
digital/io-hub/src/guybrush: wait when unloading
Diffstat (limited to 'digital/io-hub/src/guybrush/top.c')
-rw-r--r--digital/io-hub/src/guybrush/top.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/digital/io-hub/src/guybrush/top.c b/digital/io-hub/src/guybrush/top.c
index 2bc6c8e1..10f65c7f 100644
--- a/digital/io-hub/src/guybrush/top.c
+++ b/digital/io-hub/src/guybrush/top.c
@@ -111,7 +111,9 @@ FSM_STATES (
/* Going to an unload position. */
TOP_UNLOAD_GOING,
/* Going back in unload zone. */
- TOP_UNLOAD_GOING_BACK)
+ TOP_UNLOAD_GOING_BACK,
+ /* Unloading, waiting for elements to fall. */
+ TOP_UNLOADING)
FSM_START_WITH (TOP_START)
@@ -678,18 +680,23 @@ FSM_TRANS (TOP_UNLOAD_GOING, move_success,
}
}
-FSM_TRANS (TOP_UNLOAD_GOING_BACK, robot_move_success, TOP_DECISION)
+FSM_TRANS (TOP_UNLOAD_GOING_BACK, robot_move_success, TOP_UNLOADING)
{
top_do_unload ();
return FSM_NEXT (TOP_UNLOAD_GOING_BACK, robot_move_success);
}
-FSM_TRANS (TOP_UNLOAD_GOING_BACK, robot_move_failure, TOP_DECISION)
+FSM_TRANS (TOP_UNLOAD_GOING_BACK, robot_move_failure, TOP_UNLOADING)
{
top_do_unload ();
return FSM_NEXT (TOP_UNLOAD_GOING_BACK, robot_move_failure);
}
+FSM_TRANS_TIMEOUT (TOP_UNLOADING, 250, TOP_DECISION)
+{
+ return FSM_NEXT_TIMEOUT (TOP_UNLOADING);
+}
+
/** UNLOAD failures. */
FSM_TRANS (TOP_UNLOAD_GOING, move_failure, TOP_DECISION)