From ada9fb82aac5f1bc2465d4555380c2bef40cb8d3 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Dec 2010 09:36:44 +0000 Subject: [PATCH] LPC1xxx board files and demos updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2498 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/EA_LPCXPRESSO_BB_1114/board.c | 22 +++++----------------- boards/EA_LPCXPRESSO_BB_1114/board.h | 4 +++- boards/EA_LPCXPRESSO_BB_1343/board.c | 22 +++++----------------- boards/EA_LPCXPRESSO_BB_1343/board.h | 4 +++- demos/ARMCM0-LPC1114-GCC/main.c | 13 +++++++++++-- demos/ARMCM3-LPC1343-GCC/main.c | 13 +++++++++++-- docs/reports/LPC1114-48.txt | 2 +- docs/reports/LPC1343-72.txt | 6 +++--- 8 files changed, 42 insertions(+), 44 deletions(-) diff --git a/boards/EA_LPCXPRESSO_BB_1114/board.c b/boards/EA_LPCXPRESSO_BB_1114/board.c index 60fb7eed3..68e8efc05 100644 --- a/boards/EA_LPCXPRESSO_BB_1114/board.c +++ b/boards/EA_LPCXPRESSO_BB_1114/board.c @@ -34,25 +34,18 @@ const PALConfig pal_default_config = { /* * Early initialization code. - * This initialization is performed just after reset before BSS and DATA - * segments initialization. + * This initialization must be performed just after stack setup and before + * any other initialization. */ -void hwinit0(void) { +void __early_init(void) { lpc111x_clock_init(); } /* - * Late initialization code. - * This initialization is performed after BSS and DATA segments initialization - * and before invoking the main() function. + * Board-specific initialization code. */ -void hwinit1(void) { - - /* - * HAL initialization. - */ - halInit(); +void boardInit(void) { /* * Extra, board-specific, initializations. @@ -64,9 +57,4 @@ void hwinit1(void) { and makes it GPIO1_2. */ LPC_IOCON->PIO1_9 = 0xC0; /* Disables pull-up on LED3R output.*/ LPC_IOCON->PIO1_10 = 0xC0; /* Disables pull-up on LED3G output.*/ - - /* - * ChibiOS/RT initialization. - */ - chSysInit(); } diff --git a/boards/EA_LPCXPRESSO_BB_1114/board.h b/boards/EA_LPCXPRESSO_BB_1114/board.h index e7f2b22d8..be7805709 100644 --- a/boards/EA_LPCXPRESSO_BB_1114/board.h +++ b/boards/EA_LPCXPRESSO_BB_1114/board.h @@ -86,12 +86,14 @@ #define GPIO1_LED3G 10 #define GPIO1_SPI0SEL 11 +#if !defined(_FROM_ASM_) #ifdef __cplusplus extern "C" { #endif - void hwinit(void); + void boardInit(void); #ifdef __cplusplus } #endif +#endif /* _FROM_ASM_ */ #endif /* _BOARD_H_ */ diff --git a/boards/EA_LPCXPRESSO_BB_1343/board.c b/boards/EA_LPCXPRESSO_BB_1343/board.c index 4055ee116..a7844e76a 100644 --- a/boards/EA_LPCXPRESSO_BB_1343/board.c +++ b/boards/EA_LPCXPRESSO_BB_1343/board.c @@ -34,25 +34,18 @@ const PALConfig pal_default_config = { /* * Early initialization code. - * This initialization is performed just after reset before BSS and DATA - * segments initialization. + * This initialization must be performed just after stack setup and before + * any other initialization. */ -void hwinit0(void) { +void __early_init(void) { LPC13xx_clock_init(); } /* - * Late initialization code. - * This initialization is performed after BSS and DATA segments initialization - * and before invoking the main() function. + * Board-specific initialization code. */ -void hwinit1(void) { - - /* - * HAL initialization. - */ - halInit(); +void boardInit(void) { /* * Extra, board-specific, initializations. @@ -64,9 +57,4 @@ void hwinit1(void) { and makes it GPIO1_2. */ LPC_IOCON->PIO1_9 = 0xC0; /* Disables pull-up on LED3R output.*/ LPC_IOCON->PIO1_10 = 0xC0; /* Disables pull-up on LED3G output.*/ - - /* - * ChibiOS/RT initialization. - */ - chSysInit(); } diff --git a/boards/EA_LPCXPRESSO_BB_1343/board.h b/boards/EA_LPCXPRESSO_BB_1343/board.h index 2375e8f64..dfcb1f3f9 100644 --- a/boards/EA_LPCXPRESSO_BB_1343/board.h +++ b/boards/EA_LPCXPRESSO_BB_1343/board.h @@ -81,12 +81,14 @@ #define GPIO1_LED3G 10 #define GPIO1_SPI0SEL 11 +#if !defined(_FROM_ASM_) #ifdef __cplusplus extern "C" { #endif - void hwinit(void); + void boardInit(void); #ifdef __cplusplus } #endif +#endif /* _FROM_ASM_ */ #endif /* _BOARD_H_ */ diff --git a/demos/ARMCM0-LPC1114-GCC/main.c b/demos/ARMCM0-LPC1114-GCC/main.c index 2b05b6f5d..14f913a0a 100644 --- a/demos/ARMCM0-LPC1114-GCC/main.c +++ b/demos/ARMCM0-LPC1114-GCC/main.c @@ -92,8 +92,7 @@ static msg_t Thread2(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) { uint8_t i; @@ -101,6 +100,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(); + /* * Activates the SD1 and SPI1 drivers. */ diff --git a/demos/ARMCM3-LPC1343-GCC/main.c b/demos/ARMCM3-LPC1343-GCC/main.c index 996db61b3..0600865f3 100644 --- a/demos/ARMCM3-LPC1343-GCC/main.c +++ b/demos/ARMCM3-LPC1343-GCC/main.c @@ -92,8 +92,7 @@ static msg_t Thread2(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) { uint8_t i; @@ -101,6 +100,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(); + /* * Activates the SD1 and SPI1 drivers. */ diff --git a/docs/reports/LPC1114-48.txt b/docs/reports/LPC1114-48.txt index 9c0ba0daa..1f2bccf50 100644 --- a/docs/reports/LPC1114-48.txt +++ b/docs/reports/LPC1114-48.txt @@ -5,7 +5,7 @@ Settings: CLK=48, (3 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.1.5unstable +*** Kernel: 2.1.6unstable *** GCC Version: 4.3.3 *** Architecture: ARMv6-M *** Core Variant: Cortex-M0 diff --git a/docs/reports/LPC1343-72.txt b/docs/reports/LPC1343-72.txt index 59239ad7f..d0833f6f3 100644 --- a/docs/reports/LPC1343-72.txt +++ b/docs/reports/LPC1343-72.txt @@ -5,7 +5,7 @@ Settings: CLK=72, (3 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 2.1.5unstable +*** Kernel: 2.1.6unstable *** GCC Version: 4.3.3 *** Architecture: ARMv7-M *** Core Variant: Cortex-M3 @@ -98,7 +98,7 @@ Settings: CLK=72, (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.1 (Benchmark, messages #1) ---- Score : 241880 msgs/S, 483760 ctxswc/S +--- Score : 241881 msgs/S, 483762 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Benchmark, messages #2) @@ -126,7 +126,7 @@ Settings: CLK=72, (3 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 473396 ctxswc/S +--- Score : 473392 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput)