summaryrefslogtreecommitdiffhomepage
path: root/digital
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-22 21:56:47 +0200
committerNicolas Schodet2008-04-22 21:56:47 +0200
commit846f73eb9aac840c86b9f79874244002c9e47e0e (patch)
tree8f8d4fb2384fde108e3531bec764da19a0e419e4 /digital
parent2057a5df0036735cec4089c66eb36dc4f04245a1 (diff)
* digital/io/src:
- fixed asserv status event generation. - also require that the last command be acknowledged or status can be out of date if a transition sent a new command.
Diffstat (limited to 'digital')
-rw-r--r--digital/io/src/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/digital/io/src/main.c b/digital/io/src/main.c
index 6ca9327b..73b41196 100644
--- a/digital/io/src/main.c
+++ b/digital/io/src/main.c
@@ -118,21 +118,25 @@ main_loop (void)
asserv_retransmit ();
else
{
+ asserv_status_e move_status = asserv_last_cmd_ack ()
+ ? asserv_move_cmd_status () : none;
/* Check commands move status */
- if (asserv_move_cmd_status () == success)
+ if (move_status == success)
{
/* Pass it to all the FSM that need it */
fsm_handle_event (&getsamples_fsm,
GETSAMPLES_EVENT_bot_move_succeed);
}
- else
+ else if (move_status == failure)
{
/* Move failed */
fsm_handle_event (&getsamples_fsm,
GETSAMPLES_EVENT_bot_move_failed);
}
+ asserv_status_e arm_status = asserv_last_cmd_ack ()
+ ? asserv_arm_cmd_status () : none;
/* Check commands arm status */
- if (asserv_arm_cmd_status () == success)
+ if (arm_status == success)
{
/* Pass it to all the FSM that need it */
fsm_handle_event (&getsamples_fsm,