From 675adde160fba196043bb471ae36a222238db49e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Dec 2010 12:50:56 +0000 Subject: STM8 board files and demos updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2509 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/OLIMEX_STM32_P103/board.c | 2 ++ boards/RAISONANCE_REVA_STM8S/board.c | 11 ++++------- boards/RAISONANCE_REVA_STM8S/board.h | 4 +++- boards/ST_STM8L_DISCOVERY/board.c | 11 ++++------- boards/ST_STM8L_DISCOVERY/board.h | 4 +++- boards/ST_STM8S_DISCOVERY/board.c | 11 ++++------- boards/ST_STM8S_DISCOVERY/board.h | 4 +++- 7 files changed, 23 insertions(+), 24 deletions(-) (limited to 'boards') diff --git a/boards/OLIMEX_STM32_P103/board.c b/boards/OLIMEX_STM32_P103/board.c index e380b8b9a..05faa0944 100644 --- a/boards/OLIMEX_STM32_P103/board.c +++ b/boards/OLIMEX_STM32_P103/board.c @@ -25,6 +25,7 @@ * @details Digital I/O ports static configuration as defined in @p board.h. * This variable is used by the HAL when initializing the PAL driver. */ +#if HAL_USE_PAL || defined(__DOXYGEN__) const PALConfig pal_default_config = { {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, @@ -33,6 +34,7 @@ const PALConfig pal_default_config = {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, }; +#endif /* * Early initialization code. diff --git a/boards/RAISONANCE_REVA_STM8S/board.c b/boards/RAISONANCE_REVA_STM8S/board.c index 61a6f2752..92fcc58a0 100644 --- a/boards/RAISONANCE_REVA_STM8S/board.c +++ b/boards/RAISONANCE_REVA_STM8S/board.c @@ -24,6 +24,7 @@ * @brief PAL setup. * @details Digital I/O ports static configuration as defined in @p board.h. */ +#if HAL_USE_PAL || defined(__DOXYGEN__) ROMCONST PALConfig pal_default_config = { { @@ -36,6 +37,7 @@ ROMCONST PALConfig pal_default_config = {VAL_GPIOGODR, 0, VAL_GPIOGDDR, VAL_GPIOGCR1, VAL_GPIOGCR2}, } }; +#endif /* * TIM 2 clock after the prescaler. @@ -60,14 +62,9 @@ CH_IRQ_HANDLER(13) { } /* - * Board initialization code. + * Board-specific initialization code. */ -void hwinit(void) { - - /* - * HAL initialization. - */ - halInit(); +void boardInit(void) { /* * TIM2 initialization as system tick. diff --git a/boards/RAISONANCE_REVA_STM8S/board.h b/boards/RAISONANCE_REVA_STM8S/board.h index 5434bd655..a3a508f5a 100644 --- a/boards/RAISONANCE_REVA_STM8S/board.h +++ b/boards/RAISONANCE_REVA_STM8S/board.h @@ -174,12 +174,14 @@ #define VAL_GPIOICR1 0xFF /* All pull-up. */ #define VAL_GPIOICR2 0 +#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/ST_STM8L_DISCOVERY/board.c b/boards/ST_STM8L_DISCOVERY/board.c index c7c44809e..b46bf007d 100644 --- a/boards/ST_STM8L_DISCOVERY/board.c +++ b/boards/ST_STM8L_DISCOVERY/board.c @@ -25,6 +25,7 @@ * @details Digital I/O ports static configuration as defined in @p board.h. * This variable is used by the HAL when initializing the PAL driver. */ +#if HAL_USE_PAL || defined(__DOXYGEN__) ROMCONST PALConfig pal_default_config = { { @@ -36,6 +37,7 @@ ROMCONST PALConfig pal_default_config = {VAL_GPIOFODR, 0, VAL_GPIOFDDR, VAL_GPIOFCR1, VAL_GPIOFCR2}, } }; +#endif /* * TIM 2 clock after the prescaler. @@ -44,14 +46,9 @@ ROMCONST PALConfig pal_default_config = #define TIM2_ARR ((TIM2_CLOCK / CH_FREQUENCY) - 1) /* - * Board initialization code. + * Board-specific initialization code. */ -void hwinit(void) { - - /* - * HAL initialization. - */ - halInit(); +void boardInit(void) { /* * TIM2 initialization as system tick. diff --git a/boards/ST_STM8L_DISCOVERY/board.h b/boards/ST_STM8L_DISCOVERY/board.h index 3355c28c9..4dfb28ca4 100644 --- a/boards/ST_STM8L_DISCOVERY/board.h +++ b/boards/ST_STM8L_DISCOVERY/board.h @@ -157,12 +157,14 @@ } \ } +#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/ST_STM8S_DISCOVERY/board.c b/boards/ST_STM8S_DISCOVERY/board.c index 61a6f2752..92fcc58a0 100644 --- a/boards/ST_STM8S_DISCOVERY/board.c +++ b/boards/ST_STM8S_DISCOVERY/board.c @@ -24,6 +24,7 @@ * @brief PAL setup. * @details Digital I/O ports static configuration as defined in @p board.h. */ +#if HAL_USE_PAL || defined(__DOXYGEN__) ROMCONST PALConfig pal_default_config = { { @@ -36,6 +37,7 @@ ROMCONST PALConfig pal_default_config = {VAL_GPIOGODR, 0, VAL_GPIOGDDR, VAL_GPIOGCR1, VAL_GPIOGCR2}, } }; +#endif /* * TIM 2 clock after the prescaler. @@ -60,14 +62,9 @@ CH_IRQ_HANDLER(13) { } /* - * Board initialization code. + * Board-specific initialization code. */ -void hwinit(void) { - - /* - * HAL initialization. - */ - halInit(); +void boardInit(void) { /* * TIM2 initialization as system tick. diff --git a/boards/ST_STM8S_DISCOVERY/board.h b/boards/ST_STM8S_DISCOVERY/board.h index 06035f820..38bebe6e8 100644 --- a/boards/ST_STM8S_DISCOVERY/board.h +++ b/boards/ST_STM8S_DISCOVERY/board.h @@ -111,12 +111,14 @@ #define VAL_GPIOGCR1 0xFF /* All pull-up or push-pull. */ #define VAL_GPIOGCR2 0 +#if !defined(_FROM_ASM_) #ifdef __cplusplus extern "C" { #endif - void hwinit(void); + void boardInit(void); #ifdef __cplusplus } #endif +#endif /* _FROM_ASM_ */ #endif /* _BOARD_H_ */ -- cgit v1.2.3