summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Dufour2008-05-01 14:26:47 +0200
committerJérémy Dufour2008-05-01 14:26:47 +0200
commitabf969b98e551a393811bd5908bdb3eb14ca0763 (patch)
tree1c93108ee9c42b95fed0a25b187d1d52a71614aa
parentdf67250d3a0a0bd0305dfb0970f445df7bf65770 (diff)
* digital/io/src
- change top FSM to only take one ball by distributor when in homologation mode.
-rw-r--r--digital/io/src/top_cb.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/digital/io/src/top_cb.c b/digital/io/src/top_cb.c
index b8bf6a62..076fcca7 100644
--- a/digital/io/src/top_cb.c
+++ b/digital/io/src/top_cb.c
@@ -40,6 +40,8 @@
#include "getsamples.h" /* getsamples_* */
#include "gutter.h" /* gutter_start */
+#include "main.h"
+
#include "io.h"
/**
@@ -133,6 +135,10 @@ top__GO_TO_ADVERSE_ICE_DISTRIBUTOR__move_fsm_finished (void)
* samples. The problem is this should depend on the time we have until
* the end of match */
uint8_t bitfield = _BV (out_right_box) | _BV (middle_right_box);
+ if (main_always_stop_for_obstacle)
+ {
+ bitfield = _BV (middle_right_box);
+ }
getsamples_start (PG_DISTRIBUTOR_ICE_ADVERSE_A, bitfield);
return top_next (GO_TO_ADVERSE_ICE_DISTRIBUTOR, move_fsm_finished);
}
@@ -158,6 +164,10 @@ top__GO_TO_OUR_ICE_DISTRIBUTOR__move_fsm_finished (void)
bitfield = _BV (out_left_box) | _BV (middle_box) | _BV
(out_right_box);
}
+ if (main_always_stop_for_obstacle)
+ {
+ bitfield = _BV (middle_right_box);
+ }
getsamples_start (PG_DISTRIBUTOR_ICE_OUR_A, bitfield);
return top_next (GO_TO_OUR_ICE_DISTRIBUTOR, move_fsm_finished);
}
@@ -184,6 +194,10 @@ top__GO_TO_SAMPLE_DISTRIBUTOR__move_fsm_finished (void)
*/
bitfield = _BV (middle_left_box) | _BV (middle_right_box);
}
+ if (main_always_stop_for_obstacle)
+ {
+ bitfield = _BV (out_left_box);
+ }
getsamples_start (PG_DISTRIBUTOR_SAMPLE_OUR_A, bitfield);
return top_next (GO_TO_SAMPLE_DISTRIBUTOR, move_fsm_finished);
}
@@ -236,7 +250,7 @@ top__GET_ICE_FROM_OUR_ICE_DISTRIBUTOR__get_samples_fsm_finished (void)
else
{
/* Start the move FSM to go to the gutter */
- move_start (PG_GUTTER_X, PG_GUTTER_Y, 1);
+ move_start (PG_GUTTER_X, PG_GUTTER_Y, 0);
return top_next_branch (GET_ICE_FROM_OUR_ICE_DISTRIBUTOR, get_samples_fsm_finished, full);
}
}
@@ -284,7 +298,7 @@ fsm_branch_t
top__GET_ICE_FROM_ADVERSE_ICE_DISTRIBUTOR__get_samples_fsm_finished (void)
{
/* Start the move FSM to go to the gutter */
- move_start (PG_GUTTER_X, PG_GUTTER_Y, 1);
+ move_start (PG_GUTTER_X, PG_GUTTER_Y, 0);
return top_next (GET_ICE_FROM_ADVERSE_ICE_DISTRIBUTOR, get_samples_fsm_finished);
}