SConscript 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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, 'stm32f1xx_hal_dma.c'),
  9. os.path.join(src_path, 'stm32f1xx_hal_cortex.c'),
  10. os.path.join(src_path, 'stm32f1xx_hal_crc.c'),
  11. os.path.join(src_path, 'stm32f1xx_hal_pwr.c'),
  12. os.path.join(src_path, 'stm32f1xx_hal_rcc.c'),
  13. os.path.join(src_path, 'stm32f1xx_hal_rcc_ex.c'),
  14. os.path.join(src_path, 'stm32f1xx_hal.c'),
  15. os.path.join(src_path, 'stm32f1xx_hal_cec.c'),
  16. os.path.join(src_path, 'stm32f1xx_hal_gpio.c'),
  17. ]
  18. if GetDepend(['RT_USING_PIN']):
  19. src += [os.path.join(src_path, 'stm32f1xx_hal_gpio_ex.c')]
  20. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  21. src += [os.path.join(src_path, 'stm32f1xx_hal_uart.c')]
  22. src += [os.path.join(src_path, 'stm32f1xx_hal_usart.c')]
  23. if GetDepend(['RT_USING_I2C']):
  24. src += [os.path.join(src_path, 'stm32f1xx_hal_i2c.c')]
  25. if GetDepend(['RT_USING_SPI']):
  26. src += [os.path.join(src_path, 'stm32f1xx_hal_spi.c')]
  27. src += [os.path.join(src_path, 'stm32f1xx_ll_spi.c')]
  28. if GetDepend(['RT_USING_USB']):
  29. src += [os.path.join(src_path, 'stm32f1xx_hal_pcd.c')]
  30. src += [os.path.join(src_path, 'stm32f1xx_hal_pcd_ex.c')]
  31. src += [os.path.join(src_path, 'stm32f1xx_ll_usb.c')]
  32. src += [os.path.join(src_path, 'stm32f1xx_hal_hcd.c')]
  33. if GetDepend(['RT_USING_CAN']):
  34. src += [os.path.join(src_path, 'stm32f1xx_hal_can.c')]
  35. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']) or GetDepend(['RT_USING_PULSE_ENCODER']):
  36. src += [os.path.join(src_path, 'stm32f1xx_hal_tim.c')]
  37. src += [os.path.join(src_path, 'stm32f1xx_hal_tim_ex.c')]
  38. if GetDepend(['BSP_USING_ETH']):
  39. src += [os.path.join(src_path, 'stm32f1xx_hal_eth.c')]
  40. if GetDepend(['RT_USING_ADC']):
  41. src += [os.path.join(src_path, 'stm32f1xx_hal_adc.c')]
  42. src += [os.path.join(src_path, 'stm32f1xx_hal_adc_ex.c')]
  43. if GetDepend(['RT_USING_DAC']):
  44. src += [os.path.join(src_path, 'stm32f1xx_hal_dac.c')]
  45. src += [os.path.join(src_path, 'stm32f1xx_hal_dac_ex.c')]
  46. if GetDepend(['RT_USING_RTC']):
  47. src += [os.path.join(src_path, 'stm32f1xx_hal_rtc.c')]
  48. src += [os.path.join(src_path, 'stm32f1xx_hal_rtc_ex.c')]
  49. if GetDepend(['RT_USING_WDT']):
  50. src += [os.path.join(src_path, 'stm32f1xx_hal_iwdg.c')]
  51. src += [os.path.join(src_path, 'stm32f1xx_hal_wwdg.c')]
  52. if GetDepend(['RT_USING_SDIO']):
  53. src += [os.path.join(src_path, 'stm32f1xx_ll_sdmmc.c')]
  54. src += [os.path.join(src_path, 'stm32f1xx_hal_sd.c')]
  55. if GetDepend(['RT_USING_AUDIO']):
  56. src += [os.path.join(src_path, 'stm32f1xx_hal_i2s.c')]
  57. if GetDepend(['RT_USING_MTD_NOR']):
  58. src += [os.path.join(src_path, 'stm32f1xx_hal_nor.c')]
  59. if GetDepend(['RT_USING_MTD_NAND']):
  60. src += [os.path.join(src_path, 'stm32f1xx_ll_fsmc.c')]
  61. src += [os.path.join(src_path, 'stm32f1xx_hal_nand.c')]
  62. if GetDepend(['BSP_USING_EXT_SRAM']):
  63. src += [os.path.join(src_path, 'stm32f1xx_ll_fsmc.c')]
  64. src += [os.path.join(src_path, 'stm32f1xx_hal_sram.c')]
  65. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  66. src += [os.path.join(src_path, 'stm32f1xx_hal_flash.c')]
  67. src += [os.path.join(src_path, 'stm32f1xx_hal_flash_ex.c')]
  68. group = DefineGroup('STM32F1-HAL', src, depend = ['PKG_USING_STM32F1_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  69. Return('group')