浏览代码

[bsp][stm32] optimize stm32 headfile

SummerGift 6 年之前
父节点
当前提交
3b472cb3cd
共有 68 个文件被更改,包括 137 次插入134 次删除
  1. 0 4
      bsp/stm32/libraries/HAL_Drivers/drv_common.c
  2. 0 1
      bsp/stm32/libraries/HAL_Drivers/drv_common.h
  3. 1 3
      bsp/stm32/libraries/HAL_Drivers/drv_dma.h
  4. 0 3
      bsp/stm32/libraries/HAL_Drivers/drv_lcd.c
  5. 0 2
      bsp/stm32/libraries/HAL_Drivers/drv_sdram.c
  6. 1 1
      bsp/stm32/libraries/templates/stm32f0xx/SConstruct
  7. 1 1
      bsp/stm32/libraries/templates/stm32f0xx/applications/main.c
  8. 1 0
      bsp/stm32/libraries/templates/stm32f0xx/board/board.h
  9. 1 1
      bsp/stm32/libraries/templates/stm32f10x/SConstruct
  10. 1 1
      bsp/stm32/libraries/templates/stm32f10x/applications/main.c
  11. 1 0
      bsp/stm32/libraries/templates/stm32f10x/board/board.h
  12. 1 1
      bsp/stm32/libraries/templates/stm32f4xx/SConstruct
  13. 1 1
      bsp/stm32/libraries/templates/stm32f4xx/applications/main.c
  14. 1 0
      bsp/stm32/libraries/templates/stm32f4xx/board/board.h
  15. 1 1
      bsp/stm32/libraries/templates/stm32f7xx/SConstruct
  16. 1 0
      bsp/stm32/libraries/templates/stm32f7xx/board/board.h
  17. 1 1
      bsp/stm32/libraries/templates/stm32l4xx/SConstruct
  18. 1 1
      bsp/stm32/libraries/templates/stm32l4xx/applications/main.c
  19. 1 0
      bsp/stm32/libraries/templates/stm32l4xx/board/board.h
  20. 1 1
      bsp/stm32/stm32f091-st-nucleo/SConstruct
  21. 1 0
      bsp/stm32/stm32f091-st-nucleo/board/board.h
  22. 1 1
      bsp/stm32/stm32f103-atk-nano/SConstruct
  23. 1 1
      bsp/stm32/stm32f103-atk-nano/applications/main.c
  24. 1 1
      bsp/stm32/stm32f103-atk-nano/board/board.h
  25. 1 1
      bsp/stm32/stm32f103-fire-arbitrary/SConstruct
  26. 1 1
      bsp/stm32/stm32f103-fire-arbitrary/applications/main.c
  27. 1 0
      bsp/stm32/stm32f103-fire-arbitrary/board/board.h
  28. 1 1
      bsp/stm32/stm32f103-hw100k-ibox/SConstruct
  29. 1 1
      bsp/stm32/stm32f103-hw100k-ibox/applications/main.c
  30. 1 0
      bsp/stm32/stm32f103-hw100k-ibox/board/board.h
  31. 1 1
      bsp/stm32/stm32f407-atk-explorer/SConstruct
  32. 1 1
      bsp/stm32/stm32f407-atk-explorer/applications/main.c
  33. 1 0
      bsp/stm32/stm32f407-atk-explorer/board/board.h
  34. 1 1
      bsp/stm32/stm32f407-st-discovery/SConstruct
  35. 0 1
      bsp/stm32/stm32f407-st-discovery/applications/main.c
  36. 1 0
      bsp/stm32/stm32f407-st-discovery/board/board.h
  37. 1 1
      bsp/stm32/stm32f411-st-nucleo/SConstruct
  38. 1 1
      bsp/stm32/stm32f411-st-nucleo/applications/main.c
  39. 1 0
      bsp/stm32/stm32f411-st-nucleo/board/board.h
  40. 1 1
      bsp/stm32/stm32f429-armfly-v6/SConstruct
  41. 1 4
      bsp/stm32/stm32f429-armfly-v6/board/board.h
  42. 1 1
      bsp/stm32/stm32f429-atk-apollo/SConstruct
  43. 1 1
      bsp/stm32/stm32f429-atk-apollo/applications/main.c
  44. 1 0
      bsp/stm32/stm32f429-atk-apollo/board/board.h
  45. 1 1
      bsp/stm32/stm32f429-fire-challenger/SConstruct
  46. 1 1
      bsp/stm32/stm32f429-fire-challenger/applications/main.c
  47. 1 0
      bsp/stm32/stm32f429-fire-challenger/board/board.h
  48. 1 1
      bsp/stm32/stm32f446-st-nucleo/SConstruct
  49. 1 1
      bsp/stm32/stm32f446-st-nucleo/applications/main.c
  50. 1 0
      bsp/stm32/stm32f446-st-nucleo/board/board.h
  51. 1 1
      bsp/stm32/stm32f746-st-disco/SConstruct
  52. 1 1
      bsp/stm32/stm32f746-st-disco/applications/main.c
  53. 1 0
      bsp/stm32/stm32f746-st-disco/board/board.h
  54. 1 1
      bsp/stm32/stm32f767-atk-apollo/SConstruct
  55. 1 1
      bsp/stm32/stm32f767-atk-apollo/applications/main.c
  56. 1 0
      bsp/stm32/stm32f767-atk-apollo/board/board.h
  57. 1 1
      bsp/stm32/stm32f767-fire-challenger/SConstruct
  58. 1 1
      bsp/stm32/stm32f767-fire-challenger/applications/main.c
  59. 1 0
      bsp/stm32/stm32f767-fire-challenger/board/board.h
  60. 1 1
      bsp/stm32/stm32f767-st-nucleo/SConstruct
  61. 34 35
      bsp/stm32/stm32f767-st-nucleo/applications/main.c
  62. 42 41
      bsp/stm32/stm32f767-st-nucleo/board/board.h
  63. 1 1
      bsp/stm32/stm32l432-st-nucleo/SConstruct
  64. 1 1
      bsp/stm32/stm32l432-st-nucleo/applications/main.c
  65. 1 0
      bsp/stm32/stm32l432-st-nucleo/board/board.h
  66. 1 1
      bsp/stm32/stm32l475-atk-pandora/SConstruct
  67. 1 1
      bsp/stm32/stm32l475-atk-pandora/applications/main.c
  68. 1 0
      bsp/stm32/stm32l475-atk-pandora/board/board.h

+ 0 - 4
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

+ 0 - 1
bsp/stm32/libraries/HAL_Drivers/drv_common.h

@@ -14,7 +14,6 @@
 #include <rtthread.h>
 #include <rthw.h>
 #include <rtdevice.h>
-#include <board.h>
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 3
bsp/stm32/libraries/HAL_Drivers/drv_dma.h

@@ -12,9 +12,7 @@
 #define __DRV_DMA_H_
 
 #include <rtthread.h>
-#include "rtdevice.h"
-#include <rthw.h>
-#include <drv_common.h>
+#include <board.h>
 
 #ifdef __cplusplus
 extern "C" {

+ 0 - 3
bsp/stm32/libraries/HAL_Drivers/drv_lcd.c

@@ -8,14 +8,11 @@
  * 2019-01-08     zylx         first version
  */
 
-#include <rtthread.h>
-#include <rtdevice.h>
 #include <board.h>
 
 #ifdef BSP_USING_LCD
 #include <lcd_port.h>
 #include <string.h>
-#include "drv_gpio.h"
 
 //#define DRV_DEBUG
 #define LOG_TAG             "drv.lcd"

+ 0 - 2
bsp/stm32/libraries/HAL_Drivers/drv_sdram.c

@@ -8,8 +8,6 @@
  * 2018-12-04     zylx         first version
  */
 
-#include <rtthread.h>
-#include <rtdevice.h>
 #include <board.h>
 
 #ifdef BSP_USING_SDRAM

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/libraries/templates/stm32f0xx/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB1 */
 #define LED0_PIN    GET_PIN(B, 1)
 

+ 1 - 0
bsp/stm32/libraries/templates/stm32f0xx/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f0xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/libraries/templates/stm32f10x/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB1 */
 #define LED0_PIN    GET_PIN(B, 1)
 

+ 1 - 0
bsp/stm32/libraries/templates/stm32f10x/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f1xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/libraries/templates/stm32f4xx/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB1 */
 #define LED0_PIN    GET_PIN(B, 1)
 

+ 1 - 0
bsp/stm32/libraries/templates/stm32f4xx/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 0
bsp/stm32/libraries/templates/stm32f7xx/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f7xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/libraries/templates/stm32l4xx/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB1 */
 #define LED0_PIN    GET_PIN(B, 1)
 

+ 1 - 0
bsp/stm32/libraries/templates/stm32l4xx/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32l4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 0
bsp/stm32/stm32f091-st-nucleo/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f0xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f103-atk-nano/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PC0 */
 #define LED0_PIN    GET_PIN(C, 0)
 

+ 1 - 1
bsp/stm32/stm32f103-atk-nano/board/board.h

@@ -11,9 +11,9 @@
 #ifndef __BOARD_H__
 #define __BOARD_H__
 
-#include <rtthread.h>
 #include <stm32f1xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f103-fire-arbitrary/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PF7 */
 #define LED0_PIN    GET_PIN(F, 7)
 

+ 1 - 0
bsp/stm32/stm32f103-fire-arbitrary/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f1xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f103-hw100k-ibox/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PE9 */
 #define LED0_PIN    GET_PIN(E, 9)
 

+ 1 - 0
bsp/stm32/stm32f103-hw100k-ibox/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f1xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f407-atk-explorer/applications/main.c

@@ -12,7 +12,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PF9 */
 #define LED0_PIN    GET_PIN(F, 9)
 

+ 1 - 0
bsp/stm32/stm32f407-atk-explorer/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 0 - 1
bsp/stm32/stm32f407-st-discovery/applications/main.c

@@ -11,7 +11,6 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
 
 /* defined the LED0 pin: PD14 */
 #define LED0_PIN    GET_PIN(D, 14)

+ 1 - 0
bsp/stm32/stm32f407-st-discovery/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f411-st-nucleo/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PA5 */
 #define LED0_PIN               GET_PIN(A, 5)
 

+ 1 - 0
bsp/stm32/stm32f411-st-nucleo/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 4
bsp/stm32/stm32f429-armfly-v6/board/board.h

@@ -14,15 +14,12 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #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)
 

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f429-atk-apollo/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB1 */
 #define LED0_PIN    GET_PIN(B, 1)
 

+ 1 - 0
bsp/stm32/stm32f429-atk-apollo/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f429-fire-challenger/applications/main.c

@@ -12,7 +12,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PH10 */
 #define LED0_PIN    GET_PIN(H, 10)
 

+ 1 - 0
bsp/stm32/stm32f429-fire-challenger/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f446-st-nucleo/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED2 pin: PB7 */
 #define LED2_PIN    GET_PIN(B, 7)
 

+ 1 - 0
bsp/stm32/stm32f446-st-nucleo/board/board.h

@@ -15,6 +15,7 @@
 #include <rtthread.h>
 #include <stm32f4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #define STM32_FLASH_START_ADRESS     ((uint32_t)0x08000000)
 #define STM32_FLASH_SIZE             (512 * 1024)

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f746-st-disco/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED1 pin: PI1 */
 #define LED1_PIN    GET_PIN(I, 1)
 

+ 1 - 0
bsp/stm32/stm32f746-st-disco/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f7xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #define STM32_FLASH_START_ADRESS     ((uint32_t)0x08000000)
 #define STM32_FLASH_SIZE             (1024 * 1024)

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f767-atk-apollo/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB1 */
 #define LED0_PIN    GET_PIN(B, 1)
 

+ 1 - 0
bsp/stm32/stm32f767-atk-apollo/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f7xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32f767-fire-challenger/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PH10 */
 #define LED0_PIN    GET_PIN(H, 10)
 

+ 1 - 0
bsp/stm32/stm32f767-fire-challenger/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32f7xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 34 - 35
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 <rtthread.h>
-#include <rtdevice.h>
-#include <board.h>
-#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 <rtthread.h>
+#include <rtdevice.h>
+#include <board.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;		
+}

+ 42 - 41
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 <rtthread.h>
-#include <stm32f7xx.h>
-#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 <rtthread.h>
+#include <stm32f7xx.h>
+#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

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32l432-st-nucleo/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PB3 */
 #define LED0_PIN    GET_PIN(B, 3)
 

+ 1 - 0
bsp/stm32/stm32l432-st-nucleo/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32l4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
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')

+ 1 - 1
bsp/stm32/stm32l475-atk-pandora/applications/main.c

@@ -11,7 +11,7 @@
 #include <rtthread.h>
 #include <rtdevice.h>
 #include <board.h>
-#include "drv_gpio.h"
+
 /* defined the LED0 pin: PE7 */
 #define LED0_PIN    GET_PIN(E, 7)
 

+ 1 - 0
bsp/stm32/stm32l475-atk-pandora/board/board.h

@@ -14,6 +14,7 @@
 #include <rtthread.h>
 #include <stm32l4xx.h>
 #include "drv_common.h"
+#include "drv_gpio.h"
 
 #ifdef __cplusplus
 extern "C" {