aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/SPI/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'testhal/STM32/SPI/main.c')
-rw-r--r--testhal/STM32/SPI/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/testhal/STM32/SPI/main.c b/testhal/STM32/SPI/main.c
index 674a1c558..146894a0a 100644
--- a/testhal/STM32/SPI/main.c
+++ b/testhal/STM32/SPI/main.c
@@ -87,8 +87,7 @@ static msg_t spi_thread_2(void *p) {
}
/*
- * Entry point, note, the main() function is already a thread in the system
- * on entry.
+ * Application entry point.
*/
int main(int argc, char **argv) {
unsigned i;
@@ -97,6 +96,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();
+
+ /*
* SPI1 I/O pins setup.
*/
palSetPadMode(IOPORT1, 5, PAL_MODE_STM32_ALTERNATE_PUSHPULL); /* SCK. */