2023-01-09 10:14:23 +08:00
|
|
|
# RT-Thread building script for component
|
2020-06-17 16:30:11 +08:00
|
|
|
|
2020-06-24 00:32:10 +08:00
|
|
|
Import('RTT_ROOT')
|
2020-06-17 16:30:11 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
src = Glob('*.c') + Glob('*.cpp')
|
|
|
|
CPPPATH = [cwd]
|
2020-06-24 00:32:10 +08:00
|
|
|
group = []
|
2020-06-17 16:30:11 +08:00
|
|
|
|
2020-06-24 00:32:10 +08:00
|
|
|
# USB driver constrain
|
|
|
|
if GetDepend('BOARD_USING_HSUSBD') and ( GetDepend('BSP_USING_USBD') or GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_HSOTG') ):
|
2021-03-25 10:38:57 +08:00
|
|
|
print ('Sorry, wrong selection.')
|
|
|
|
print ('[Hint] You already select BOARD_USING_HSUSBD. Please de-select BSP_USING_USBD, BSP_USING_HSUSBH and BSP_USING_HSOTG options.')
|
2020-06-24 00:32:10 +08:00
|
|
|
sys.exit(1)
|
|
|
|
elif GetDepend('BOARD_USING_HSUSBD_USBH') and ( GetDepend('BSP_USING_USBD') or GetDepend('BSP_USING_HSUSBH') or GetDepend('BSP_USING_HSOTG') ):
|
2021-03-25 10:38:57 +08:00
|
|
|
print ('Sorry, wrong selection.')
|
|
|
|
print ('[Hint] You already select BOARD_USING_HSUSBD_USBH. Please de-select BSP_USING_USBD, BSP_USING_HSUSBH and BSP_USING_HSOTG options.')
|
2020-06-24 00:32:10 +08:00
|
|
|
sys.exit(1)
|
|
|
|
elif GetDepend('BOARD_USING_HSUSBH') and ( GetDepend('BSP_USING_USBH') or GetDepend('BSP_USING_HSUSBD') or GetDepend('BSP_USING_HSOTG') ):
|
2021-03-25 10:38:57 +08:00
|
|
|
print ('Sorry, wrong selection.')
|
|
|
|
print ('[Hint] You already select BOARD_USING_HSUSBH. Please de-select BSP_USING_USBH, BSP_USING_HSUSBD and BSP_USING_HSOTG options.')
|
2020-06-24 00:32:10 +08:00
|
|
|
sys.exit(1)
|
|
|
|
elif GetDepend('BOARD_USING_HSUSBH_USBD') and ( GetDepend('BSP_USING_USBH') or GetDepend('BSP_USING_HSUSBD') or GetDepend('BSP_USING_HSOTG') ):
|
2021-03-25 10:38:57 +08:00
|
|
|
print ('Sorry, wrong selection.')
|
|
|
|
print ('[Hint] You already select BOARD_USING_HSUSBH_USBD. Please de-select BSP_USING_USBH, BSP_USING_HSUSBD and BSP_USING_HSOTG options.')
|
2020-06-24 00:32:10 +08:00
|
|
|
sys.exit(1)
|
|
|
|
elif GetDepend('BOARD_USING_HSOTG') and ( GetDepend('BSP_USING_USBD') or GetDepend('BSP_USING_USBH') ):
|
2021-03-25 10:38:57 +08:00
|
|
|
print ('Sorry, wrong selection.')
|
|
|
|
print ('[Hint] You already select BOARD_USING_HSOTG. Please de-select BSP_USING_USBD and BSP_USING_USBH options.')
|
2020-06-24 00:32:10 +08:00
|
|
|
sys.exit(1)
|
|
|
|
else:
|
2020-12-19 16:49:11 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
|
2020-06-17 16:30:11 +08:00
|
|
|
|
|
|
|
Return('group')
|
2023-01-09 10:14:23 +08:00
|
|
|
')
|