SConscript 3.1 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, 'stm32f0xx_hal_dma.c'),
  9. os.path.join(src_path, 'stm32f0xx_hal_cortex.c'),
  10. os.path.join(src_path, 'stm32f0xx_hal_crc.c'),
  11. os.path.join(src_path, 'stm32f0xx_hal_crc_ex.c'),
  12. os.path.join(src_path, 'stm32f0xx_hal_pwr.c'),
  13. os.path.join(src_path, 'stm32f0xx_hal_rcc.c'),
  14. os.path.join(src_path, 'stm32f0xx_hal_rcc_ex.c'),
  15. os.path.join(src_path, 'stm32f0xx_hal.c'),
  16. os.path.join(src_path, 'stm32f0xx_ll_crc.c'),
  17. os.path.join(src_path, 'stm32f0xx_ll_dma.c'),
  18. os.path.join(src_path, 'stm32f0xx_ll_exti.c'),
  19. os.path.join(src_path, 'stm32f0xx_ll_gpio.c'),
  20. os.path.join(src_path, 'stm32f0xx_ll_pwr.c'),
  21. os.path.join(src_path, 'stm32f0xx_ll_rcc.c'),
  22. os.path.join(src_path, 'stm32f0xx_ll_utils.c'),
  23. os.path.join(src_path, 'stm32f0xx_hal_gpio.c'),
  24. ]
  25. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  26. src += [os.path.join(src_path, 'stm32f0xx_hal_uart.c')]
  27. src += [os.path.join(src_path, 'stm32f0xx_hal_uart_ex.c')]
  28. src += [os.path.join(src_path, 'stm32f0xx_hal_usart.c')]
  29. src += [os.path.join(src_path, 'stm32f0xx_ll_usart.c')]
  30. if GetDepend(['RT_USING_I2C']):
  31. src += [os.path.join(src_path, 'stm32f0xx_hal_i2c.c')]
  32. src += [os.path.join(src_path, 'stm32f0xx_ll_i2c.c')]
  33. src += [os.path.join(src_path, 'stm32f0xx_ll_i2c.c')]
  34. if GetDepend(['RT_USING_SPI']):
  35. src += [os.path.join(src_path, 'stm32f0xx_hal_spi.c')]
  36. src += [os.path.join(src_path, 'stm32f0xx_hal_spi_ex.c')]
  37. src += [os.path.join(src_path, 'stm32f0xx_ll_spi.c')]
  38. if GetDepend(['RT_USING_USB']):
  39. src += [os.path.join(src_path, 'stm32f0xx_hal_pcd.c')]
  40. src += [os.path.join(src_path, 'stm32f0xx_hal_pcd_ex.c')]
  41. if GetDepend(['RT_USING_CAN']):
  42. src += [os.path.join(src_path, 'stm32f0xx_hal_can.c')]
  43. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  44. src += [os.path.join(src_path, 'stm32f0xx_hal_tim.c')]
  45. src += [os.path.join(src_path, 'stm32f0xx_hal_tim_ex.c')]
  46. src += [os.path.join(src_path, 'stm32f0xx_ll_tim.c')]
  47. if GetDepend(['RT_USING_ADC']):
  48. src += [os.path.join(src_path, 'stm32f0xx_hal_adc.c')]
  49. src += [os.path.join(src_path, 'stm32f0xx_hal_adc_ex.c')]
  50. src += [os.path.join(src_path, 'stm32f0xx_ll_adc.c')]
  51. if GetDepend(['RT_USING_RTC']):
  52. src += [os.path.join(src_path, 'stm32f0xx_hal_rtc.c')]
  53. src += [os.path.join(src_path, 'stm32f0xx_hal_rtc_ex.c')]
  54. src += [os.path.join(src_path, 'stm32f0xx_ll_rtc.c')]
  55. if GetDepend(['RT_USING_WDT']):
  56. src += [os.path.join(src_path, 'stm32f0xx_hal_iwdg.c')]
  57. src += [os.path.join(src_path, 'stm32f0xx_hal_wwdg.c')]
  58. if GetDepend(['RT_USING_AUDIO']):
  59. src += [os.path.join(src_path, 'stm32f0xx_hal_i2s.c')]
  60. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  61. src += [os.path.join(src_path, 'stm32f0xx_hal_flash.c')]
  62. src += [os.path.join(src_path, 'stm32f0xx_hal_flash_ex.c')]
  63. group = DefineGroup('STM32F0-HAL', src, depend = ['PKG_USING_STM32F0_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  64. Return('group')