summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--digital/io/src/filterbridge.fsm9
-rw-r--r--digital/io/src/filterbridge_cb.c16
2 files changed, 22 insertions, 3 deletions
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);
}