2020-10-04 16:25:26 +00:00
|
|
|
##
|
|
|
|
## OpenRTX - Modular Open Source Radio Firmware
|
|
|
|
##
|
|
|
|
project('OpenRTX', 'c',
|
|
|
|
version : '0.1',
|
|
|
|
default_options : ['warning_level=3'])
|
|
|
|
|
|
|
|
##
|
|
|
|
## Here are listed all the platform independent source files
|
|
|
|
##
|
2020-10-31 08:17:42 +00:00
|
|
|
|
|
|
|
## OpenRTX
|
|
|
|
|
2020-12-04 09:22:57 +00:00
|
|
|
openrtx_src = ['openrtx/src/bootstrap.c',
|
|
|
|
'openrtx/src/state.c',
|
2021-01-10 08:04:53 +00:00
|
|
|
'openrtx/src/ui/ui.c',
|
|
|
|
'openrtx/src/ui/ui_main.c',
|
|
|
|
'openrtx/src/ui/ui_menu.c',
|
2020-12-11 13:09:20 +00:00
|
|
|
'openrtx/src/threads.c',
|
2020-12-11 14:15:28 +00:00
|
|
|
'openrtx/src/battery.c',
|
2020-12-19 11:49:30 +00:00
|
|
|
'openrtx/src/graphics.c',
|
2020-12-30 14:46:43 +00:00
|
|
|
'openrtx/src/input.c',
|
2021-01-30 09:28:25 +00:00
|
|
|
'openrtx/src/calibUtils.c',
|
|
|
|
'openrtx/src/rtx.c']
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2020-11-27 11:49:39 +00:00
|
|
|
## Replace main executable with platform test
|
|
|
|
if get_option('test') != ''
|
|
|
|
openrtx_src += 'tests/platform/'+get_option('test')+'.c'
|
|
|
|
else
|
|
|
|
openrtx_src += 'openrtx/src/main.c'
|
|
|
|
endif
|
|
|
|
|
2020-12-24 15:24:35 +00:00
|
|
|
openrtx_inc = ['openrtx/include',
|
2020-12-04 09:27:04 +00:00
|
|
|
'openrtx/include/calibration',
|
2020-11-13 13:31:21 +00:00
|
|
|
'platform/drivers/ADC',
|
2020-11-21 17:25:25 +00:00
|
|
|
'platform/drivers/NVM',
|
2020-11-17 13:30:20 +00:00
|
|
|
'platform/drivers/tones',
|
2020-12-06 08:17:00 +00:00
|
|
|
'openrtx/include/fonts/adafruit',
|
2020-11-14 13:44:59 +00:00
|
|
|
'platform/drivers/tones',
|
|
|
|
'platform/drivers/baseband']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
|
|
|
## RTOS
|
2020-10-04 16:25:26 +00:00
|
|
|
rtos_src = ['rtos/uC-OS3/Source/__dbg_uCOS-III.c',
|
|
|
|
'rtos/uC-OS3/Source/os_cfg_app.c',
|
|
|
|
'rtos/uC-OS3/Source/os_core.c',
|
|
|
|
'rtos/uC-OS3/Source/os_dbg.c',
|
|
|
|
'rtos/uC-OS3/Source/os_flag.c',
|
|
|
|
'rtos/uC-OS3/Source/os_mem.c',
|
|
|
|
'rtos/uC-OS3/Source/os_msg.c',
|
|
|
|
'rtos/uC-OS3/Source/os_mutex.c',
|
|
|
|
'rtos/uC-OS3/Source/os_prio.c',
|
|
|
|
'rtos/uC-OS3/Source/os_q.c',
|
|
|
|
'rtos/uC-OS3/Source/os_sem.c',
|
|
|
|
'rtos/uC-OS3/Source/os_stat.c',
|
|
|
|
'rtos/uC-OS3/Source/os_task.c',
|
|
|
|
'rtos/uC-OS3/Source/os_tick.c',
|
|
|
|
'rtos/uC-OS3/Source/os_time.c',
|
|
|
|
'rtos/uC-OS3/Source/os_tmr.c',
|
|
|
|
'rtos/uC-OS3/Source/os_var.c',
|
|
|
|
'rtos/uC-OS3/Cfg/os_app_hooks.c',
|
|
|
|
'rtos/uC-CPU/cpu_core.c',
|
|
|
|
'rtos/uC-LIB/lib_ascii.c',
|
|
|
|
'rtos/uC-LIB/lib_math.c',
|
|
|
|
'rtos/uC-LIB/lib_mem.c',
|
|
|
|
'rtos/uC-LIB/lib_str.c']
|
|
|
|
|
2020-10-10 22:25:59 +00:00
|
|
|
rtos_inc = ['rtos/uC-OS3/Source',
|
|
|
|
'rtos/uC-OS3/Cfg',
|
|
|
|
'rtos/uC-CPU',
|
|
|
|
'rtos/uC-CPU/Cfg',
|
|
|
|
'rtos/uC-LIB',
|
|
|
|
'rtos/uC-LIB/Cfg']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
src = openrtx_src + rtos_src
|
|
|
|
inc = openrtx_inc + rtos_inc
|
2020-10-04 16:25:26 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
## Definitions
|
|
|
|
##
|
|
|
|
def = {'DONT_USE_CMSIS_INIT': ''}
|
|
|
|
|
2020-10-31 08:17:42 +00:00
|
|
|
##
|
|
|
|
## MCU-dependent sources and includes
|
|
|
|
##
|
|
|
|
|
|
|
|
## STM32F405
|
|
|
|
|
|
|
|
stm32f405_src = ['platform/mcu/STM32F4xx/boot/startup.c',
|
|
|
|
'platform/mcu/STM32F4xx/boot/libc_integration.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usb_bsp.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usb_core.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usb_dcd.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usb_dcd_int.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usbd_desc.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usbd_core.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usbd_ioreq.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usbd_req.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb/usbd_usr.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/gpio.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb_vcom.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/delays.c',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/rtc.c',
|
|
|
|
'platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c',
|
|
|
|
'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M/os_cpu_c.c',
|
|
|
|
'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M/os_cpu_a.s',
|
|
|
|
'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M/cpu_c.c',
|
|
|
|
'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M/cpu_a.s']
|
|
|
|
|
|
|
|
stm32f405_inc = ['platform/mcu/CMSIS/Include',
|
|
|
|
'platform/mcu/CMSIS/Device/ST/STM32F4xx/Include',
|
|
|
|
'platform/mcu/STM32F4xx',
|
|
|
|
'platform/mcu/STM32F4xx/drivers',
|
|
|
|
'platform/mcu/STM32F4xx/drivers/usb',
|
|
|
|
'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M',
|
|
|
|
'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M']
|
|
|
|
|
2020-11-13 13:31:21 +00:00
|
|
|
stm32f405_def = {'STM32F40_41xxx': '', 'HSE_VALUE':'8000000'}
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2020-12-01 08:40:50 +00:00
|
|
|
## MK22FN512
|
|
|
|
|
|
|
|
mk22fn512_src = ['platform/mcu/MK22FN512xxx12/boot/startup.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/boot/libc_integration.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/gpio.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/delays.c',
|
2020-12-18 20:54:34 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/rtc.c',
|
2020-12-28 11:43:27 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/I2C0.c',
|
2020-12-22 10:05:50 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb/usb_device_cdc_acm.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb/usb_device_ch9.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb/usb_device_dci.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb/usb_device_descriptor.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb/usb_device_khci.c',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb/usb_osa_bm.c',
|
2020-12-22 11:16:01 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb_vcom.c',
|
2020-12-01 08:40:50 +00:00
|
|
|
'platform/mcu/CMSIS/Device/NXP/MK22FN512xxx12/Source/system_MK22F51212.c',
|
|
|
|
'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M/os_cpu_c.c',
|
|
|
|
'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M/os_cpu_a.s',
|
|
|
|
'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M/cpu_c.c',
|
|
|
|
'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M/cpu_a.s']
|
|
|
|
|
|
|
|
mk22fn512_inc = ['platform/mcu/CMSIS/Include',
|
|
|
|
'platform/mcu/CMSIS/Device/NXP/MK22FN512xxx12/Include',
|
2020-12-22 10:05:50 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers',
|
2020-12-01 08:40:50 +00:00
|
|
|
'rtos/uC-OS3/Ports/ARM-Cortex-M/ARMv7-M',
|
|
|
|
'rtos/uC-CPU/ARM-Cortex-M/ARMv7-M']
|
|
|
|
|
|
|
|
mk22fn512_def = {}
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2020-10-10 22:25:59 +00:00
|
|
|
## Platform specializations
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
|
|
|
|
2020-10-10 22:25:59 +00:00
|
|
|
## Linux
|
2020-11-17 14:44:06 +00:00
|
|
|
linux_src = src + ['platform/targets/linux/emulator/emulator.c',
|
|
|
|
'platform/drivers/display/display_libSDL.c',
|
2020-10-30 21:58:15 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_linux.c',
|
2021-01-01 20:56:18 +00:00
|
|
|
'platform/drivers/NVM/nvmem_linux.c',
|
2020-10-23 08:29:34 +00:00
|
|
|
'platform/mcu/x86_64/drivers/gpio.c',
|
|
|
|
'platform/mcu/x86_64/drivers/delays.c',
|
2020-10-31 10:18:01 +00:00
|
|
|
'platform/mcu/x86_64/drivers/rtc.c',
|
2021-01-30 09:42:44 +00:00
|
|
|
'platform/drivers/baseband/radio_linux.c',
|
2020-10-23 08:29:34 +00:00
|
|
|
'platform/targets/linux/platform.c',
|
2020-10-10 22:25:59 +00:00
|
|
|
'rtos/uC-OS3/Ports/POSIX/os_cpu_c.c',
|
|
|
|
'rtos/uC-CPU/Posix/cpu_c.c']
|
|
|
|
|
|
|
|
|
2020-12-27 14:43:02 +00:00
|
|
|
# GDx family display emulation
|
|
|
|
#linux_def = def + {'SCREEN_WIDTH': '128', 'SCREEN_HEIGHT': '64', 'PIX_FMT_BW': ''}
|
|
|
|
# MDx family display emulation
|
2020-10-31 09:11:07 +00:00
|
|
|
linux_def = def + {'SCREEN_WIDTH': '160', 'SCREEN_HEIGHT': '128', 'PIX_FMT_RGB565': ''}
|
2020-10-10 22:25:59 +00:00
|
|
|
|
|
|
|
linux_inc = inc + ['rtos/uC-OS3/Ports/POSIX',
|
2020-10-23 08:29:34 +00:00
|
|
|
'rtos/uC-CPU/Posix',
|
2020-11-17 14:44:06 +00:00
|
|
|
'platform/targets/linux',
|
|
|
|
'platform/targets/linux/emulator']
|
2020-10-10 22:25:59 +00:00
|
|
|
|
|
|
|
if not meson.is_cross_build()
|
|
|
|
sdl_dep = dependency('SDL2')
|
|
|
|
threads_dep = dependency('threads')
|
|
|
|
linux_dep = [sdl_dep, threads_dep]
|
|
|
|
else
|
|
|
|
linux_dep = []
|
|
|
|
endif
|
|
|
|
|
|
|
|
## TYT MD380
|
2021-02-02 10:18:22 +00:00
|
|
|
md380_src = src + stm32f405_src + ['platform/drivers/display/HX8353_MDx.c',
|
2020-11-19 17:24:28 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_MDx.c',
|
2020-12-24 18:00:00 +00:00
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
|
|
|
'platform/drivers/NVM/spiFlash_MDx.c',
|
2020-11-24 14:42:57 +00:00
|
|
|
'platform/drivers/NVM/nvmem_MD3x0.c',
|
2020-12-06 18:49:10 +00:00
|
|
|
'platform/drivers/ADC/ADC1_MDx.c',
|
2020-11-19 17:24:28 +00:00
|
|
|
'platform/drivers/tones/toneGenerator_MDx.c',
|
2021-01-30 13:53:47 +00:00
|
|
|
'platform/drivers/baseband/SKY72310.c',
|
2021-01-30 09:28:25 +00:00
|
|
|
'platform/drivers/baseband/radio_MD3x0.c',
|
2020-11-14 17:37:37 +00:00
|
|
|
'platform/drivers/baseband/HR-C5000_MD3x0.c',
|
2020-12-19 11:49:30 +00:00
|
|
|
'platform/targets/MD-380/platform.c']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2020-11-13 15:57:49 +00:00
|
|
|
md380_inc = inc + stm32f405_inc + ['platform/targets/MD-380']
|
2020-11-24 16:39:19 +00:00
|
|
|
md380_def = def + stm32f405_def + {'PLATFORM_MD380': ''}
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2020-11-13 15:57:49 +00:00
|
|
|
|
|
|
|
## TYT MD390
|
2021-02-02 10:18:22 +00:00
|
|
|
md390_src = src + stm32f405_src + ['platform/drivers/display/HX8353_MDx.c',
|
2020-11-19 17:24:28 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_MDx.c',
|
2020-12-24 18:00:00 +00:00
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
|
|
|
'platform/drivers/NVM/spiFlash_MDx.c',
|
2020-11-24 14:42:57 +00:00
|
|
|
'platform/drivers/NVM/nvmem_MD3x0.c',
|
2020-12-06 18:49:10 +00:00
|
|
|
'platform/drivers/ADC/ADC1_MDx.c',
|
2020-11-19 17:24:28 +00:00
|
|
|
'platform/drivers/tones/toneGenerator_MDx.c',
|
2021-01-30 13:53:47 +00:00
|
|
|
'platform/drivers/baseband/SKY72310.c',
|
2021-01-30 09:48:08 +00:00
|
|
|
'platform/drivers/baseband/radio_MD3x0.c',
|
2020-12-06 18:49:10 +00:00
|
|
|
'platform/drivers/baseband/HR-C5000_MD3x0.c',
|
2020-12-19 11:49:30 +00:00
|
|
|
'platform/targets/MD-390/platform.c']
|
2020-11-13 15:57:49 +00:00
|
|
|
|
|
|
|
md390_inc = inc + stm32f405_inc + ['platform/targets/MD-390']
|
2020-11-24 16:39:19 +00:00
|
|
|
md390_def = def + stm32f405_def + {'PLATFORM_MD390': ''}
|
2020-11-13 15:57:49 +00:00
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
|
2020-10-25 10:54:16 +00:00
|
|
|
## TYT MD-UV380
|
2021-02-02 10:18:22 +00:00
|
|
|
mduv380_src = src + stm32f405_src + ['platform/drivers/display/HX8353_MDx.c',
|
2020-11-19 17:24:28 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_MDx.c',
|
2020-12-24 18:00:00 +00:00
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
|
|
|
'platform/drivers/NVM/spiFlash_MDx.c',
|
2020-11-22 11:48:17 +00:00
|
|
|
'platform/drivers/NVM/nvmem_MDUV3x0.c',
|
2020-11-19 17:24:28 +00:00
|
|
|
'platform/drivers/ADC/ADC1_MDx.c',
|
2021-01-04 19:53:42 +00:00
|
|
|
'platform/drivers/tones/toneGenerator_MDx.c',
|
2021-01-30 09:48:08 +00:00
|
|
|
'platform/drivers/baseband/radio_UV3x0.c',
|
2020-12-19 11:49:30 +00:00
|
|
|
'platform/targets/MD-UV380/platform.c']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2020-11-13 15:57:49 +00:00
|
|
|
mduv380_inc = inc + stm32f405_inc + ['platform/targets/MD-UV380']
|
2020-11-24 16:39:19 +00:00
|
|
|
mduv380_def = def + stm32f405_def + {'PLATFORM_MDUV380': ''}
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2020-10-25 10:54:16 +00:00
|
|
|
|
2021-01-04 19:53:42 +00:00
|
|
|
## TYT MD-9600
|
|
|
|
md9600_src = src + stm32f405_src + ['platform/targets/MD-9600/platform.c',
|
|
|
|
'platform/drivers/tones/toneGenerator_MDx.c']
|
|
|
|
|
|
|
|
md9600_inc = inc + stm32f405_inc + ['platform/targets/MD-9600']
|
|
|
|
md9600_def = def + stm32f405_def + {'PLATFORM_MD9600': ''}
|
|
|
|
|
|
|
|
|
2021-02-01 14:55:45 +00:00
|
|
|
## Radioddity GD-77
|
|
|
|
gd77_src = src + mk22fn512_src + ['platform/targets/GD-77/platform.c',
|
2020-12-04 09:22:57 +00:00
|
|
|
'platform/drivers/display/UC1701_GD77.c',
|
2020-12-04 09:23:13 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_GD77.c',
|
2021-01-02 14:17:15 +00:00
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
|
|
|
'platform/drivers/NVM/AT24Cx_GDx.c',
|
|
|
|
'platform/drivers/NVM/spiFlash_GDx.c',
|
|
|
|
'platform/drivers/NVM/nvmem_GDx.c',
|
2020-12-22 14:29:32 +00:00
|
|
|
'platform/drivers/ADC/ADC0_GDx.c',
|
2021-01-30 10:44:24 +00:00
|
|
|
'platform/drivers/baseband/radio_GDx.c',
|
2021-01-23 18:30:36 +00:00
|
|
|
'platform/drivers/baseband/AT1846S.c',
|
|
|
|
'platform/drivers/baseband/HR_C6000.c',
|
|
|
|
'platform/drivers/baseband/interfaces_GDx.c']
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2021-02-01 14:55:45 +00:00
|
|
|
gd77_inc = inc + mk22fn512_inc + ['platform/targets/GD-77']
|
2020-12-01 08:40:50 +00:00
|
|
|
gd77_def = def + mk22fn512_def + {'PLATFORM_GD77': ''}
|
|
|
|
|
|
|
|
|
2020-12-20 14:14:50 +00:00
|
|
|
## Baofeng DM-1801
|
|
|
|
dm1801_src = src + mk22fn512_src + ['platform/targets/DM-1801/platform.c',
|
|
|
|
'platform/drivers/display/UC1701_GD77.c',
|
|
|
|
'platform/drivers/keyboard/keyboard_GD77.c',
|
2020-12-26 18:14:30 +00:00
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
2020-12-28 17:31:20 +00:00
|
|
|
'platform/drivers/NVM/AT24Cx_GDx.c',
|
2020-12-26 18:14:30 +00:00
|
|
|
'platform/drivers/NVM/spiFlash_GDx.c',
|
2020-12-29 16:18:16 +00:00
|
|
|
'platform/drivers/NVM/nvmem_GDx.c',
|
2020-12-22 14:29:32 +00:00
|
|
|
'platform/drivers/ADC/ADC0_GDx.c',
|
2021-01-30 10:44:24 +00:00
|
|
|
'platform/drivers/baseband/radio_GDx.c',
|
2021-01-17 09:18:10 +00:00
|
|
|
'platform/drivers/baseband/AT1846S.c',
|
2021-01-23 08:25:46 +00:00
|
|
|
'platform/drivers/baseband/HR_C6000.c',
|
2021-01-17 09:18:10 +00:00
|
|
|
'platform/drivers/baseband/interfaces_GDx.c']
|
2020-12-20 14:14:50 +00:00
|
|
|
|
|
|
|
dm1801_inc = inc + mk22fn512_inc + ['platform/targets/DM-1801']
|
|
|
|
dm1801_def = def + mk22fn512_def + {'PLATFORM_DM1801': ''}
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2020-10-10 22:25:59 +00:00
|
|
|
## Compilation defines
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2020-11-13 11:38:39 +00:00
|
|
|
linux_c_args = []
|
2020-11-17 14:44:06 +00:00
|
|
|
linux_l_args = ['--entry=entry']
|
2020-11-13 11:38:39 +00:00
|
|
|
|
|
|
|
# Add AddressSanitizer if required
|
|
|
|
if get_option('asan')
|
|
|
|
linux_c_args += '-fsanitize=address'
|
|
|
|
linux_l_args += '-fsanitize=address'
|
|
|
|
endif
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
foreach k, v : linux_def
|
2020-10-10 22:25:59 +00:00
|
|
|
if v == ''
|
2020-11-13 11:38:39 +00:00
|
|
|
linux_c_args += '-D@0@'.format(k)
|
2020-10-10 22:25:59 +00:00
|
|
|
else
|
2020-11-13 11:38:39 +00:00
|
|
|
linux_c_args += '-D@0@=@1@'.format(k, v)
|
2020-10-10 22:25:59 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
md380_args = []
|
|
|
|
foreach k, v : md380_def
|
|
|
|
if v == ''
|
|
|
|
md380_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
md380_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
2020-10-04 16:25:26 +00:00
|
|
|
endforeach
|
|
|
|
|
2020-11-13 15:57:49 +00:00
|
|
|
md390_args = []
|
|
|
|
foreach k, v : md390_def
|
|
|
|
if v == ''
|
|
|
|
md390_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
md390_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2020-10-25 10:54:16 +00:00
|
|
|
mduv380_args = []
|
|
|
|
foreach k, v : mduv380_def
|
|
|
|
if v == ''
|
|
|
|
mduv380_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
mduv380_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2021-01-02 11:08:58 +00:00
|
|
|
mduv380g_args = []
|
2021-01-03 07:25:37 +00:00
|
|
|
foreach k, v : mduv380_def
|
2021-01-02 11:08:58 +00:00
|
|
|
if v == ''
|
|
|
|
mduv380g_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
mduv380g_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2020-12-01 08:40:50 +00:00
|
|
|
gd77_args = []
|
|
|
|
foreach k, v : gd77_def
|
|
|
|
if v == ''
|
|
|
|
gd77_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
gd77_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2020-12-20 14:14:50 +00:00
|
|
|
dm1801_args = []
|
|
|
|
foreach k, v : dm1801_def
|
|
|
|
if v == ''
|
|
|
|
dm1801_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
dm1801_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
|
|
|
endforeach
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2021-01-01 17:32:05 +00:00
|
|
|
md9600_args = []
|
|
|
|
foreach k, v : md9600_def
|
|
|
|
if v == ''
|
|
|
|
md9600_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
md9600_args += '-D@0@=@1@'.format(k, v)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2020-10-21 19:42:36 +00:00
|
|
|
linux_opts = {'sources': linux_src,
|
2020-11-13 11:38:39 +00:00
|
|
|
'c_args': linux_c_args,
|
2020-10-21 19:42:36 +00:00
|
|
|
'include_directories': linux_inc,
|
2020-10-23 08:29:34 +00:00
|
|
|
'dependencies': linux_dep,
|
2020-11-13 11:38:39 +00:00
|
|
|
'link_args' : linux_l_args}
|
2020-10-10 22:25:59 +00:00
|
|
|
|
2020-10-21 19:42:36 +00:00
|
|
|
md380_opts = {'sources': md380_src,
|
|
|
|
'c_args': md380_args,
|
2020-11-27 11:23:59 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2020-10-21 19:42:36 +00:00
|
|
|
'include_directories': md380_inc}
|
2020-10-04 16:25:26 +00:00
|
|
|
|
2020-11-13 15:57:49 +00:00
|
|
|
md390_opts = {'sources': md390_src,
|
|
|
|
'c_args': md390_args,
|
2020-11-27 11:23:59 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2020-11-13 15:57:49 +00:00
|
|
|
'include_directories': md390_inc}
|
2020-10-25 10:54:16 +00:00
|
|
|
|
|
|
|
mduv380_opts = {'sources': mduv380_src,
|
2020-10-31 08:17:42 +00:00
|
|
|
'c_args': mduv380_args,
|
2020-11-27 11:23:59 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2020-10-31 08:17:42 +00:00
|
|
|
'include_directories': mduv380_inc}
|
2020-10-25 10:54:16 +00:00
|
|
|
|
2021-01-03 07:25:37 +00:00
|
|
|
mduv380g_opts = {'sources': mduv380_src,
|
2021-01-02 11:08:58 +00:00
|
|
|
'c_args': mduv380g_args,
|
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2021-01-03 07:25:37 +00:00
|
|
|
'include_directories': mduv380_inc}
|
2021-01-02 11:08:58 +00:00
|
|
|
|
2020-12-01 08:40:50 +00:00
|
|
|
gd77_opts = {'sources': gd77_src,
|
|
|
|
'c_args': gd77_args,
|
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/MK22FN512xxx12/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
|
|
|
'include_directories':gd77_inc}
|
|
|
|
|
2020-12-20 14:14:50 +00:00
|
|
|
dm1801_opts = {'sources': dm1801_src,
|
|
|
|
'c_args': dm1801_args,
|
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/MK22FN512xxx12/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
|
|
|
'include_directories':dm1801_inc}
|
|
|
|
|
2021-01-01 17:32:05 +00:00
|
|
|
md9600_opts = {'sources': md9600_src,
|
|
|
|
'c_args': md9600_args,
|
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
|
|
|
'include_directories': md9600_inc}
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2020-10-21 19:42:36 +00:00
|
|
|
## Targets
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2020-10-21 19:42:36 +00:00
|
|
|
targets = [
|
|
|
|
|
|
|
|
{'name': 'linux',
|
|
|
|
'opts': linux_opts,
|
|
|
|
'flashable': false},
|
|
|
|
|
|
|
|
{'name': 'md380',
|
|
|
|
'opts': md380_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'MD380',
|
|
|
|
'load_addr': '0x0800C000'},
|
|
|
|
|
|
|
|
{'name': 'md390',
|
2020-11-13 15:57:49 +00:00
|
|
|
'opts': md390_opts,
|
2020-10-21 19:42:36 +00:00
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'MD390',
|
|
|
|
'load_addr': '0x0800C000'},
|
|
|
|
|
2021-01-02 11:08:58 +00:00
|
|
|
{'name': 'mduv380',
|
2020-10-25 10:54:16 +00:00
|
|
|
'opts': mduv380_opts,
|
2020-10-21 19:42:36 +00:00
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'UV3X0',
|
|
|
|
'load_addr': '0x0800C000'},
|
2021-01-23 08:25:46 +00:00
|
|
|
|
2021-01-02 11:08:58 +00:00
|
|
|
{'name': 'mduv380g',
|
|
|
|
'opts': mduv380g_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'UV3X0',
|
|
|
|
'load_addr': '0x0800C000'},
|
2020-10-21 19:42:36 +00:00
|
|
|
|
2020-12-01 08:40:50 +00:00
|
|
|
{'name': 'gd77',
|
|
|
|
'opts': gd77_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'UV3X0',
|
|
|
|
'load_addr': '0x0800C000'},
|
2020-12-20 14:14:50 +00:00
|
|
|
|
|
|
|
{'name': 'dm1801',
|
|
|
|
'opts': dm1801_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'UV3X0',
|
|
|
|
'load_addr': '0x0800C000'},
|
2021-01-23 08:25:46 +00:00
|
|
|
|
2021-01-01 17:32:05 +00:00
|
|
|
{'name': 'md9600',
|
|
|
|
'opts': md9600_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'MD9600',
|
|
|
|
'load_addr': '0x0800C000'},
|
2020-10-21 19:42:36 +00:00
|
|
|
]
|
2020-10-19 13:02:18 +00:00
|
|
|
|
2020-10-22 19:55:54 +00:00
|
|
|
objcopy = find_program('objcopy', required:false, disabler:true)
|
|
|
|
radio_tool = find_program('radio_tool', required:false, disabler:true)
|
2021-01-01 18:08:35 +00:00
|
|
|
bin2sgl = find_program('bin2sgl.Linux', required:false, disabler:true)
|
|
|
|
gd77_loader = find_program('gd-77_firmware_loader.py', required:false, disabler:true)
|
2020-10-19 13:02:18 +00:00
|
|
|
|
2020-10-21 19:42:36 +00:00
|
|
|
foreach t : targets
|
|
|
|
|
|
|
|
name = 'openrtx_'+t['name']
|
|
|
|
exe = executable(name, kwargs:t['opts'])
|
|
|
|
|
|
|
|
if t['flashable']
|
|
|
|
|
2020-10-22 19:55:54 +00:00
|
|
|
bin = custom_target(name+'_bin',
|
|
|
|
output : name+'_bin',
|
|
|
|
input : exe,
|
|
|
|
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
2021-01-01 18:08:35 +00:00
|
|
|
# Handle GD77 custom wrapping and flashing tools
|
|
|
|
if name == 'openrtx_gd77'
|
|
|
|
|
|
|
|
wrap = custom_target(name+'_wrap',
|
|
|
|
output : name+'_wrap',
|
|
|
|
input : bin,
|
|
|
|
command : [bin2sgl,
|
|
|
|
'-f', '@INPUT@',
|
|
|
|
'&&', 'mv', '@INPUT@.sgl', '@OUTPUT@.sgl'])
|
|
|
|
|
|
|
|
custom_target(name+'_flash',
|
|
|
|
input : wrap,
|
|
|
|
output : name+'_flash',
|
|
|
|
command : [gd77_loader, '-f', '@INPUT@.sgl'])
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
wrap = custom_target(name+'_wrap',
|
|
|
|
output : name+'_wrap',
|
|
|
|
input : bin,
|
|
|
|
command : [radio_tool,
|
|
|
|
'--wrap',
|
|
|
|
'-o', '@OUTPUT@',
|
|
|
|
'-r', t['wrap'],
|
|
|
|
'-s', t['load_addr']+':@INPUT@'])
|
|
|
|
|
|
|
|
custom_target(name+'_flash',
|
|
|
|
input : wrap,
|
|
|
|
output : name+'_flash',
|
|
|
|
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2020-10-21 19:42:36 +00:00
|
|
|
endif
|
|
|
|
endforeach
|