Skip to content

Commit 663e853

Browse files
committed
bsp(stm32f407-micu): cleanup SConscript formatting and dead code
1 parent 4cd76ab commit 663e853

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

bsp/stm32/stm32f407-micu/board/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ config SOC_STM32F407VE
88
default y
99

1010
menu "Onboard Peripheral Drivers"
11+
1112
config BSP_USING_VIRTUAL_USART
1213
bool "Enable DAPLink USB-to-USART1 virtual port"
1314
select BSP_USING_UART
1415
select BSP_USING_UART1
1516
default y
17+
1618
config BSP_USING_ON_BOARD_FLASH
1719
bool "Enable Onboard SPI Flash"
1820
select BSP_USING_SPI
@@ -21,6 +23,7 @@ menu "Onboard Peripheral Drivers"
2123
select BSP_SPI1_RX_USING_DMA
2224
select RT_USING_SFUD
2325
default n
26+
2427
endmenu
2528

2629
menu "On-chip Peripheral Drivers"
@@ -49,6 +52,7 @@ menu "On-chip Peripheral Drivers"
4952
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
5053
default n
5154
endif
55+
5256
menuconfig BSP_USING_SPI
5357
bool "Enable SPI BUS"
5458
default n
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
import os
21
from building import *
32

4-
objs = []
5-
cwd = GetCurrentDir()
6-
7-
# add general drivers
3+
cwd = GetCurrentDir()
84
src = []
9-
path = [cwd]
10-
5+
CPPPATH = [cwd]
116

127
if GetDepend(['BSP_USING_ON_BOARD_FLASH']):
138
src += Glob('spi_flash_init.c')
14-
CPPDEFINES = ['STM32F407xx']
15-
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
169

17-
list = os.listdir(cwd)
18-
for item in list:
19-
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
20-
group = group + SConscript(os.path.join(item, 'SConscript'))
10+
group = DefineGroup(
11+
'Drivers',
12+
src,
13+
depend = ['BSP_USING_ON_BOARD_FLASH'],
14+
CPPPATH = CPPPATH,
15+
)
2116

22-
Return('group')
17+
Return('group')

bsp/stm32/stm32f407-micu/board/ports/spi_flash_init.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <drv_spi.h>
1818
#include <drv_gpio.h>
1919

20-
#if defined(BSP_USING_ON_BOARD_FLASH)
2120
static int rt_hw_spi_flash_init(void)
2221
{
2322
__HAL_RCC_GPIOA_CLK_ENABLE();
@@ -31,4 +30,3 @@ static int rt_hw_spi_flash_init(void)
3130
return RT_EOK;
3231
}
3332
INIT_COMPONENT_EXPORT(rt_hw_spi_flash_init);
34-
#endif

0 commit comments

Comments
 (0)