[tuxdroid-svn] r738 - firmware/tuxcore/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-11-27 15:30:02
|
Author: jaguarondi Date: 2007-11-27 16:29:55 +0100 (Tue, 27 Nov 2007) New Revision: 738 Modified: firmware/tuxcore/trunk/main.c Log: * Using <stdbool.h> instead of a custom bool typedef. Modified: firmware/tuxcore/trunk/main.c =================================================================== --- firmware/tuxcore/trunk/main.c 2007-11-27 15:26:14 UTC (rev 737) +++ firmware/tuxcore/trunk/main.c 2007-11-27 15:29:55 UTC (rev 738) @@ -32,6 +32,7 @@ \image html main_flowchart.png */ +#include <stdbool.h> #include <avr/interrupt.h> #include <avr/io.h> #include <avr/pgmspace.h> @@ -56,13 +57,6 @@ */ DBG_STACK_INIT -/** \brief Bool type. */ -typedef enum -{ - TRUE = 1, - FALSE = 0, -} bool; - /** * \name Software timers * The main tick has a period of 4ms and is driven by a hardware timer @@ -121,15 +115,15 @@ ISR(SIG_OUTPUT_COMPARE2A) { t4ms_cnt++; - t4ms_flag = TRUE; + t4ms_flag = true; if (t4ms_cnt == 25) { t4ms_cnt = 0; - t100ms_flag = TRUE; + t100ms_flag = true; if (++t100ms_cnt == 10) { t100ms_cnt = 0; - t1s_flag = TRUE; + t1s_flag = true; } } } @@ -160,7 +154,7 @@ { if (t4ms_flag) { - t4ms_flag = FALSE; + t4ms_flag = false; motor_control(); if (sensorsUpdate) sensors_control(); @@ -185,7 +179,7 @@ } if (t100ms_flag) { - t100ms_flag = FALSE; + t100ms_flag = false; updateStatusFlag = 1; if (event_timer) { @@ -195,7 +189,7 @@ } if (t1s_flag) { - t1s_flag = FALSE; + t1s_flag = false; /* XXX disabled ir signals for tux greeting as this function needs * to be refactored and was conflicting to the new light * measurement method. */ |