SConscript 3.2 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, 'stm32wbxx_hal.c'),
  9. os.path.join(src_path, 'stm32wbxx_hal_comp.c'),
  10. os.path.join(src_path, 'stm32wbxx_hal_cortex.c'),
  11. os.path.join(src_path, 'stm32wbxx_hal_crc.c'),
  12. os.path.join(src_path, 'stm32wbxx_hal_crc_ex.c'),
  13. os.path.join(src_path, 'stm32wbxx_hal_cryp.c'),
  14. os.path.join(src_path, 'stm32wbxx_hal_cryp_ex.c'),
  15. os.path.join(src_path, 'stm32wbxx_hal_dma.c'),
  16. os.path.join(src_path, 'stm32wbxx_hal_dma_ex.c'),
  17. os.path.join(src_path, 'stm32wbxx_hal_exti.c'),
  18. os.path.join(src_path, 'stm32wbxx_hal_pwr.c'),
  19. os.path.join(src_path, 'stm32wbxx_hal_pwr_ex.c'),
  20. os.path.join(src_path, 'stm32wbxx_hal_rcc.c'),
  21. os.path.join(src_path, 'stm32wbxx_hal_rcc_ex.c'),
  22. os.path.join(src_path, 'stm32wbxx_hal_rng.c'),
  23. os.path.join(src_path, 'stm32wbxx_hal_gpio.c'),
  24. os.path.join(src_path, 'stm32wbxx_hal_hsem.c'),
  25. ]
  26. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  27. src += [os.path.join(src_path, 'stm32wbxx_hal_uart.c')]
  28. src += [os.path.join(src_path, 'stm32wbxx_hal_uart_ex.c')]
  29. src += [os.path.join(src_path, 'stm32wbxx_hal_usart.c')]
  30. src += [os.path.join(src_path, 'stm32wbxx_hal_usart_ex.c')]
  31. if GetDepend(['RT_USING_I2C']):
  32. src += [os.path.join(src_path, 'stm32wbxx_hal_i2c.c')]
  33. src += [os.path.join(src_path, 'stm32wbxx_hal_i2c_ex.c')]
  34. if GetDepend(['RT_USING_SPI']):
  35. src += [os.path.join(src_path, 'stm32wbxx_hal_spi.c')]
  36. src += [os.path.join(src_path, 'stm32wbxx_hal_spi_ex.c')]
  37. src += [os.path.join(src_path, 'stm32wbxx_hal_qspi.c')]
  38. if GetDepend(['RT_USING_USB']):
  39. src += [os.path.join(src_path, 'stm32wbxx_hal_hcd.c')]
  40. src += [os.path.join(src_path, 'stm32wbxx_hal_pcd.c')]
  41. src += [os.path.join(src_path, 'stm32wbxx_hal_pcd_ex.c')]
  42. src += [os.path.join(src_path, 'stm32wbxx_ll_usb.c')]
  43. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  44. src += [os.path.join(src_path, 'stm32wbxx_hal_lptim.c')]
  45. src += [os.path.join(src_path, 'stm32wbxx_hal_tim.c')]
  46. src += [os.path.join(src_path, 'stm32wbxx_hal_tim_ex.c')]
  47. if GetDepend(['RT_USING_ADC']):
  48. src += [os.path.join(src_path, 'stm32wbxx_hal_adc.c')]
  49. src += [os.path.join(src_path, 'stm32wbxx_hal_adc_ex.c')]
  50. if GetDepend(['RT_USING_RTC']):
  51. src += [os.path.join(src_path, 'stm32wbxx_hal_rtc.c')]
  52. src += [os.path.join(src_path, 'stm32wbxx_hal_rtc_ex.c')]
  53. if GetDepend(['RT_USING_WDT']):
  54. src += [os.path.join(src_path, 'stm32wbxx_hal_iwdg.c')]
  55. src += [os.path.join(src_path, 'stm32wbxx_hal_wwdg.c')]
  56. if GetDepend(['RT_USING_AUDIO']):
  57. src += [os.path.join(src_path, 'stm32wbxx_hal_sai.c')]
  58. src += [os.path.join(src_path, 'stm32wbxx_hal_sai_ex.c')]
  59. if GetDepend(['RT_USING_PM']):
  60. src += [os.path.join(src_path, 'stm32wbxx_hal_lptim.c')]
  61. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  62. src += [os.path.join(src_path, 'stm32wbxx_hal_flash.c')]
  63. src += [os.path.join(src_path, 'stm32wbxx_hal_flash_ex.c')]
  64. src += [os.path.join(src_path, 'stm32wbxx_hal_flash_ramfunc.c')]
  65. group = DefineGroup('STM32WB-HAL', src, depend = ['PKG_USING_STM32WB_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  66. Return('group')