summaryrefslogtreecommitdiffhomepage
path: root/digital/io/src/main.c
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-21 23:56:02 +0200
committerJérémy Dufour2008-04-21 23:56:02 +0200
commitb814bc2ab370832431d3fa659521949482aa2180 (patch)
tree7c3ef4e96e0de2eb8e060eceacf6ff2b4770b844 /digital/io/src/main.c
parent4e9abfc25206587a3e96cfb2251dae5e81d34b5f (diff)
* digital/io/src
- move functions definitions of switch module to a source file ; - add a filter when getting the state value of the jack ; - add jack events transmission to the top FSM into the main loop ; - make it build for host implementation.
Diffstat (limited to 'digital/io/src/main.c')
-rw-r--r--digital/io/src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/digital/io/src/main.c b/digital/io/src/main.c
index 8b6f8d78..1be36985 100644
--- a/digital/io/src/main.c
+++ b/digital/io/src/main.c
@@ -106,6 +106,9 @@ main_loop (void)
/* Update TWI module to get new data from the asserv board */
asserv_update_status ();
+ /* Update switch module */
+ switch_update ();
+
/* Is last command has been acknowledged? */
if (asserv_last_cmd_ack () == 0)
/* Called function to manage retransmission */
@@ -141,7 +144,11 @@ main_loop (void)
fsm_handle_event (&getsamples_fsm,
GETSAMPLES_EVENT_arm_pass_noted_position);
}
- /* Check other sensors */
+ /* Jack */
+ fsm_handle_event (&top_fsm, switch_get_jack () ?
+ TOP_EVENT_jack_removed_from_bot :
+ TOP_EVENT_jack_inserted_into_bot);
+ /* TODO: Check other sensors */
}
}
}