summaryrefslogtreecommitdiffhomepage
path: root/digital/io
diff options
context:
space:
mode:
authorNicolas Schodet2008-05-02 12:46:30 +0200
committerNicolas Schodet2008-05-02 12:46:30 +0200
commit59f672a1c598dade740f92b9daa040db2dc5d46f (patch)
tree7eb5d5318e335528aa7ec97a9f19264056b130e2 /digital/io
parent1f55a10d544779e2cd675b9fb60642eeeeedcf2c (diff)
* digital/io/src:
- shortened getsample timeout. - reset timeout on each sample.
Diffstat (limited to 'digital/io')
-rw-r--r--digital/io/src/getsamples.fsm1
-rw-r--r--digital/io/src/getsamples_cb.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/digital/io/src/getsamples.fsm b/digital/io/src/getsamples.fsm
index 154bb489..0079d458 100644
--- a/digital/io/src/getsamples.fsm
+++ b/digital/io/src/getsamples.fsm
@@ -67,6 +67,7 @@ TAKE_SAMPLES:
arm_pass_noted_position: more -> .
prepare the classification of the taken sample
take a new one
+ reset the timeout
arm_pass_noted_position: no_more -> MOVE_AWAY_FROM_DISTRIBUTOR
go backward
wait_finished -> MOVE_AWAY_FROM_DISTRIBUTOR
diff --git a/digital/io/src/getsamples_cb.c b/digital/io/src/getsamples_cb.c
index 62543f1a..14ac4996 100644
--- a/digital/io/src/getsamples_cb.c
+++ b/digital/io/src/getsamples_cb.c
@@ -44,7 +44,7 @@
/**
* Arm time out.
*/
-#define GET_SAMPLES_ARM_TIMEOUT (12 * 225 + 225 / 2)
+#define GET_SAMPLES_ARM_TIMEOUT (5 * 225)
/**
* 'Private' get samples data used internaly by the FSM.
@@ -185,6 +185,7 @@ getsamples__TAKE_SAMPLES__wait_finished (void)
* more => TAKE_SAMPLES
* prepare the classification of the taken sample
* take a new one
+ * reset the timeout
*/
fsm_branch_t
getsamples__TAKE_SAMPLES__arm_pass_noted_position (void)
@@ -197,6 +198,8 @@ getsamples__TAKE_SAMPLES__arm_pass_noted_position (void)
/* Compute notifier */
getsamples_data_.arm_noted_position += BOT_ARM_THIRD_ROUND;
asserv_arm_set_position_reached (getsamples_data_.arm_noted_position);
+ /* Post an event for the top FSM to be waked up later */
+ main_getsamples_wait_cycle = GET_SAMPLES_ARM_TIMEOUT;
/* Continue to take sample */
return getsamples_next_branch (TAKE_SAMPLES, arm_pass_noted_position, more);
}