[bsp][c3]: Add macro control to sconscript

This commit is contained in:
Z8MAN8 2023-11-30 00:21:12 +08:00 committed by guo
parent 53aa771aa5
commit dfde6950df
2 changed files with 31 additions and 5 deletions

View File

@ -62,10 +62,15 @@ menu "On-chip Peripheral Drivers"
select RT_USING_SERIAL_V1
default y
menuconfig BSP_USING_I2C
bool "Enable I2C"
default n
select RT_USING_I2C
if BSP_USING_I2C
config BSP_USING_I2C0
bool "Enable I2C0"
select RT_USING_I2C
default n
endif
config BSP_USING_WIFI
bool "Enable WIFI"
@ -76,7 +81,7 @@ menu "On-chip Peripheral Drivers"
bool "Enable BLE"
default n
config BSP_USING_HWTIMER
menuconfig BSP_USING_HWTIMER
bool "Enable HWTIMER"
select RT_USING_HWTIMER
default n

View File

@ -2,10 +2,31 @@ import os
from building import *
cwd = GetCurrentDir()
src = Glob('*.c')
src = ['board.c']
CPPPATH = [cwd]
if GetDepend('BSP_USING_GPIO'):
src += ['drv_gpio.c']
if GetDepend('BSP_USING_UART'):
src += ['drv_uart.c']
if GetDepend('BSP_USING_ADC'):
src += ['drv_adc.c']
if GetDepend('BSP_USING_I2C'):
src += ['drv_hw_i2c.c']
if GetDepend('BSP_USING_PWM'):
src += ['drv_pwm.c']
if GetDepend('BSP_USING_HWTIMER'):
src += ['drv_hwtimer.c']
if GetDepend('BSP_USING_WIFI'):
src += ['drv_wifi.c']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
Return('group')