summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/gutter_cb.c
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-03-30 20:53:54 +0200
committerNélio Laranjeiro2008-03-30 20:53:54 +0200
commit20bbd9db488c56bfc2195865ec2b5c77fa024dbd (patch)
treee43c7bf410358b218eed70a1d3555c921ce0a6d1 /digital/io/src/gutter_cb.c
parent08f990e718f99e6caf53cb4583db267a0714ce6b (diff)
Moved the gutter fsm to the io/directory.
Diffstat (limited to 'digital/io/src/gutter_cb.c')
-rw-r--r--digital/io/src/gutter_cb.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/digital/io/src/gutter_cb.c b/digital/io/src/gutter_cb.c
new file mode 100644
index 00000000..729c187f
--- /dev/null
+++ b/digital/io/src/gutter_cb.c
@@ -0,0 +1,70 @@
+/*
+ * THIS IS AN AUTOMATICALLY GENERATED FILE, DO NOT EDIT!
+ *
+ * Skeleton for get_samples callbacks implementation.
+ *
+ *
+ */
+#include "gutter_cb.h"
+
+/*
+ * START =ok=>
+ * => GO_TO_GUTTER
+ * Go to the gutter.
+ */
+gutter_branch_t
+gutter__START__ok (gutter_t *user)
+{
+ asserv_go_to_gutter();
+ return gutter_next (START, ok);
+}
+
+/*
+ * CLOSE_COLLECTOR =collector_closed=>
+ * => END
+ * The samples has been inserted in the gutter.
+ */
+gutter_branch_t
+gutter__CLOSE_COLLECTOR__collector_closed (gutter_t *user)
+{
+ //Close the collector.
+ trap_close_rear_panel();
+ return gutter_next (CLOSE_COLLECTOR, collector_closed);
+}
+
+/*
+ * GO_TO_GUTTER =position_failed=>
+ * => GO_TO_GUTTER
+ * The position failed, shall try another path.
+ */
+gutter_branch_t
+gutter__GO_TO_GUTTER__position_failed (gutter_t *user)
+{
+ return gutter_next (GO_TO_GUTTER, position_failed);
+}
+
+/*
+ * GO_TO_GUTTER =position_reached=>
+ * => OPEN_COLLECTOR
+ * The robo is near the gutter and the door can be opened.
+ */
+gutter_branch_t
+gutter__GO_TO_GUTTER__position_reached (gutter_t *user)
+{
+ // Open the collector.
+ trap_open_rear_panel();
+ return gutter_next (GO_TO_GUTTER, position_reached);
+}
+
+/*
+ * OPEN_COLLECTOR =collector_opened=>
+ * => CLOSE_COLLECTOR
+ * Wait some time and clse the door.
+ */
+gutter_branch_t
+gutter__OPEN_COLLECTOR__collector_opened (gutter_t *user)
+{
+ utils_delay_ms(4.4);
+ return gutter_next (OPEN_COLLECTOR, collector_opened);
+}
+