summaryrefslogtreecommitdiff
path: root/digital/io/src/main.c
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-23 10:23:03 +0200
committerJérémy Dufour2008-04-23 10:23:03 +0200
commit331037945d5e0146868a82707e7cc9e14942e58f (patch)
tree4481241989d33c7e7580a526e17fac38cb68396d /digital/io/src/main.c
parent14516e73922ef733cd6987143a1e725ba3d9fdba (diff)
* digital/io/src
- seperate chrono into two files (source and header) ; - add necessary functions to end the match ; - integrate it into the main loop ; - partial integration into the simulator (need to simulate a counter).
Diffstat (limited to 'digital/io/src/main.c')
-rw-r--r--digital/io/src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/digital/io/src/main.c b/digital/io/src/main.c
index 883bb25d..efcd9d4e 100644
--- a/digital/io/src/main.c
+++ b/digital/io/src/main.c
@@ -43,6 +43,7 @@
#include "giboulee.h" /* team_color */
#include "getsamples.h" /* getsamples_start */
#include "top.h" /* top_* */
+#include "chrono.h" /* chrono_end_match */
#include "io.h"
@@ -106,6 +107,15 @@ main_loop (void)
/* Manage UART protocol */
proto_accept (uart0_getc ());
+ /* Is match over? */
+ if (chrono_is_match_over ())
+ {
+ /* End it and block here indefinitely */
+ chrono_end_match (42);
+ /* Safety */
+ return;
+ }
+
/* Update TWI module to get new data from the asserv board */
asserv_update_status ();