From 3b472cb3cd01bb99dfa454c91237967490ae5b80 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Tue, 22 Jan 2019 09:14:06 +0800 Subject: [PATCH] [bsp][stm32] optimize stm32 headfile --- bsp/stm32/libraries/HAL_Drivers/drv_common.c | 4 - bsp/stm32/libraries/HAL_Drivers/drv_common.h | 1 - bsp/stm32/libraries/HAL_Drivers/drv_dma.h | 4 +- bsp/stm32/libraries/HAL_Drivers/drv_lcd.c | 3 - bsp/stm32/libraries/HAL_Drivers/drv_sdram.c | 2 - .../libraries/templates/stm32f0xx/SConstruct | 2 +- .../templates/stm32f0xx/applications/main.c | 2 +- .../templates/stm32f0xx/board/board.h | 1 + .../libraries/templates/stm32f10x/SConstruct | 2 +- .../templates/stm32f10x/applications/main.c | 2 +- .../templates/stm32f10x/board/board.h | 1 + .../libraries/templates/stm32f4xx/SConstruct | 2 +- .../templates/stm32f4xx/applications/main.c | 2 +- .../templates/stm32f4xx/board/board.h | 1 + .../libraries/templates/stm32f7xx/SConstruct | 2 +- .../templates/stm32f7xx/board/board.h | 1 + .../libraries/templates/stm32l4xx/SConstruct | 2 +- .../templates/stm32l4xx/applications/main.c | 2 +- .../templates/stm32l4xx/board/board.h | 1 + bsp/stm32/stm32f091-st-nucleo/SConstruct | 2 +- bsp/stm32/stm32f091-st-nucleo/board/board.h | 1 + bsp/stm32/stm32f103-atk-nano/SConstruct | 2 +- .../stm32f103-atk-nano/applications/main.c | 2 +- bsp/stm32/stm32f103-atk-nano/board/board.h | 2 +- bsp/stm32/stm32f103-fire-arbitrary/SConstruct | 2 +- .../applications/main.c | 2 +- .../stm32f103-fire-arbitrary/board/board.h | 1 + bsp/stm32/stm32f103-hw100k-ibox/SConstruct | 2 +- .../stm32f103-hw100k-ibox/applications/main.c | 2 +- bsp/stm32/stm32f103-hw100k-ibox/board/board.h | 1 + bsp/stm32/stm32f407-atk-explorer/SConstruct | 2 +- .../applications/main.c | 2 +- .../stm32f407-atk-explorer/board/board.h | 1 + bsp/stm32/stm32f407-st-discovery/SConstruct | 2 +- .../applications/main.c | 1 - .../stm32f407-st-discovery/board/board.h | 1 + bsp/stm32/stm32f411-st-nucleo/SConstruct | 2 +- .../stm32f411-st-nucleo/applications/main.c | 2 +- bsp/stm32/stm32f411-st-nucleo/board/board.h | 1 + bsp/stm32/stm32f429-armfly-v6/SConstruct | 2 +- bsp/stm32/stm32f429-armfly-v6/board/board.h | 5 +- bsp/stm32/stm32f429-atk-apollo/SConstruct | 2 +- .../stm32f429-atk-apollo/applications/main.c | 2 +- bsp/stm32/stm32f429-atk-apollo/board/board.h | 1 + .../stm32f429-fire-challenger/SConstruct | 2 +- .../applications/main.c | 2 +- .../stm32f429-fire-challenger/board/board.h | 1 + bsp/stm32/stm32f446-st-nucleo/SConstruct | 2 +- .../stm32f446-st-nucleo/applications/main.c | 2 +- bsp/stm32/stm32f446-st-nucleo/board/board.h | 1 + bsp/stm32/stm32f746-st-disco/SConstruct | 2 +- .../stm32f746-st-disco/applications/main.c | 2 +- bsp/stm32/stm32f746-st-disco/board/board.h | 1 + bsp/stm32/stm32f767-atk-apollo/SConstruct | 2 +- .../stm32f767-atk-apollo/applications/main.c | 2 +- bsp/stm32/stm32f767-atk-apollo/board/board.h | 1 + .../stm32f767-fire-challenger/SConstruct | 2 +- .../applications/main.c | 2 +- .../stm32f767-fire-challenger/board/board.h | 1 + bsp/stm32/stm32f767-st-nucleo/SConstruct | 2 +- .../stm32f767-st-nucleo/applications/main.c | 69 ++++++++------- bsp/stm32/stm32f767-st-nucleo/board/board.h | 83 ++++++++++--------- bsp/stm32/stm32l432-st-nucleo/SConstruct | 2 +- .../stm32l432-st-nucleo/applications/main.c | 2 +- bsp/stm32/stm32l432-st-nucleo/board/board.h | 1 + bsp/stm32/stm32l475-atk-pandora/SConstruct | 2 +- .../stm32l475-atk-pandora/applications/main.c | 2 +- bsp/stm32/stm32l475-atk-pandora/board/board.h | 1 + 68 files changed, 137 insertions(+), 134 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_common.c b/bsp/stm32/libraries/HAL_Drivers/drv_common.c index f67a498a2..dda79c9d0 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_common.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_common.c @@ -10,10 +10,6 @@ #include "drv_common.h" -#ifdef RT_USING_PIN -#include "drv_gpio.h" -#endif - #ifdef RT_USING_SERIAL #include "drv_usart.h" #endif diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_common.h b/bsp/stm32/libraries/HAL_Drivers/drv_common.h index 751305eb7..bffedddcd 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_common.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_common.h @@ -14,7 +14,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_dma.h b/bsp/stm32/libraries/HAL_Drivers/drv_dma.h index 719cf8031..99ccaac2f 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_dma.h +++ b/bsp/stm32/libraries/HAL_Drivers/drv_dma.h @@ -12,9 +12,7 @@ #define __DRV_DMA_H_ #include -#include "rtdevice.h" -#include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_lcd.c b/bsp/stm32/libraries/HAL_Drivers/drv_lcd.c index 42a3aab03..3f6de0286 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_lcd.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_lcd.c @@ -8,14 +8,11 @@ * 2019-01-08 zylx first version */ -#include -#include #include #ifdef BSP_USING_LCD #include #include -#include "drv_gpio.h" //#define DRV_DEBUG #define LOG_TAG "drv.lcd" diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_sdram.c b/bsp/stm32/libraries/HAL_Drivers/drv_sdram.c index c5964a3fe..97731ff3b 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_sdram.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_sdram.c @@ -8,8 +8,6 @@ * 2018-12-04 zylx first version */ -#include -#include #include #ifdef BSP_USING_SDRAM diff --git a/bsp/stm32/libraries/templates/stm32f0xx/SConstruct b/bsp/stm32/libraries/templates/stm32f0xx/SConstruct index 1676e02b2..c120f925d 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f0xx/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/libraries/templates/stm32f0xx/applications/main.c b/bsp/stm32/libraries/templates/stm32f0xx/applications/main.c index 5054699c0..68a938bbe 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/applications/main.c +++ b/bsp/stm32/libraries/templates/stm32f0xx/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB1 */ #define LED0_PIN GET_PIN(B, 1) diff --git a/bsp/stm32/libraries/templates/stm32f0xx/board/board.h b/bsp/stm32/libraries/templates/stm32f0xx/board/board.h index 58ece4a7c..4ebecd04b 100644 --- a/bsp/stm32/libraries/templates/stm32f0xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f0xx/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/libraries/templates/stm32f10x/SConstruct b/bsp/stm32/libraries/templates/stm32f10x/SConstruct index c28354a99..05326b2b7 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f10x/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/libraries/templates/stm32f10x/applications/main.c b/bsp/stm32/libraries/templates/stm32f10x/applications/main.c index 7c40c1518..d5b11f5a9 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/applications/main.c +++ b/bsp/stm32/libraries/templates/stm32f10x/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB1 */ #define LED0_PIN GET_PIN(B, 1) diff --git a/bsp/stm32/libraries/templates/stm32f10x/board/board.h b/bsp/stm32/libraries/templates/stm32f10x/board/board.h index 3613a683f..a6a0d6bd4 100644 --- a/bsp/stm32/libraries/templates/stm32f10x/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f10x/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct index c1609bf52..1101c708b 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f4xx/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/libraries/templates/stm32f4xx/applications/main.c b/bsp/stm32/libraries/templates/stm32f4xx/applications/main.c index 7c40c1518..d5b11f5a9 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/applications/main.c +++ b/bsp/stm32/libraries/templates/stm32f4xx/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB1 */ #define LED0_PIN GET_PIN(B, 1) diff --git a/bsp/stm32/libraries/templates/stm32f4xx/board/board.h b/bsp/stm32/libraries/templates/stm32f4xx/board/board.h index 77a3f20d0..3170398e8 100644 --- a/bsp/stm32/libraries/templates/stm32f4xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f4xx/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/libraries/templates/stm32f7xx/SConstruct b/bsp/stm32/libraries/templates/stm32f7xx/SConstruct index 51333e0a9..b6053d64c 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32f7xx/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/libraries/templates/stm32f7xx/board/board.h b/bsp/stm32/libraries/templates/stm32f7xx/board/board.h index e9c060842..5870c0ba7 100644 --- a/bsp/stm32/libraries/templates/stm32f7xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32f7xx/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct index f28e55224..e1989a9d8 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/SConstruct +++ b/bsp/stm32/libraries/templates/stm32l4xx/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/libraries/templates/stm32l4xx/applications/main.c b/bsp/stm32/libraries/templates/stm32l4xx/applications/main.c index 7c40c1518..d5b11f5a9 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/applications/main.c +++ b/bsp/stm32/libraries/templates/stm32l4xx/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB1 */ #define LED0_PIN GET_PIN(B, 1) diff --git a/bsp/stm32/libraries/templates/stm32l4xx/board/board.h b/bsp/stm32/libraries/templates/stm32l4xx/board/board.h index e90a5ecb7..b8c4f1c01 100644 --- a/bsp/stm32/libraries/templates/stm32l4xx/board/board.h +++ b/bsp/stm32/libraries/templates/stm32l4xx/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f091-st-nucleo/SConstruct b/bsp/stm32/stm32f091-st-nucleo/SConstruct index 1676e02b2..c120f925d 100644 --- a/bsp/stm32/stm32f091-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f091-st-nucleo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f091-st-nucleo/board/board.h b/bsp/stm32/stm32f091-st-nucleo/board/board.h index db0fa5516..09f9b3275 100644 --- a/bsp/stm32/stm32f091-st-nucleo/board/board.h +++ b/bsp/stm32/stm32f091-st-nucleo/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f103-atk-nano/SConstruct b/bsp/stm32/stm32f103-atk-nano/SConstruct index c28354a99..05326b2b7 100644 --- a/bsp/stm32/stm32f103-atk-nano/SConstruct +++ b/bsp/stm32/stm32f103-atk-nano/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f103-atk-nano/applications/main.c b/bsp/stm32/stm32f103-atk-nano/applications/main.c index e5b96d828..ee8d94560 100644 --- a/bsp/stm32/stm32f103-atk-nano/applications/main.c +++ b/bsp/stm32/stm32f103-atk-nano/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PC0 */ #define LED0_PIN GET_PIN(C, 0) diff --git a/bsp/stm32/stm32f103-atk-nano/board/board.h b/bsp/stm32/stm32f103-atk-nano/board/board.h index 3613a683f..3598755cb 100644 --- a/bsp/stm32/stm32f103-atk-nano/board/board.h +++ b/bsp/stm32/stm32f103-atk-nano/board/board.h @@ -11,9 +11,9 @@ #ifndef __BOARD_H__ #define __BOARD_H__ -#include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct index c28354a99..05326b2b7 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/SConstruct +++ b/bsp/stm32/stm32f103-fire-arbitrary/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f103-fire-arbitrary/applications/main.c b/bsp/stm32/stm32f103-fire-arbitrary/applications/main.c index 4024c1ae3..8d24c605f 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/applications/main.c +++ b/bsp/stm32/stm32f103-fire-arbitrary/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PF7 */ #define LED0_PIN GET_PIN(F, 7) diff --git a/bsp/stm32/stm32f103-fire-arbitrary/board/board.h b/bsp/stm32/stm32f103-fire-arbitrary/board/board.h index 02ab04f8a..8e5df423e 100644 --- a/bsp/stm32/stm32f103-fire-arbitrary/board/board.h +++ b/bsp/stm32/stm32f103-fire-arbitrary/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f103-hw100k-ibox/SConstruct b/bsp/stm32/stm32f103-hw100k-ibox/SConstruct index c28354a99..05326b2b7 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/SConstruct +++ b/bsp/stm32/stm32f103-hw100k-ibox/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f103-hw100k-ibox/applications/main.c b/bsp/stm32/stm32f103-hw100k-ibox/applications/main.c index 78265f712..126934d76 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/applications/main.c +++ b/bsp/stm32/stm32f103-hw100k-ibox/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PE9 */ #define LED0_PIN GET_PIN(E, 9) diff --git a/bsp/stm32/stm32f103-hw100k-ibox/board/board.h b/bsp/stm32/stm32f103-hw100k-ibox/board/board.h index 10cf07b63..7ce08649d 100644 --- a/bsp/stm32/stm32f103-hw100k-ibox/board/board.h +++ b/bsp/stm32/stm32f103-hw100k-ibox/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f407-atk-explorer/SConstruct b/bsp/stm32/stm32f407-atk-explorer/SConstruct index c1609bf52..1101c708b 100644 --- a/bsp/stm32/stm32f407-atk-explorer/SConstruct +++ b/bsp/stm32/stm32f407-atk-explorer/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f407-atk-explorer/applications/main.c b/bsp/stm32/stm32f407-atk-explorer/applications/main.c index b7bd6a124..ac192c83b 100644 --- a/bsp/stm32/stm32f407-atk-explorer/applications/main.c +++ b/bsp/stm32/stm32f407-atk-explorer/applications/main.c @@ -12,7 +12,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PF9 */ #define LED0_PIN GET_PIN(F, 9) diff --git a/bsp/stm32/stm32f407-atk-explorer/board/board.h b/bsp/stm32/stm32f407-atk-explorer/board/board.h index 10766c268..2d3f25611 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/board.h +++ b/bsp/stm32/stm32f407-atk-explorer/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f407-st-discovery/SConstruct b/bsp/stm32/stm32f407-st-discovery/SConstruct index 8ecf112e9..f80a225c3 100644 --- a/bsp/stm32/stm32f407-st-discovery/SConstruct +++ b/bsp/stm32/stm32f407-st-discovery/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rtthread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f407-st-discovery/applications/main.c b/bsp/stm32/stm32f407-st-discovery/applications/main.c index 26a0e4ab1..c7ffc240c 100644 --- a/bsp/stm32/stm32f407-st-discovery/applications/main.c +++ b/bsp/stm32/stm32f407-st-discovery/applications/main.c @@ -11,7 +11,6 @@ #include #include #include -#include "drv_gpio.h" /* defined the LED0 pin: PD14 */ #define LED0_PIN GET_PIN(D, 14) diff --git a/bsp/stm32/stm32f407-st-discovery/board/board.h b/bsp/stm32/stm32f407-st-discovery/board/board.h index da32925c9..3e8eb823e 100644 --- a/bsp/stm32/stm32f407-st-discovery/board/board.h +++ b/bsp/stm32/stm32f407-st-discovery/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f411-st-nucleo/SConstruct b/bsp/stm32/stm32f411-st-nucleo/SConstruct index 8ecf112e9..f80a225c3 100644 --- a/bsp/stm32/stm32f411-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f411-st-nucleo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rtthread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f411-st-nucleo/applications/main.c b/bsp/stm32/stm32f411-st-nucleo/applications/main.c index 5e963c636..2745fa7b8 100644 --- a/bsp/stm32/stm32f411-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f411-st-nucleo/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PA5 */ #define LED0_PIN GET_PIN(A, 5) diff --git a/bsp/stm32/stm32f411-st-nucleo/board/board.h b/bsp/stm32/stm32f411-st-nucleo/board/board.h index 24269ebc2..ad9cedaff 100644 --- a/bsp/stm32/stm32f411-st-nucleo/board/board.h +++ b/bsp/stm32/stm32f411-st-nucleo/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f429-armfly-v6/SConstruct b/bsp/stm32/stm32f429-armfly-v6/SConstruct index c1609bf52..1101c708b 100644 --- a/bsp/stm32/stm32f429-armfly-v6/SConstruct +++ b/bsp/stm32/stm32f429-armfly-v6/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f429-armfly-v6/board/board.h b/bsp/stm32/stm32f429-armfly-v6/board/board.h index 816b460a6..f0ea803bb 100644 --- a/bsp/stm32/stm32f429-armfly-v6/board/board.h +++ b/bsp/stm32/stm32f429-armfly-v6/board/board.h @@ -14,15 +14,12 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { #endif -#ifdef BSP_USING_GPIO -#include "drv_gpio.h" -#endif - #define STM32_SRAM_SIZE (192) #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) diff --git a/bsp/stm32/stm32f429-atk-apollo/SConstruct b/bsp/stm32/stm32f429-atk-apollo/SConstruct index c1609bf52..1101c708b 100644 --- a/bsp/stm32/stm32f429-atk-apollo/SConstruct +++ b/bsp/stm32/stm32f429-atk-apollo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f429-atk-apollo/applications/main.c b/bsp/stm32/stm32f429-atk-apollo/applications/main.c index 7c40c1518..d5b11f5a9 100644 --- a/bsp/stm32/stm32f429-atk-apollo/applications/main.c +++ b/bsp/stm32/stm32f429-atk-apollo/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB1 */ #define LED0_PIN GET_PIN(B, 1) diff --git a/bsp/stm32/stm32f429-atk-apollo/board/board.h b/bsp/stm32/stm32f429-atk-apollo/board/board.h index 7e8c6cfd9..29f0e8a82 100644 --- a/bsp/stm32/stm32f429-atk-apollo/board/board.h +++ b/bsp/stm32/stm32f429-atk-apollo/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f429-fire-challenger/SConstruct b/bsp/stm32/stm32f429-fire-challenger/SConstruct index c1609bf52..1101c708b 100644 --- a/bsp/stm32/stm32f429-fire-challenger/SConstruct +++ b/bsp/stm32/stm32f429-fire-challenger/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f429-fire-challenger/applications/main.c b/bsp/stm32/stm32f429-fire-challenger/applications/main.c index cee539b08..da0c16979 100644 --- a/bsp/stm32/stm32f429-fire-challenger/applications/main.c +++ b/bsp/stm32/stm32f429-fire-challenger/applications/main.c @@ -12,7 +12,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PH10 */ #define LED0_PIN GET_PIN(H, 10) diff --git a/bsp/stm32/stm32f429-fire-challenger/board/board.h b/bsp/stm32/stm32f429-fire-challenger/board/board.h index 8e1611eb7..03a2235f1 100644 --- a/bsp/stm32/stm32f429-fire-challenger/board/board.h +++ b/bsp/stm32/stm32f429-fire-challenger/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f446-st-nucleo/SConstruct b/bsp/stm32/stm32f446-st-nucleo/SConstruct index c1609bf52..1101c708b 100644 --- a/bsp/stm32/stm32f446-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f446-st-nucleo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f446-st-nucleo/applications/main.c b/bsp/stm32/stm32f446-st-nucleo/applications/main.c index 20fa5347c..6559f1b50 100644 --- a/bsp/stm32/stm32f446-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f446-st-nucleo/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED2 pin: PB7 */ #define LED2_PIN GET_PIN(B, 7) diff --git a/bsp/stm32/stm32f446-st-nucleo/board/board.h b/bsp/stm32/stm32f446-st-nucleo/board/board.h index bd9c49441..ec57a2f53 100644 --- a/bsp/stm32/stm32f446-st-nucleo/board/board.h +++ b/bsp/stm32/stm32f446-st-nucleo/board/board.h @@ -15,6 +15,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) #define STM32_FLASH_SIZE (512 * 1024) diff --git a/bsp/stm32/stm32f746-st-disco/SConstruct b/bsp/stm32/stm32f746-st-disco/SConstruct index 51333e0a9..b6053d64c 100644 --- a/bsp/stm32/stm32f746-st-disco/SConstruct +++ b/bsp/stm32/stm32f746-st-disco/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f746-st-disco/applications/main.c b/bsp/stm32/stm32f746-st-disco/applications/main.c index ac6b12ff9..669d889e5 100644 --- a/bsp/stm32/stm32f746-st-disco/applications/main.c +++ b/bsp/stm32/stm32f746-st-disco/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED1 pin: PI1 */ #define LED1_PIN GET_PIN(I, 1) diff --git a/bsp/stm32/stm32f746-st-disco/board/board.h b/bsp/stm32/stm32f746-st-disco/board/board.h index e8f5a1a96..98e3799e0 100644 --- a/bsp/stm32/stm32f746-st-disco/board/board.h +++ b/bsp/stm32/stm32f746-st-disco/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) #define STM32_FLASH_SIZE (1024 * 1024) diff --git a/bsp/stm32/stm32f767-atk-apollo/SConstruct b/bsp/stm32/stm32f767-atk-apollo/SConstruct index 20047ade7..dd77b5c1d 100644 --- a/bsp/stm32/stm32f767-atk-apollo/SConstruct +++ b/bsp/stm32/stm32f767-atk-apollo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f767-atk-apollo/applications/main.c b/bsp/stm32/stm32f767-atk-apollo/applications/main.c index 827c705f4..7d7440f05 100644 --- a/bsp/stm32/stm32f767-atk-apollo/applications/main.c +++ b/bsp/stm32/stm32f767-atk-apollo/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB1 */ #define LED0_PIN GET_PIN(B, 1) diff --git a/bsp/stm32/stm32f767-atk-apollo/board/board.h b/bsp/stm32/stm32f767-atk-apollo/board/board.h index 7cd0f1b79..af2746bfe 100644 --- a/bsp/stm32/stm32f767-atk-apollo/board/board.h +++ b/bsp/stm32/stm32f767-atk-apollo/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f767-fire-challenger/SConstruct b/bsp/stm32/stm32f767-fire-challenger/SConstruct index 20047ade7..dd77b5c1d 100644 --- a/bsp/stm32/stm32f767-fire-challenger/SConstruct +++ b/bsp/stm32/stm32f767-fire-challenger/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f767-fire-challenger/applications/main.c b/bsp/stm32/stm32f767-fire-challenger/applications/main.c index 2f385a7c6..4c6e5ddea 100644 --- a/bsp/stm32/stm32f767-fire-challenger/applications/main.c +++ b/bsp/stm32/stm32f767-fire-challenger/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PH10 */ #define LED0_PIN GET_PIN(H, 10) diff --git a/bsp/stm32/stm32f767-fire-challenger/board/board.h b/bsp/stm32/stm32f767-fire-challenger/board/board.h index dd86a886d..fc3b8c86a 100644 --- a/bsp/stm32/stm32f767-fire-challenger/board/board.h +++ b/bsp/stm32/stm32f767-fire-challenger/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32f767-st-nucleo/SConstruct b/bsp/stm32/stm32f767-st-nucleo/SConstruct index c84dbe3bd..73810718f 100644 --- a/bsp/stm32/stm32f767-st-nucleo/SConstruct +++ b/bsp/stm32/stm32f767-st-nucleo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32f767-st-nucleo/applications/main.c b/bsp/stm32/stm32f767-st-nucleo/applications/main.c index b627e5440..3a6d169fa 100644 --- a/bsp/stm32/stm32f767-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f767-st-nucleo/applications/main.c @@ -1,35 +1,34 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2018-11-06 SummerGift change to new framework - * 2019-1-10 e31207077 change to new framework - */ - -#include -#include -#include -#include "drv_gpio.h" - -/* defined the LED1 pin: PB0 */ -#define LED1_PIN GET_PIN(B, 0) - -int main(void) -{ - int count = 1; - /* set LED1 pin mode to output */ - rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT); - - while (count++) - { - rt_pin_write(LED1_PIN, PIN_HIGH); - rt_thread_mdelay(500); - rt_pin_write(LED1_PIN, PIN_LOW); - rt_thread_mdelay(500); - } - - return RT_EOK; -} +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2018-11-06 SummerGift change to new framework + * 2019-1-10 e31207077 change to new framework + */ + +#include +#include +#include + +/* defined the LED1 pin: PB0 */ +#define LED1_PIN GET_PIN(B, 0) + +int main(void) +{ + int count = 1; + /* set LED1 pin mode to output */ + rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT); + + while (count++) + { + rt_pin_write(LED1_PIN, PIN_HIGH); + rt_thread_mdelay(500); + rt_pin_write(LED1_PIN, PIN_LOW); + rt_thread_mdelay(500); + } + + return RT_EOK; +} diff --git a/bsp/stm32/stm32f767-st-nucleo/board/board.h b/bsp/stm32/stm32f767-st-nucleo/board/board.h index 6ac957bc8..3254264e9 100644 --- a/bsp/stm32/stm32f767-st-nucleo/board/board.h +++ b/bsp/stm32/stm32f767-st-nucleo/board/board.h @@ -1,41 +1,42 @@ -/* - * Copyright (c) 2006-2018, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2018-11-5 SummerGift change to new framework - * 2019-1-10 e31207077 change to new framework - */ - -#ifndef __BOARD_H__ -#define __BOARD_H__ - -#include -#include -#include "drv_common.h" - -#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) -#define STM32_FLASH_SIZE (2048 * 1024) -#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) - -#define STM32_SRAM_SIZE (512) -#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) - -#if defined(__CC_ARM) || defined(__CLANG_ARM) -extern int Image$$RW_IRAM1$$ZI$$Limit; -#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) -#elif __ICCARM__ -#pragma section="CSTACK" -#define HEAP_BEGIN (__segment_end("CSTACK")) -#else -extern int __bss_end; -#define HEAP_BEGIN (&__bss_end) -#endif - -#define HEAP_END STM32_SRAM_END - -void SystemClock_Config(void); - -#endif +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2018-11-5 SummerGift change to new framework + * 2019-1-10 e31207077 change to new framework + */ + +#ifndef __BOARD_H__ +#define __BOARD_H__ + +#include +#include +#include "drv_common.h" +#include "drv_gpio.h" + +#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) +#define STM32_FLASH_SIZE (2048 * 1024) +#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) + +#define STM32_SRAM_SIZE (512) +#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) + +#if defined(__CC_ARM) || defined(__CLANG_ARM) +extern int Image$$RW_IRAM1$$ZI$$Limit; +#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) +#elif __ICCARM__ +#pragma section="CSTACK" +#define HEAP_BEGIN (__segment_end("CSTACK")) +#else +extern int __bss_end; +#define HEAP_BEGIN (&__bss_end) +#endif + +#define HEAP_END STM32_SRAM_END + +void SystemClock_Config(void); + +#endif diff --git a/bsp/stm32/stm32l432-st-nucleo/SConstruct b/bsp/stm32/stm32l432-st-nucleo/SConstruct index f28e55224..e1989a9d8 100644 --- a/bsp/stm32/stm32l432-st-nucleo/SConstruct +++ b/bsp/stm32/stm32l432-st-nucleo/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32l432-st-nucleo/applications/main.c b/bsp/stm32/stm32l432-st-nucleo/applications/main.c index 50f76b2e8..e1755ec81 100644 --- a/bsp/stm32/stm32l432-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32l432-st-nucleo/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PB3 */ #define LED0_PIN GET_PIN(B, 3) diff --git a/bsp/stm32/stm32l432-st-nucleo/board/board.h b/bsp/stm32/stm32l432-st-nucleo/board/board.h index e2f50c33d..5132b9654 100644 --- a/bsp/stm32/stm32l432-st-nucleo/board/board.h +++ b/bsp/stm32/stm32l432-st-nucleo/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { diff --git a/bsp/stm32/stm32l475-atk-pandora/SConstruct b/bsp/stm32/stm32l475-atk-pandora/SConstruct index f28e55224..e1989a9d8 100644 --- a/bsp/stm32/stm32l475-atk-pandora/SConstruct +++ b/bsp/stm32/stm32l475-atk-pandora/SConstruct @@ -27,7 +27,7 @@ env.PrependENVPath('PATH', rtconfig.EXEC_PATH) if rtconfig.PLATFORM == 'iar': env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = ['']) - env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map rt-thread.map']) + env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map') Export('RTT_ROOT') Export('rtconfig') diff --git a/bsp/stm32/stm32l475-atk-pandora/applications/main.c b/bsp/stm32/stm32l475-atk-pandora/applications/main.c index 208dd4525..3c9af880b 100644 --- a/bsp/stm32/stm32l475-atk-pandora/applications/main.c +++ b/bsp/stm32/stm32l475-atk-pandora/applications/main.c @@ -11,7 +11,7 @@ #include #include #include -#include "drv_gpio.h" + /* defined the LED0 pin: PE7 */ #define LED0_PIN GET_PIN(E, 7) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/board.h b/bsp/stm32/stm32l475-atk-pandora/board/board.h index e90a5ecb7..b8c4f1c01 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/board.h +++ b/bsp/stm32/stm32l475-atk-pandora/board/board.h @@ -14,6 +14,7 @@ #include #include #include "drv_common.h" +#include "drv_gpio.h" #ifdef __cplusplus extern "C" { -- GitLab