aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-12-19 11:07:54 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-12-19 11:07:54 +0000
commit1f18297e2a7c96659a63821a766050013e23bf67 (patch)
treec2630de175662f9a774f688a78f97aa15e7d8d46
parentfa1b222c21a4c2aee932d6605facb9706bf0dae3 (diff)
downloadChibiOS-1f18297e2a7c96659a63821a766050013e23bf67.tar.gz
ChibiOS-1f18297e2a7c96659a63821a766050013e23bf67.tar.bz2
ChibiOS-1f18297e2a7c96659a63821a766050013e23bf67.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2504 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--testhal/STM32/ADC/main.c13
-rw-r--r--testhal/STM32/CAN/main.c13
-rw-r--r--testhal/STM32/PWM/main.c13
-rw-r--r--testhal/STM32/SPI/main.c13
-rw-r--r--testhal/STM32/UART/main.c13
-rw-r--r--testhal/STM8S/SPI/demo/main.c11
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,8 +82,7 @@ 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) {
@@ -91,6 +90,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();
+
+ /*
* Setting up analog inputs used by the demo.
*/
palSetGroupMode(GPIOC, PAL_PORT_BIT(0) | PAL_PORT_BIT(1),
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,8 +78,7 @@ 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) {
@@ -87,6 +86,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 CAN driver 1.
*/
canStart(&CAND1, &cancfg);
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,8 +60,7 @@ 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) {
@@ -69,6 +68,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();
+
+ /*
* Creates the blinker thread.
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
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. */
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,8 +111,7 @@ 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) {
@@ -120,6 +119,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.
*/
uartStart(&UARTD2, &uart_cfg_1);
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.