1# RT-Thread building script for component 2 3from building import * 4 5cwd = GetCurrentDir() 6src = [] 7src += ['drv_common.c'] 8path = [cwd] 9path += [cwd + '/config'] 10 11if GetDepend('RT_USING_PIN'): 12 src += ['drv_gpio.c'] 13 14if GetDepend('RT_USING_SERIAL'): 15 src += ['drv_usart.c'] 16 17if GetDepend('RT_USING_SDIO'): 18 src += ['drv_sdio.c'] 19 20if GetDepend('RT_USING_I2C'): 21 src += ['drv_soft_i2c.c'] 22 23if GetDepend('RT_USING_WDT'): 24 src += ['drv_wdt.c'] 25 26if GetDepend('RT_USING_HWTIMER'): 27 src += ['drv_hwtimer.c'] 28 29if GetDepend('RT_USING_PWM'): 30 src += ['drv_pwm.c'] 31 32if GetDepend('RT_USING_RTC'): 33 src += ['drv_rtc.c'] 34 35if GetDepend('RT_USING_ADC'): 36 src += ['drv_adc.c'] 37 38if GetDepend('BSP_USING_IRRX'): 39 src += ['drv_irrx.c'] 40 41if GetDepend('BSP_USING_ON_CHIP_FLASH'): 42 src += ['drv_flash.c'] 43 44group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) 45 46objs = [group] 47 48list = os.listdir(cwd) 49 50for item in list: 51 if os.path.isfile(os.path.join(cwd, item, 'SConscript')): 52 objs = objs + SConscript(os.path.join(item, 'SConscript')) 53 54Return('objs') 55