aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARMCM3-STM32F103-IAR/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ARMCM3-STM32F103-IAR/main.c')
-rw-r--r--demos/ARMCM3-STM32F103-IAR/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/demos/ARMCM3-STM32F103-IAR/main.c b/demos/ARMCM3-STM32F103-IAR/main.c
index a3a5c062e..e133e6e3b 100644
--- a/demos/ARMCM3-STM32F103-IAR/main.c
+++ b/demos/ARMCM3-STM32F103-IAR/main.c
@@ -22,7 +22,7 @@
#include "test.h"
/*
- * Red LEDs blinker thread, times are in milliseconds.
+ * Red LED blinker thread, times are in milliseconds.
*/
static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
@@ -34,10 +34,11 @@ static msg_t Thread1(void *arg) {
palSetPad(IOPORT3, GPIOC_LED);
chThdSleepMilliseconds(500);
}
+ return 0;
}
/*
- * Entry point.
+ * Application entry point.
*/
int main(int argc, char **argv) {
@@ -45,6 +46,16 @@ int main(int argc, char **argv) {
(void)argv;
/*
+ * System initializations.
+ * - HAL initialization, this also initializes the configured device drivers
+ * and performs the board-specific initializations.
+ * - Kernel initialization, the main() function becomes a thread and the
+ * RTOS is active.
+ */
+ halInit();
+ chSysInit();
+
+ /*
* Activates the serial driver 2 using the driver default configuration.
*/
sdStart(&SD2, NULL);
@@ -63,4 +74,5 @@ int main(int argc, char **argv) {
TestThread(&SD2);
chThdSleepMilliseconds(500);
}
+ return 0;
}