SConscript 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. from building import *
  2. import os
  3. cwd = GetCurrentDir()
  4. path = [os.path.join(cwd, 'Inc')]
  5. src_path = os.path.join(cwd, 'Src')
  6. CPPDEFINES = ['USE_HAL_DRIVER']
  7. src = [
  8. os.path.join(src_path, 'stm32f2xx_hal_dma.c'),
  9. os.path.join(src_path, 'stm32f2xx_hal_cortex.c'),
  10. os.path.join(src_path, 'stm32f2xx_hal_crc.c'),
  11. os.path.join(src_path, 'stm32f2xx_hal_pwr.c'),
  12. os.path.join(src_path, 'stm32f2xx_hal_rcc.c'),
  13. os.path.join(src_path, 'stm32f2xx_hal_rcc_ex.c'),
  14. os.path.join(src_path, 'stm32f2xx_hal.c'),
  15. os.path.join(src_path, 'stm32f2xx_hal_sram.c'),
  16. os.path.join(src_path, 'stm32f2xx_hal_gpio.c'),
  17. ]
  18. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  19. src += [os.path.join(src_path, 'stm32f2xx_hal_uart.c')]
  20. src += [os.path.join(src_path, 'stm32f2xx_hal_usart.c')]
  21. if GetDepend(['RT_USING_I2C']):
  22. src += [os.path.join(src_path, 'stm32f2xx_hal_i2c.c')]
  23. if GetDepend(['RT_USING_SPI']):
  24. src += [os.path.join(src_path, 'stm32f2xx_hal_spi.c')]
  25. if GetDepend(['RT_USING_USB']):
  26. src += [os.path.join(src_path, 'stm32f2xx_hal_pccard.c')]
  27. src += [os.path.join(src_path, 'stm32f2xx_hal_pcd.c')]
  28. src += [os.path.join(src_path, 'stm32f2xx_hal_pcd_ex.c')]
  29. src += [os.path.join(src_path, 'stm32f2xx_ll_usb.c')]
  30. src += [os.path.join(src_path, 'stm32f2xx_hal_hcd.c')]
  31. if GetDepend(['RT_USING_CAN']):
  32. src += [os.path.join(src_path, 'stm32f2xx_hal_can.c')]
  33. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  34. src += [os.path.join(src_path, 'stm32f2xx_hal_tim.c')]
  35. src += [os.path.join(src_path, 'stm32f2xx_hal_tim_ex.c')]
  36. if GetDepend(['BSP_USING_ETH']):
  37. src += [os.path.join(src_path, 'stm32f2xx_hal_eth.c')]
  38. if GetDepend(['RT_USING_ADC']):
  39. src += [os.path.join(src_path, 'stm32f2xx_hal_adc.c')]
  40. src += [os.path.join(src_path, 'stm32f2xx_hal_adc_ex.c')]
  41. if GetDepend(['RT_USING_RTC']):
  42. src += [os.path.join(src_path, 'stm32f2xx_hal_rtc.c')]
  43. src += [os.path.join(src_path, 'stm32f2xx_hal_rtc_ex.c')]
  44. if GetDepend(['RT_USING_WDT']):
  45. src += [os.path.join(src_path, 'stm32f2xx_hal_iwdg.c')]
  46. src += [os.path.join(src_path, 'stm32f2xx_hal_wwdg.c')]
  47. if GetDepend(['RT_USING_SDIO']):
  48. src += [os.path.join(src_path, 'stm32f2xx_hal_mmc.c')]
  49. src += [os.path.join(src_path, 'stm32f2xx_hal_sd.c')]
  50. if GetDepend(['RT_USING_AUDIO']):
  51. src += [os.path.join(src_path, 'stm32f2xx_hal_i2s.c')]
  52. if GetDepend(['RT_USING_MTD_NOR']):
  53. src += [os.path.join(src_path, 'stm32f2xx_hal_nor.c')]
  54. if GetDepend(['RT_USING_MTD_NAND']):
  55. src += [os.path.join(src_path, 'stm32f2xx_hal_nand.c')]
  56. if GetDepend(['BSP_USING_EXT_FMC_IO']):
  57. src += [os.path.join(src_path, 'stm32f2xx_hal_sram.c')]
  58. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  59. src += [os.path.join(src_path, 'stm32f2xx_hal_flash.c')]
  60. src += [os.path.join(src_path, 'stm32f2xx_hal_flash_ex.c')]
  61. group = DefineGroup('STM32F2-HAL', src, depend = ['PKG_USING_STM32F2_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  62. Return('group')