From f51b15ddb7c1045e0edf8b50bb6933db7fcf19f3 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sat, 29 May 2010 13:44:53 +0200 Subject: digital/io/src: add more blocking handling and timeout --- digital/io/src/ai_move_cb.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'digital/io/src/ai_move_cb.c') diff --git a/digital/io/src/ai_move_cb.c b/digital/io/src/ai_move_cb.c index 5fc70653..69a46a3c 100644 --- a/digital/io/src/ai_move_cb.c +++ b/digital/io/src/ai_move_cb.c @@ -247,6 +247,30 @@ ai__MOVE_ROTATING__bot_move_succeed (void) return ai_next (MOVE_ROTATING, bot_move_succeed); } +/* + * MOVE_ROTATING =bot_move_failed=> + * => MOVE_MOVING + * move to next position. + */ +fsm_branch_t +ai__MOVE_ROTATING__bot_move_failed (void) +{ + ai__MOVE_ROTATING__bot_move_succeed (); + return ai_next (MOVE_ROTATING, bot_move_failed); +} + +/* + * MOVE_ROTATING =state_timeout=> + * => MOVE_MOVING + * move to next position. + */ +fsm_branch_t +ai__MOVE_ROTATING__state_timeout (void) +{ + ai__MOVE_ROTATING__bot_move_succeed (); + return ai_next (MOVE_ROTATING, state_timeout); +} + /* * MOVE_ROTATING =loader_errored=> * => MOVE_LOADER_UNBLOCKING_UPING @@ -318,6 +342,19 @@ ai__MOVE_MOVING__bot_move_failed (void) return ai_next (MOVE_MOVING, bot_move_failed); } +/* + * MOVE_MOVING =state_timeout=> + * => MOVE_MOVING_BACKWARD_TO_TURN_FREELY + * reset final_move. + * move backward to turn freely. + */ +fsm_branch_t +ai__MOVE_MOVING__state_timeout (void) +{ + ai__MOVE_MOVING__bot_move_failed (); + return ai_next (MOVE_MOVING, state_timeout); +} + /* * MOVE_MOVING =obstacle_in_front=> * tryagain => MOVE_WAIT_FOR_CLEAR_PATH -- cgit v1.2.3