aboutsummaryrefslogtreecommitdiffstats
path: root/demos/AVR-AT90CANx-GCC/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/AVR-AT90CANx-GCC/main.c')
-rw-r--r--demos/AVR-AT90CANx-GCC/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c
index 48f58d080..61156b040 100644
--- a/demos/AVR-AT90CANx-GCC/main.c
+++ b/demos/AVR-AT90CANx-GCC/main.c
@@ -24,7 +24,6 @@
void hwinit(void);
static BYTE8 waThread1[UserStackSize(32)];
-
static t_msg Thread1(void *arg) {
while (TRUE) {
@@ -37,8 +36,19 @@ int main(int argc, char **argv) {
hwinit();
+ /*
+ * The main() function becomes a thread here then the interrupts are
+ * enabled and ChibiOS/RT goes live.
+ */
chSysInit();
+
+ /*
+ * Starts the LED blinker thread.
+ */
chThdCreate(NORMALPRIO, 0, waThread1, sizeof(waThread1), Thread1, NULL);
- chSysPause();
+
+ while(TRUE)
+ /* Do stuff*/ ;
+
return 0;
}