from building import * cwd = GetCurrentDir() src = Split(''' drv_uart.c drv_por.c ''') CPPDEFINES = [] CPPPATH = [cwd] CHIP_TYPE = 'cv180x' if GetDepend('BOARD_TYPE_MILKV_DUO256M') or GetDepend('BOARD_TYPE_MILKV_DUO256M_SPINOR') or GetDepend('BOARD_TYPE_MILKV_DUO256M_SPINAND'): CHIP_TYPE = 'cv181x' elif GetDepend('BOARD_TYPE_MILKV_DUO') or GetDepend('BOARD_TYPE_MILKV_DUO_SPINOR') or GetDepend('BOARD_TYPE_MILKV_DUO_SPINAND'): CHIP_TYPE = 'cv180x' CPPPATH += [cwd + r'/libraries'] CPPPATH += [cwd + r'/libraries/' + CHIP_TYPE] if GetDepend('BSP_USING_CV180X'): src += ['drv_gpio.c'] if GetDepend('BSP_USING_I2C'): src += ['drv_hw_i2c.c'] if GetDepend('BSP_USING_ADC'): src += ['drv_adc.c'] if GetDepend('BSP_USING_WDT'): src += ['drv_wdt.c'] if GetDepend(['BSP_USING_SPI']): src += ['drv_spi.c'] if GetDepend('BSP_USING_PWM'): src += ['drv_pwm.c'] CPPPATH += [cwd + r'/libraries/cv180x/pwm'] CPPDEFINES += ['-DCONFIG_64BIT'] if GetDepend('BSP_USING_RTC'): src += ['drv_rtc.c'] group = DefineGroup('drivers', src, depend = [''], CPPDEFINES = CPPDEFINES, CPPPATH = CPPPATH) Return('group')