SConscript 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. from building import *
  2. cwd = GetCurrentDir()
  3. path = [cwd]
  4. path += [cwd + '/common']
  5. path += [cwd + '/core']
  6. CPPDEFINES = []
  7. if GetDepend(['PKG_CHERRYUSB_USING_HS']):
  8. CPPDEFINES+=['CONFIG_USB_HS']
  9. elif GetDepend(['PKG_CHERRYUSB_USING_HS_IN_FULL']):
  10. CPPDEFINES += ['CONFIG_USB_HS_IN_FULL']
  11. # USB DEVICE
  12. if GetDepend(['PKG_CHERRYUSB_USING_DEVICE']):
  13. src = Glob('core/usbd_core.c')
  14. if GetDepend(['PKG_CHERRYUSB_USING_CDC']):
  15. path += [cwd + '/class/cdc']
  16. src += Glob('class/cdc/usbd_cdc.c')
  17. if GetDepend(['PKG_CHERRYUSB_USING_HID']):
  18. path += [cwd + '/class/hid']
  19. src += Glob('class/cdc/usbd_hid.c')
  20. if GetDepend(['PKG_CHERRYUSB_USING_DFU']):
  21. path += [cwd + '/class/dfu']
  22. src += Glob('class/cdc/usbd_dfu.c')
  23. if GetDepend(['PKG_CHERRYUSB_USING_HUB']):
  24. path += [cwd + '/class/hub']
  25. src += Glob('class/cdc/usbd_hub.c')
  26. if GetDepend(['PKG_CHERRYUSB_USING_AUDIO']):
  27. path += [cwd + '/class/audio']
  28. src += Glob('class/cdc/usbd_audio.c')
  29. if GetDepend(['PKG_CHERRYUSB_USING_VIDEO']):
  30. path += [cwd + '/class/video']
  31. src += Glob('class/cdc/usbd_video.c')
  32. if GetDepend(['PKG_CHERRYUSB_USING_MSC']):
  33. path += [cwd + '/class/msc']
  34. src += Glob('class/cdc/usbd_msc.c')
  35. if GetDepend(['SOC_FAMILY_STM32']):
  36. if GetDepend(['SOC_SERIES_STM32F0']) or GetDepend(['SOC_SERIES_STM32F1']) or GetDepend(['SOC_SERIES_STM32F3']) or GetDepend(['SOC_SERIES_STM32L0']):
  37. src += Glob('port/fsdev/usb_dc_fsdev.c')
  38. else:
  39. src += Glob('port/synopsys/usb_dc_synopsys.c')
  40. if GetDepend(['SOC_SERIES_STM32H7']):
  41. CPPDEFINES += ['STM32H7']
  42. # USB HOST
  43. if GetDepend(['PKG_CHERRYUSB_USING_HOST']):
  44. src = Glob('core/usbh_core.c')
  45. path += [cwd + '/osal']
  46. src += Glob('osal/usb_osal_rtthread.c')
  47. src += Glob('osal/usb_workq.c')
  48. path += [cwd + '/class/cdc']
  49. src += Glob('class/cdc/usbh_cdc_acm.c')
  50. path += [cwd + '/class/hid']
  51. src += Glob('class/hid/usbh_hid.c')
  52. path += [cwd + '/class/msc']
  53. src += Glob('class/msc/usbh_msc.c')
  54. path += [cwd + '/class/hub']
  55. src += Glob('class/hub/usbh_hub.c')
  56. CPPDEFINES += ['CONFIG_USBHOST_HUB']
  57. if GetDepend(['SOC_FAMILY_STM32']):
  58. src += Glob('port/synopsys/usb_hc_synopsys.c')
  59. group = DefineGroup('CherryUSB', src, depend = ['PKG_USING_CHERRYUSB'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  60. Return('group')