From 1e8fee2bf4e410a64401e30e6cbca526fba20209 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Tue, 19 May 2009 17:59:05 +0200 Subject: * digital/io/src: - add a temporisation after pushing the puck into the elevator before giving the elevator the order to move. --- digital/io/src/filterbridge.fsm | 9 ++++++++- digital/io/src/filterbridge_cb.c | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'digital/io') diff --git a/digital/io/src/filterbridge.fsm b/digital/io/src/filterbridge.fsm index 5722f5e2..5613ffb5 100644 --- a/digital/io/src/filterbridge.fsm +++ b/digital/io/src/filterbridge.fsm @@ -17,6 +17,8 @@ States: release puck to the lift and block a new puck on pos1 PUSH_PUCK push the puck to the lift + TEMPO_ELVETATOR_COMMUNICATION [timeout=225] + a temporisation for the communication between the eleveator and the FB. Events: start @@ -57,5 +59,10 @@ OPEN_DOOR: we push the puck to the lift PUSH_PUCK: - no_puck_on_pos2 -> CLOSE_DOOR + no_puck_on_pos2 -> TEMPO_ELVETATOR_COMMUNICATION + nothing to do. + +TEMPO_ELVETATOR_COMMUNICATION: + state_timeout -> CLOSE_DOOR the puck disappears, we close doors + tell the elevator we are ready. diff --git a/digital/io/src/filterbridge_cb.c b/digital/io/src/filterbridge_cb.c index e3b7f096..3f571f66 100644 --- a/digital/io/src/filterbridge_cb.c +++ b/digital/io/src/filterbridge_cb.c @@ -109,18 +109,30 @@ filterbridge__OPEN_DOOR__state_timeout (void) /* * PUSH_PUCK =no_puck_on_pos2=> + * => TEMPO_ELVETATOR_COMMUNICATION + * nothing to do. + */ +fsm_branch_t +filterbridge__PUSH_PUCK__no_puck_on_pos2 (void) +{ + return filterbridge_next (PUSH_PUCK, no_puck_on_pos2); +} + +/* + * TEMPO_ELVETATOR_COMMUNICATION =state_timeout=> * => CLOSE_DOOR * the puck disappears, we close doors + * tell the elevator we are ready. */ fsm_branch_t -filterbridge__PUSH_PUCK__no_puck_on_pos2 (void) +filterbridge__TEMPO_ELVETATOR_COMMUNICATION__state_timeout (void) { ++nb_puck_in_elvt; --nb_puck_fb; elvt_new_puck = 1; servo_pos_move_to(SERVO_FINGER_ID, SERVO_FINGER_IDLE); servo_pos_move_to(SERVO_DOOR_ID, SERVO_DOOR_CLOSE); - return filterbridge_next (PUSH_PUCK, no_puck_on_pos2); + return filterbridge_next (TEMPO_ELVETATOR_COMMUNICATION, state_timeout); } -- cgit v1.2.3