From ace3f844709b1bfdd4c88acbc943bdecf29f9f21 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Dec 2010 10:39:21 +0000 Subject: AVR board files and demos updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2501 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/OLIMEX_AVR_CAN/board.c | 9 ++------- boards/OLIMEX_AVR_CAN/board.h | 4 +++- boards/OLIMEX_AVR_MT_128/board.c | 9 ++------- boards/OLIMEX_AVR_MT_128/board.h | 4 +++- demos/AVR-AT90CANx-GCC/main.c | 13 +++++++++---- demos/AVR-ATmega128-GCC/main.c | 13 +++++++++---- docs/reports/ATmega128-16.txt | 6 +++--- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/boards/OLIMEX_AVR_CAN/board.c b/boards/OLIMEX_AVR_CAN/board.c index cf2ced8a5..691dcbe13 100644 --- a/boards/OLIMEX_AVR_CAN/board.c +++ b/boards/OLIMEX_AVR_CAN/board.c @@ -32,9 +32,9 @@ CH_IRQ_HANDLER(TIMER0_COMP_vect) { } /* - * Board initialization code. + * Board-specific initialization code. */ -void hwinit(void) { +void boardInit(void) { /* * I/O ports setup. @@ -76,9 +76,4 @@ void hwinit(void) { TCNT0 = 0; /* Reset counter. */ TIFR0 = (1 << OCF0A); /* Reset pending. */ TIMSK0 = (1 << OCIE0A); /* IRQ on compare. */ - - /* - * HAL initialization. - */ - halInit(); } diff --git a/boards/OLIMEX_AVR_CAN/board.h b/boards/OLIMEX_AVR_CAN/board.h index 70df97e66..18a6d9904 100644 --- a/boards/OLIMEX_AVR_CAN/board.h +++ b/boards/OLIMEX_AVR_CAN/board.h @@ -89,12 +89,14 @@ #define PORTE_LED (1 << 4) #define PORTE_BUTTON (1 << 5) +#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/OLIMEX_AVR_MT_128/board.c b/boards/OLIMEX_AVR_MT_128/board.c index 9f126c85c..64229808d 100644 --- a/boards/OLIMEX_AVR_MT_128/board.c +++ b/boards/OLIMEX_AVR_MT_128/board.c @@ -32,9 +32,9 @@ CH_IRQ_HANDLER(TIMER0_COMP_vect) { } /* - * Board initialization code. + * Board-specific initialization code. */ -void hwinit(void) { +void boardInit(void) { /* * I/O ports setup. @@ -76,9 +76,4 @@ void hwinit(void) { TCNT0 = 0; /* Reset counter. */ TIFR = (1 << OCF0); /* Reset pending. */ TIMSK = (1 << OCIE0); /* IRQ on compare. */ - - /* - * HAL initialization. - */ - halInit(); } diff --git a/boards/OLIMEX_AVR_MT_128/board.h b/boards/OLIMEX_AVR_MT_128/board.h index 16ccdf2db..18dfd60b8 100644 --- a/boards/OLIMEX_AVR_MT_128/board.h +++ b/boards/OLIMEX_AVR_MT_128/board.h @@ -113,12 +113,14 @@ #define PORTE_BUZZ1 (1 << 4) #define PORTE_BUZZ2 (1 << 5) +#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/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c index f922efed0..79888a55a 100644 --- a/demos/AVR-AT90CANx-GCC/main.c +++ b/demos/AVR-AT90CANx-GCC/main.c @@ -38,6 +38,9 @@ static void TimerHandler(eventid_t id) { TestThread(&SD2); } +/* + * Application entry point. + */ int main(int argc, char **argv) { static EvTimer evt; static evhandler_t handlers[1] = { @@ -45,12 +48,14 @@ int main(int argc, char **argv) { }; static EventListener el0; - hwinit(); - /* - * The main() function becomes a thread here then the interrupts are - * enabled and ChibiOS/RT goes live. + * 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(); /* diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index b63d793b5..c02ef5404 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -41,6 +41,9 @@ static void TimerHandler(eventid_t id) { TestThread(&SD2); } +/* + * Application entry point. + */ int main(int argc, char **argv) { static EvTimer evt; static evhandler_t handlers[1] = { @@ -48,12 +51,14 @@ int main(int argc, char **argv) { }; static EventListener el0; - hwinit(); - /* - * The main() function becomes a thread here then the interrupts are - * enabled and ChibiOS/RT goes live. + * 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(); /* diff --git a/docs/reports/ATmega128-16.txt b/docs/reports/ATmega128-16.txt index a7bc3cf38..2317da5c7 100644 --- a/docs/reports/ATmega128-16.txt +++ b/docs/reports/ATmega128-16.txt @@ -5,7 +5,7 @@ Settings: F_CPU=16000000 *** ChibiOS/RT test suite *** -*** Kernel: 2.1.2unstable +*** Kernel: 2.1.6unstable *** GCC Version: 4.3.0 *** Architecture: AVR *** Core Variant: MegaAVR @@ -99,11 +99,11 @@ Settings: F_CPU=16000000 --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 21252 threads/S +--- Score : 21054 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 27451 threads/S +--- Score : 27121 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedule, 5 threads) -- cgit v1.2.3