SConscript 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. path += [os.path.join(cwd, 'Inc/Legacy')]
  7. CPPDEFINES = ['USE_HAL_DRIVER']
  8. src = [
  9. os.path.join(src_path, 'stm32wlxx_hal.c'),
  10. os.path.join(src_path, 'stm32wlxx_hal_comp.c'),
  11. os.path.join(src_path, 'stm32wlxx_hal_cortex.c'),
  12. os.path.join(src_path, 'stm32wlxx_hal_crc.c'),
  13. os.path.join(src_path, 'stm32wlxx_hal_crc_ex.c'),
  14. os.path.join(src_path, 'stm32wlxx_hal_cryp.c'),
  15. os.path.join(src_path, 'stm32wlxx_hal_cryp_ex.c'),
  16. os.path.join(src_path, 'stm32wlxx_hal_dma.c'),
  17. os.path.join(src_path, 'stm32wlxx_hal_dma_ex.c'),
  18. os.path.join(src_path, 'stm32wlxx_hal_exti.c'),
  19. os.path.join(src_path, 'stm32wlxx_hal_pwr.c'),
  20. os.path.join(src_path, 'stm32wlxx_hal_pwr_ex.c'),
  21. os.path.join(src_path, 'stm32wlxx_hal_rcc.c'),
  22. os.path.join(src_path, 'stm32wlxx_hal_rcc_ex.c'),
  23. os.path.join(src_path, 'stm32wlxx_hal_rng.c'),
  24. os.path.join(src_path, 'stm32wlxx_hal_gpio.c'),
  25. ]
  26. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  27. src += [os.path.join(src_path, 'stm32wlxx_hal_uart.c')]
  28. src += [os.path.join(src_path, 'stm32wlxx_hal_uart_ex.c')]
  29. src += [os.path.join(src_path, 'stm32wlxx_hal_usart.c')]
  30. src += [os.path.join(src_path, 'stm32wlxx_hal_usart_ex.c')]
  31. if GetDepend(['RT_USING_I2C']):
  32. src += [os.path.join(src_path, 'stm32wlxx_hal_i2c.c')]
  33. src += [os.path.join(src_path, 'stm32wlxx_hal_i2c_ex.c')]
  34. if GetDepend(['RT_USING_SPI']):
  35. src += [os.path.join(src_path, 'stm32wlxx_hal_spi.c')]
  36. src += [os.path.join(src_path, 'stm32wlxx_hal_spi_ex.c')]
  37. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  38. src += [os.path.join(src_path, 'stm32wlxx_hal_lptim.c')]
  39. src += [os.path.join(src_path, 'stm32wlxx_hal_tim.c')]
  40. src += [os.path.join(src_path, 'stm32wlxx_hal_tim_ex.c')]
  41. if GetDepend(['RT_USING_ADC']):
  42. src += [os.path.join(src_path, 'stm32wlxx_hal_adc.c')]
  43. src += [os.path.join(src_path, 'stm32wlxx_hal_adc_ex.c')]
  44. if GetDepend(['BSP_USING_ONCHIP_RTC']):
  45. src += [os.path.join(src_path, 'stm32wlxx_hal_rtc.c')]
  46. src += [os.path.join(src_path, 'stm32wlxx_hal_rtc_ex.c')]
  47. if GetDepend(['RT_USING_WDT']):
  48. src += [os.path.join(src_path, 'stm32wlxx_hal_iwdg.c')]
  49. src += [os.path.join(src_path, 'stm32wlxx_hal_wwdg.c')]
  50. if GetDepend(['RT_USING_PM']):
  51. src += [os.path.join(src_path, 'stm32wlxx_hal_lptim.c')]
  52. if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
  53. src += [os.path.join(src_path, 'stm32wlxx_hal_flash.c')]
  54. src += [os.path.join(src_path, 'stm32wlxx_hal_flash_ex.c')]
  55. src += [os.path.join(src_path, 'stm32wlxx_hal_flash_ramfunc.c')]
  56. if GetDepend(['BSP_USING_SUBGHZ']):
  57. src += [os.path.join(src_path, 'stm32wlxx_hal_subghz.c')]
  58. group = DefineGroup('STM32WL-HAL', src, depend = ['PKG_USING_STM32WL_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  59. Return('group')