From 59f672a1c598dade740f92b9daa040db2dc5d46f Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 2 May 2008 12:46:30 +0200 Subject: * digital/io/src: - shortened getsample timeout. - reset timeout on each sample. --- digital/io/src/getsamples.fsm | 1 + digital/io/src/getsamples_cb.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'digital/io') 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); } -- cgit v1.2.3