summaryrefslogtreecommitdiffhomepage
path: root/digital
diff options
context:
space:
mode:
authorNicolas Schodet2010-04-13 00:22:42 +0200
committerNicolas Schodet2010-04-13 00:22:42 +0200
commit3e28a1b46e8541fddb657a1e4bae2e32ba077085 (patch)
tree69c249ec8875d82c053055d761eed7507b2debac /digital
parent37795e2ccd5f9319833f5d0b4ebfbad9d5684350 (diff)
digital/io/src: update test top FSM
Diffstat (limited to 'digital')
-rw-r--r--digital/io/src/ai_top_cb.c26
-rw-r--r--digital/io/src/top.fsm4
2 files changed, 29 insertions, 1 deletions
diff --git a/digital/io/src/ai_top_cb.c b/digital/io/src/ai_top_cb.c
index 60f2c148..1482dd36 100644
--- a/digital/io/src/ai_top_cb.c
+++ b/digital/io/src/ai_top_cb.c
@@ -71,12 +71,24 @@ ai__WAIT_INIT_TO_FINISH__init_match_is_started (void)
fsm_branch_t
ai__GO_FAR__move_fsm_succeed (void)
{
- position_t pos = PG_POSITION_DEG (1000, 1000, 0);
+ position_t pos = PG_POSITION_DEG (1000, 1000, 180);
move_start (pos, 0);
return ai_next (GO_FAR, move_fsm_succeed);
}
/*
+ * GO_FAR =move_fsm_failed=>
+ * => GO_NEAR
+ * go to a near point
+ */
+fsm_branch_t
+ai__GO_FAR__move_fsm_failed (void)
+{
+ ai__GO_FAR__move_fsm_succeed ();
+ return ai_next (GO_FAR, move_fsm_failed);
+}
+
+/*
* GO_NEAR =move_fsm_succeed=>
* => GO_FAR
* restart
@@ -89,3 +101,15 @@ ai__GO_NEAR__move_fsm_succeed (void)
return ai_next (GO_NEAR, move_fsm_succeed);
}
+/*
+ * GO_NEAR =move_fsm_failed=>
+ * => GO_FAR
+ * restart
+ */
+fsm_branch_t
+ai__GO_NEAR__move_fsm_failed (void)
+{
+ ai__GO_NEAR__move_fsm_succeed ();
+ return ai_next (GO_NEAR, move_fsm_failed);
+}
+
diff --git a/digital/io/src/top.fsm b/digital/io/src/top.fsm
index 492f286d..6340984e 100644
--- a/digital/io/src/top.fsm
+++ b/digital/io/src/top.fsm
@@ -45,7 +45,11 @@ WAIT_INIT_TO_FINISH:
GO_FAR:
move_fsm_succeed -> GO_NEAR
go to a near point
+ move_fsm_failed -> GO_NEAR
+ go to a near point
GO_NEAR:
move_fsm_succeed -> GO_FAR
restart
+ move_fsm_failed -> GO_FAR
+ restart