From 1f18297e2a7c96659a63821a766050013e23bf67 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Dec 2010 11:07:54 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2504 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32/ADC/main.c | 13 +++++++++++-- testhal/STM32/CAN/main.c | 13 +++++++++++-- testhal/STM32/PWM/main.c | 13 +++++++++++-- testhal/STM32/SPI/main.c | 13 +++++++++++-- testhal/STM32/UART/main.c | 13 +++++++++++-- testhal/STM8S/SPI/demo/main.c | 11 ++++++++--- 6 files changed, 63 insertions(+), 13 deletions(-) diff --git a/testhal/STM32/ADC/main.c b/testhal/STM32/ADC/main.c index 20fa6005b..ded1bd2b9 100644 --- a/testhal/STM32/ADC/main.c +++ b/testhal/STM32/ADC/main.c @@ -82,14 +82,23 @@ static msg_t Thread1(void *arg) { } /* - * Entry point, note, the main() function is already a thread in the system - * on entry. + * Application entry point. */ int main(int argc, char **argv) { (void)argc; (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(); + /* * Setting up analog inputs used by the demo. */ diff --git a/testhal/STM32/CAN/main.c b/testhal/STM32/CAN/main.c index 21a04d4bf..b23e85b3c 100644 --- a/testhal/STM32/CAN/main.c +++ b/testhal/STM32/CAN/main.c @@ -78,14 +78,23 @@ static msg_t can_tx(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) { (void)argc; (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 CAN driver 1. */ diff --git a/testhal/STM32/PWM/main.c b/testhal/STM32/PWM/main.c index bda66573d..71daaacdc 100644 --- a/testhal/STM32/PWM/main.c +++ b/testhal/STM32/PWM/main.c @@ -60,14 +60,23 @@ static PWMConfig pwmcfg = { }; /* - * Entry point, note, the main() function is already a thread in the system - * on entry. + * Application entry point. */ int main(int argc, char **argv) { (void)argc; (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(); + /* * Creates the blinker thread. */ 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; @@ -96,6 +95,16 @@ int main(int argc, char **argv) { (void)argc; (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. */ diff --git a/testhal/STM32/UART/main.c b/testhal/STM32/UART/main.c index b823430c9..ac4afc1c7 100644 --- a/testhal/STM32/UART/main.c +++ b/testhal/STM32/UART/main.c @@ -111,14 +111,23 @@ static UARTConfig uart_cfg_1 = { }; /* - * Entry point, note, the main() function is already a thread in the system - * on entry. + * Application entry point. */ int main(int argc, char **argv) { (void)argc; (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. */ diff --git a/testhal/STM8S/SPI/demo/main.c b/testhal/STM8S/SPI/demo/main.c index d73d8d2ab..9ea76bcf8 100644 --- a/testhal/STM8S/SPI/demo/main.c +++ b/testhal/STM8S/SPI/demo/main.c @@ -46,14 +46,19 @@ static ROMCONST uint8_t digits[32] = { static uint8_t buffer[32]; /* - * Entry point. + * Application entry point. */ void main(void) { /* - * Board/HAL initialization. + * 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. */ - hwinit(); + halInit(); + chSysInit(); /* * OS initialization. -- cgit v1.2.3