SConscript 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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, 'stm32g0xx_hal_cec.c'),
  9. os.path.join(src_path, 'stm32g0xx_hal_rcc.c'),
  10. os.path.join(src_path, 'stm32g0xx_hal_rcc_ex.c'),
  11. os.path.join(src_path, 'stm32g0xx_hal_flash.c'),
  12. os.path.join(src_path, 'stm32g0xx_hal_flash_ex.c'),
  13. os.path.join(src_path, 'stm32g0xx_hal_dma.c'),
  14. os.path.join(src_path, 'stm32g0xx_hal_dma_ex.c'),
  15. os.path.join(src_path, 'stm32g0xx_hal_pwr.c'),
  16. os.path.join(src_path, 'stm32g0xx_hal_pwr_ex.c'),
  17. os.path.join(src_path, 'stm32g0xx_hal_cortex.c'),
  18. os.path.join(src_path, 'stm32g0xx_hal.c'),
  19. os.path.join(src_path, 'stm32g0xx_hal_gpio.c'),
  20. ]
  21. if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
  22. src += [os.path.join(src_path, 'stm32g0xx_hal_uart.c')]
  23. src += [os.path.join(src_path, 'stm32g0xx_hal_uart_ex.c')]
  24. src += [os.path.join(src_path, 'stm32g0xx_hal_usart_ex.c')]
  25. src += [os.path.join(src_path, 'stm32g0xx_ll_usart.c')]
  26. if GetDepend(['RT_USING_I2C']):
  27. src += [os.path.join(src_path, 'stm32g0xx_hal_i2c.c')]
  28. src += [os.path.join(src_path, 'stm32g0xx_ll_i2c.c')]
  29. if GetDepend(['RT_USING_SPI']):
  30. src += [os.path.join(src_path, 'stm32g0xx_hal_spi.c')]
  31. src += [os.path.join(src_path, 'stm32g0xx_hal_spi_ex.c')]
  32. src += [os.path.join(src_path, 'stm32g0xx_ll_spi.c')]
  33. if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
  34. src += [os.path.join(src_path, 'stm32g0xx_hal_tim.c')]
  35. src += [os.path.join(src_path, 'stm32g0xx_hal_tim_ex.c')]
  36. src += [os.path.join(src_path, 'stm32g0xx_ll_tim.c')]
  37. if GetDepend(['RT_USING_ADC']):
  38. src += [os.path.join(src_path, 'stm32g0xx_hal_adc.c')]
  39. src += [os.path.join(src_path, 'stm32g0xx_hal_adc_ex.c')]
  40. src += [os.path.join(src_path, 'stm32g0xx_ll_adc.c')]
  41. if GetDepend(['RT_USING_WDT']):
  42. src += [os.path.join(src_path, 'stm32g0xx_hal_iwdg.c')]
  43. src += [os.path.join(src_path, 'stm32g0xx_hal_wwdg.c')]
  44. if GetDepend(['RT_USING_RTC']):
  45. src += [os.path.join(src_path, 'stm32g0xx_hal_rtc.c')]
  46. src += [os.path.join(src_path, 'stm32g0xx_hal_rtc_ex.c')]
  47. src += [os.path.join(src_path, 'stm32g0xx_ll_rtc.c')]
  48. group = DefineGroup('STM32G0-HAL', src, depend = ['PKG_USING_STM32G0_HAL_DRIVER'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  49. Return('group')