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 f67a498a26..dda79c9d03 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 751305eb71..bffedddcd0 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 719cf80310..99ccaac2fd 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 42a3aab034..3f6de0286f 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 c5964a3fe0..97731ff3b1 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 1676e02b25..c120f925df 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 5054699c0d..68a938bbeb 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 58ece4a7c5..4ebecd04bc 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 c28354a99d..05326b2b75 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 7c40c1518d..d5b11f5a95 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 3613a683fc..a6a0d6bd4f 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 c1609bf526..1101c708bd 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 7c40c1518d..d5b11f5a95 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 77a3f20d0d..3170398e8e 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 51333e0a9c..b6053d64c2 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 e9c0608423..5870c0ba71 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 f28e552248..e1989a9d81 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 7c40c1518d..d5b11f5a95 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 e90a5ecb73..b8c4f1c01b 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 1676e02b25..c120f925df 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 db0fa55162..09f9b32753 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 c28354a99d..05326b2b75 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 e5b96d8280..ee8d945605 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 3613a683fc..3598755cba 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 c28354a99d..05326b2b75 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 4024c1ae3f..8d24c605fb 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 02ab04f8a0..8e5df423e4 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 c28354a99d..05326b2b75 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 78265f712e..126934d768 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 10cf07b635..7ce08649d3 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 c1609bf526..1101c708bd 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 b7bd6a1249..ac192c83b1 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 10766c2682..2d3f256119 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 8ecf112e9c..f80a225c3b 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 26a0e4ab1a..c7ffc240cb 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 da32925c91..3e8eb823e0 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 8ecf112e9c..f80a225c3b 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 5e963c636d..2745fa7b8b 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 24269ebc2c..ad9cedaff0 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 c1609bf526..1101c708bd 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 816b460a65..f0ea803bb0 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 c1609bf526..1101c708bd 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 7c40c1518d..d5b11f5a95 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 7e8c6cfd9e..29f0e8a829 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 c1609bf526..1101c708bd 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 cee539b083..da0c169793 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 8e1611eb7d..03a2235f10 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 c1609bf526..1101c708bd 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 20fa5347c0..6559f1b50c 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 bd9c494412..ec57a2f53b 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 51333e0a9c..b6053d64c2 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 ac6b12ff9e..669d889e58 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 e8f5a1a96c..98e3799e00 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 20047ade78..dd77b5c1d3 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 827c705f43..7d7440f05c 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 7cd0f1b795..af2746bfeb 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 20047ade78..dd77b5c1d3 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 2f385a7c68..4c6e5ddea5 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 dd86a886d2..fc3b8c86a9 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 c84dbe3bdd..73810718fb 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 b627e5440c..3a6d169faa 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 6ac957bc8d..3254264e9c 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 f28e552248..e1989a9d81 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 50f76b2e87..e1755ec81e 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 e2f50c33d8..5132b96549 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 f28e552248..e1989a9d81 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 208dd4525f..3c9af880b2 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 e90a5ecb73..b8c4f1c01b 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