2020-10-04 16:25:26 +00:00
|
|
|
##
|
|
|
|
## OpenRTX - Modular Open Source Radio Firmware
|
|
|
|
##
|
2021-03-10 15:32:40 +00:00
|
|
|
project('OpenRTX', ['c', 'cpp'],
|
2022-06-01 06:46:22 +00:00
|
|
|
version : '0.3.3',
|
2021-08-25 20:21:54 +00:00
|
|
|
default_options : ['warning_level=3', 'b_staticpic=false'])
|
2020-10-04 16:25:26 +00:00
|
|
|
|
2021-08-12 17:43:12 +00:00
|
|
|
##
|
|
|
|
## Optional defines, common to all souces (e.g. to enable debugging)
|
|
|
|
##
|
|
|
|
|
2022-03-05 08:42:44 +00:00
|
|
|
def = {}
|
2021-08-12 17:43:12 +00:00
|
|
|
|
2022-08-14 19:58:27 +00:00
|
|
|
##
|
|
|
|
## UI font configuration, only one uncommented at a time
|
|
|
|
##
|
|
|
|
|
|
|
|
def += {'FONT_UBUNTU_REGULAR': ''}
|
|
|
|
# def += {'FONT_FREE_SANS': ''}
|
|
|
|
|
2022-08-12 07:30:26 +00:00
|
|
|
##
|
|
|
|
## Firmware configuration parameters
|
|
|
|
##
|
|
|
|
|
|
|
|
# Send an M17 EOT frame at the end of transmission
|
|
|
|
#def += {'M17_ENABLE_EOT' : ''}
|
|
|
|
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
## ----------------- Platform-independent source files -------------------------
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
## OpenRTX sources
|
|
|
|
##
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2022-03-05 09:39:35 +00:00
|
|
|
openrtx_src = ['openrtx/src/core/state.c',
|
|
|
|
'openrtx/src/core/threads.c',
|
|
|
|
'openrtx/src/core/battery.c',
|
2022-07-18 19:30:43 +00:00
|
|
|
'openrtx/src/core/graphics.c',
|
2022-03-05 09:39:35 +00:00
|
|
|
'openrtx/src/core/input.c',
|
2022-03-26 15:42:02 +00:00
|
|
|
'openrtx/src/core/utils.c',
|
2022-03-05 09:39:35 +00:00
|
|
|
'openrtx/src/core/queue.c',
|
|
|
|
'openrtx/src/core/chan.c',
|
|
|
|
'openrtx/src/core/gps.c',
|
|
|
|
'openrtx/src/core/dsp.cpp',
|
|
|
|
'openrtx/src/core/cps.c',
|
2022-03-05 10:08:31 +00:00
|
|
|
'openrtx/src/core/crc.c',
|
2022-06-16 07:13:36 +00:00
|
|
|
'openrtx/src/core/datetime.c',
|
2022-05-30 19:58:38 +00:00
|
|
|
'openrtx/src/core/openrtx.c',
|
2022-04-01 07:21:27 +00:00
|
|
|
'openrtx/src/core/audio_codec.c',
|
2022-03-24 14:16:38 +00:00
|
|
|
'openrtx/src/core/data_conversion.c',
|
2022-03-05 09:39:35 +00:00
|
|
|
'openrtx/src/core/memory_profiling.cpp',
|
2022-05-09 12:23:37 +00:00
|
|
|
'openrtx/src/core/voicePrompts.c',
|
|
|
|
'openrtx/src/core/voicePromptUtils.c',
|
2022-08-18 06:34:01 +00:00
|
|
|
'openrtx/src/core/voicePromptData.S',
|
2021-01-10 08:04:53 +00:00
|
|
|
'openrtx/src/ui/ui.c',
|
2022-08-16 07:21:32 +00:00
|
|
|
'openrtx/src/ui/ui_strings.c',
|
2021-01-10 08:04:53 +00:00
|
|
|
'openrtx/src/ui/ui_main.c',
|
|
|
|
'openrtx/src/ui/ui_menu.c',
|
2021-04-30 20:13:11 +00:00
|
|
|
'openrtx/src/rtx/rtx.cpp',
|
|
|
|
'openrtx/src/rtx/OpMode_FM.cpp',
|
2021-08-23 17:14:40 +00:00
|
|
|
'openrtx/src/rtx/OpMode_M17.cpp',
|
2021-11-08 09:28:11 +00:00
|
|
|
'openrtx/src/protocols/M17/M17DSP.cpp',
|
2022-05-26 19:49:54 +00:00
|
|
|
'openrtx/src/protocols/M17/M17Golay.cpp',
|
2021-08-22 08:20:57 +00:00
|
|
|
'openrtx/src/protocols/M17/M17Callsign.cpp',
|
2021-08-23 17:14:40 +00:00
|
|
|
'openrtx/src/protocols/M17/M17Modulator.cpp',
|
2021-12-22 20:00:55 +00:00
|
|
|
'openrtx/src/protocols/M17/M17Demodulator.cpp',
|
2022-01-06 11:17:27 +00:00
|
|
|
'openrtx/src/protocols/M17/M17FrameEncoder.cpp',
|
2022-01-05 13:12:23 +00:00
|
|
|
'openrtx/src/protocols/M17/M17FrameDecoder.cpp',
|
2021-08-22 08:20:57 +00:00
|
|
|
'openrtx/src/protocols/M17/M17LinkSetupFrame.cpp']
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2020-12-24 15:24:35 +00:00
|
|
|
openrtx_inc = ['openrtx/include',
|
2021-04-30 20:13:11 +00:00
|
|
|
'openrtx/include/rtx',
|
2022-03-05 09:39:35 +00:00
|
|
|
'openrtx/include/core',
|
|
|
|
'openrtx/include/calibration',
|
2021-08-22 08:20:57 +00:00
|
|
|
'openrtx/include/protocols',
|
2022-03-05 09:39:35 +00:00
|
|
|
'openrtx/include/fonts/adafruit',
|
2020-11-13 13:31:21 +00:00
|
|
|
'platform/drivers/ADC',
|
2020-11-21 17:25:25 +00:00
|
|
|
'platform/drivers/NVM',
|
2021-02-04 08:57:43 +00:00
|
|
|
'platform/drivers/GPS',
|
2022-02-26 11:29:28 +00:00
|
|
|
'platform/drivers/USB',
|
2020-11-17 13:30:20 +00:00
|
|
|
'platform/drivers/tones',
|
2021-04-10 12:12:15 +00:00
|
|
|
'platform/drivers/baseband',
|
|
|
|
'platform/drivers/backlight',
|
2022-03-05 09:39:35 +00:00
|
|
|
'platform/drivers/chSelector']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2021-11-03 17:58:05 +00:00
|
|
|
main_src = []
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
# Add to sources either the main executable or a platform test
|
|
|
|
if get_option('test') != ''
|
2021-11-03 17:58:05 +00:00
|
|
|
main_src += 'tests/platform/'+get_option('test')+'.c'
|
2022-03-05 08:09:25 +00:00
|
|
|
def += {'RUNNING_TESTSUITE' : ''}
|
2021-04-10 09:56:41 +00:00
|
|
|
else
|
2021-11-03 17:58:05 +00:00
|
|
|
main_src += 'openrtx/src/main.c'
|
2021-04-10 09:56:41 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
##
|
|
|
|
## External libraries
|
|
|
|
##
|
|
|
|
|
|
|
|
# minmea, a lightweight GPS NMEA 0183 parser library
|
|
|
|
minmea_src = ['lib/minmea/minmea.c']
|
|
|
|
minmea_inc = ['lib/minmea/include']
|
|
|
|
|
|
|
|
# QDEC, a very simple, header only, quadrature decoding library
|
|
|
|
qdec_inc = ['lib/qdec/include']
|
|
|
|
|
2021-08-25 20:21:54 +00:00
|
|
|
# CODEC2, open source speech codec
|
2021-10-06 17:35:46 +00:00
|
|
|
# Compile from sources only when targeting a platform different from x86/x64
|
|
|
|
if meson.is_cross_build()
|
|
|
|
codec2_proj = subproject('codec2')
|
|
|
|
codec2_dep = codec2_proj.get_variable('codec2_dep')
|
|
|
|
else
|
|
|
|
codec2_dep = dependency('codec2')
|
|
|
|
endif
|
|
|
|
|
2022-08-25 07:08:30 +00:00
|
|
|
src = openrtx_src + main_src + minmea_src
|
|
|
|
inc = openrtx_inc + minmea_inc + qdec_inc
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-10-31 08:17:42 +00:00
|
|
|
## RTOS
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2022-08-25 07:08:30 +00:00
|
|
|
subdir('lib/miosix-kernel')
|
2022-07-18 16:04:52 +00:00
|
|
|
|
|
|
|
# Include RTOS only for embedded targets
|
|
|
|
if meson.is_cross_build()
|
2022-08-25 07:08:30 +00:00
|
|
|
inc = inc + miosix_cm4f_inc
|
|
|
|
src = src + miosix_cm4f_src
|
|
|
|
def = def + miosix_cm4f_def
|
2022-07-18 16:04:52 +00:00
|
|
|
endif
|
2021-02-03 21:51:44 +00:00
|
|
|
|
2021-04-11 07:56:46 +00:00
|
|
|
## Add git commit or tag to print in OpenRTX
|
|
|
|
r = run_command('git', 'describe', '--tags', '--dirty')
|
|
|
|
if r.returncode() != 0
|
|
|
|
# it failed
|
|
|
|
endif
|
|
|
|
git_version = '"'+r.stdout().strip()+'"'
|
|
|
|
def = def + {'GIT_VERSION': git_version}
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
## --------------------- Family-dependent source files -------------------------
|
|
|
|
##
|
2021-04-02 12:45:32 +00:00
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
## TYT MDx family
|
|
|
|
##
|
2021-04-02 12:45:32 +00:00
|
|
|
|
2022-03-22 14:10:52 +00:00
|
|
|
mdx_src = ['openrtx/src/core/xmodem.c',
|
|
|
|
'openrtx/src/core/backup.c',
|
|
|
|
'platform/drivers/ADC/ADC1_MDx.c',
|
2021-04-10 09:56:41 +00:00
|
|
|
'platform/drivers/GPS/GPS_MDx.cpp',
|
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
2021-11-08 21:22:26 +00:00
|
|
|
'platform/drivers/NVM/nvmem_settings_MDx.c',
|
2021-04-12 17:10:13 +00:00
|
|
|
'platform/drivers/audio/audio_MDx.c',
|
2021-08-25 16:34:29 +00:00
|
|
|
'platform/drivers/audio/inputStream_MDx.cpp',
|
2022-03-24 14:16:38 +00:00
|
|
|
'platform/drivers/audio/outputStream_MDx.cpp',
|
2021-04-30 20:13:11 +00:00
|
|
|
'platform/drivers/baseband/HR_Cx000.cpp',
|
2021-04-10 12:12:15 +00:00
|
|
|
'platform/drivers/backlight/backlight_MDx.c',
|
2022-10-19 12:40:44 +00:00
|
|
|
'platform/drivers/tones/toneGenerator_MDx.cpp']
|
2020-10-04 16:25:26 +00:00
|
|
|
|
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
## GDx family: Radioddity GD-77 and Baofeng DM-1801
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
|
2022-03-22 14:10:52 +00:00
|
|
|
gdx_src = ['openrtx/src/core/xmodem.c',
|
|
|
|
'openrtx/src/core/backup.c',
|
|
|
|
'platform/drivers/NVM/W25Qx.c',
|
2021-04-10 09:56:41 +00:00
|
|
|
'platform/drivers/NVM/AT24Cx_GDx.c',
|
|
|
|
'platform/drivers/NVM/spiFlash_GDx.c',
|
|
|
|
'platform/drivers/NVM/nvmem_GDx.c',
|
2022-03-29 16:31:39 +00:00
|
|
|
'platform/drivers/CPS/cps_io_native_GDx.c',
|
2021-04-10 09:56:41 +00:00
|
|
|
'platform/drivers/ADC/ADC0_GDx.c',
|
2021-04-10 12:12:15 +00:00
|
|
|
'platform/drivers/backlight/backlight_GDx.c',
|
2021-05-22 10:11:30 +00:00
|
|
|
'platform/drivers/baseband/radio_GDx.cpp',
|
|
|
|
'platform/drivers/baseband/HR_Cx000.cpp',
|
|
|
|
'platform/drivers/baseband/AT1846S_GDx.cpp',
|
|
|
|
'platform/drivers/baseband/HR_C6000_GDx.cpp',
|
2021-04-10 10:00:36 +00:00
|
|
|
'platform/drivers/display/UC1701_GDx.c',
|
2021-04-12 17:10:13 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_GDx.c',
|
2021-10-06 19:43:07 +00:00
|
|
|
'platform/drivers/audio/audio_GDx.c',
|
2022-04-03 16:17:09 +00:00
|
|
|
'platform/drivers/audio/inputStream_GDx.c',
|
|
|
|
'platform/drivers/audio/outputStream_GDx.c']
|
2020-10-04 16:25:26 +00:00
|
|
|
|
2020-10-31 08:17:42 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
## --------------------- MCU-dependent source files ----------------------------
|
2020-10-31 08:17:42 +00:00
|
|
|
##
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-10-31 08:17:42 +00:00
|
|
|
## STM32F405
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2021-03-10 15:32:40 +00:00
|
|
|
stm32f405_src = ['platform/mcu/STM32F4xx/boot/startup.cpp',
|
|
|
|
'platform/mcu/STM32F4xx/boot/bsp.cpp',
|
|
|
|
'platform/mcu/STM32F4xx/boot/libc_integration.cpp',
|
2020-10-31 08:17:42 +00:00
|
|
|
'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',
|
2021-03-10 15:32:40 +00:00
|
|
|
'platform/mcu/STM32F4xx/drivers/delays.cpp',
|
2020-10-31 08:17:42 +00:00
|
|
|
'platform/mcu/STM32F4xx/drivers/rtc.c',
|
2021-03-28 08:50:10 +00:00
|
|
|
'platform/mcu/STM32F4xx/drivers/SPI2.c',
|
2021-07-07 20:36:36 +00:00
|
|
|
'platform/mcu/STM32F4xx/drivers/USART3.cpp',
|
2021-11-09 18:28:23 +00:00
|
|
|
'platform/mcu/STM32F4xx/drivers/flash.c',
|
2021-03-10 15:32:40 +00:00
|
|
|
'platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
|
|
|
stm32f405_inc = ['platform/mcu/CMSIS/Include',
|
|
|
|
'platform/mcu/CMSIS/Device/ST/STM32F4xx/Include',
|
|
|
|
'platform/mcu/STM32F4xx',
|
|
|
|
'platform/mcu/STM32F4xx/drivers',
|
2021-03-10 15:32:40 +00:00
|
|
|
'platform/mcu/STM32F4xx/drivers/usb']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2022-08-25 07:08:30 +00:00
|
|
|
stm32f405_def = {'STM32F405xx': '', 'HSE_VALUE':'8000000'}
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-12-01 08:40:50 +00:00
|
|
|
## MK22FN512
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2021-03-10 15:32:40 +00:00
|
|
|
mk22fn512_src = ['platform/mcu/MK22FN512xxx12/boot/startup.cpp',
|
|
|
|
'platform/mcu/MK22FN512xxx12/boot/bsp.cpp',
|
|
|
|
'platform/mcu/MK22FN512xxx12/boot/libc_integration.cpp',
|
2020-12-01 08:40:50 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/gpio.c',
|
2021-03-10 15:32:40 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/delays.cpp',
|
2020-12-28 11:43:27 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/I2C0.c',
|
2021-03-12 13:15:27 +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',
|
|
|
|
'platform/mcu/MK22FN512xxx12/drivers/usb_vcom.c',
|
2021-03-10 15:32:40 +00:00
|
|
|
'platform/mcu/CMSIS/Device/NXP/MK22FN512xxx12/Source/system_MK22F51212.c']
|
2020-12-01 08:40:50 +00:00
|
|
|
|
|
|
|
mk22fn512_inc = ['platform/mcu/CMSIS/Include',
|
|
|
|
'platform/mcu/CMSIS/Device/NXP/MK22FN512xxx12/Include',
|
2022-08-25 07:08:30 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12',
|
2021-03-10 15:32:40 +00:00
|
|
|
'platform/mcu/MK22FN512xxx12/drivers']
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2022-08-25 07:08:30 +00:00
|
|
|
mk22fn512_def = {}
|
2020-12-01 08:40:50 +00:00
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
## ----------------------- Platform specializations ----------------------------
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-10-10 22:25:59 +00:00
|
|
|
## Linux
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2021-11-03 17:58:05 +00:00
|
|
|
linux_platform_src = ['platform/targets/linux/emulator/emulator.c',
|
2021-12-05 09:00:01 +00:00
|
|
|
'platform/targets/linux/emulator/sdl_engine.c',
|
2021-11-03 17:58:05 +00:00
|
|
|
'platform/drivers/display/display_libSDL.c',
|
|
|
|
'platform/drivers/keyboard/keyboard_linux.c',
|
|
|
|
'platform/drivers/NVM/nvmem_linux.c',
|
|
|
|
'platform/drivers/GPS/GPS_linux.c',
|
|
|
|
'platform/mcu/x86_64/drivers/gpio.c',
|
|
|
|
'platform/mcu/x86_64/drivers/delays.c',
|
|
|
|
'platform/mcu/x86_64/drivers/rtc.c',
|
|
|
|
'platform/drivers/baseband/radio_linux.cpp',
|
2022-06-02 23:36:32 +00:00
|
|
|
'platform/drivers/audio/audio_linux.cpp',
|
|
|
|
'platform/drivers/audio/inputStream_linux.cpp',
|
2022-04-05 16:25:29 +00:00
|
|
|
'platform/drivers/audio/outputStream_linux.c',
|
2022-03-29 16:31:39 +00:00
|
|
|
'platform/targets/linux/platform.c',
|
2022-07-01 13:01:58 +00:00
|
|
|
'platform/drivers/CPS/cps_io_libc.c']
|
2022-03-29 16:31:39 +00:00
|
|
|
|
2021-11-03 17:58:05 +00:00
|
|
|
linux_src = src + linux_platform_src
|
2020-10-10 22:25:59 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2022-08-18 06:34:01 +00:00
|
|
|
linux_def += {'VP_USE_FILESYSTEM':''}
|
|
|
|
linux_inc = inc + ['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')
|
2022-06-28 20:49:52 +00:00
|
|
|
pulse_dep = dependency('libpulse')
|
|
|
|
linux_dep = [sdl_dep, threads_dep, pulse_dep, codec2_dep]
|
2020-10-10 22:25:59 +00:00
|
|
|
else
|
2021-10-06 17:35:46 +00:00
|
|
|
linux_dep = [ ]
|
2020-10-10 22:25:59 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2021-02-03 14:09:59 +00:00
|
|
|
## TYT MD-3x0 family
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
md3x0_src = src + mdx_src + stm32f405_src + ['platform/drivers/NVM/nvmem_MD3x0.c',
|
2022-03-29 16:31:39 +00:00
|
|
|
'platform/drivers/CPS/cps_io_native_MD3x0.c',
|
2021-04-10 10:37:45 +00:00
|
|
|
'platform/drivers/NVM/spiFlash_MD3x.c',
|
2021-04-10 09:56:41 +00:00
|
|
|
'platform/drivers/baseband/SKY72310.c',
|
2021-04-30 20:13:11 +00:00
|
|
|
'platform/drivers/baseband/radio_MD3x0.cpp',
|
|
|
|
'platform/drivers/baseband/HR_C5000_MDx.cpp',
|
2021-04-10 10:37:45 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_MD3x.c',
|
|
|
|
'platform/drivers/display/HX8353_MD3x.cpp',
|
2021-04-10 09:56:41 +00:00
|
|
|
'platform/targets/MD-3x0/platform.c']
|
2020-11-13 15:57:49 +00:00
|
|
|
|
2021-02-03 14:09:59 +00:00
|
|
|
md3x0_inc = inc + stm32f405_inc + ['platform/targets/MD-3x0']
|
2021-04-10 09:56:41 +00:00
|
|
|
md3x0_def = def + stm32f405_def + {'PLATFORM_MD3x0': '', 'timegm': 'mktime'}
|
2020-10-04 16:25:26 +00:00
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-10-25 10:54:16 +00:00
|
|
|
## TYT MD-UV380
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
mduv3x0_src = src + mdx_src + stm32f405_src + ['platform/drivers/NVM/nvmem_MDUV3x0.c',
|
2021-04-10 10:37:45 +00:00
|
|
|
'platform/drivers/NVM/spiFlash_MD3x.c',
|
2022-03-29 16:31:39 +00:00
|
|
|
'platform/drivers/CPS/cps_io_native_MDUV3x0.c',
|
2021-04-10 09:56:41 +00:00
|
|
|
'platform/targets/MD-UV3x0/platform.c',
|
2021-04-10 10:37:45 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_MD3x.c',
|
|
|
|
'platform/drivers/display/HX8353_MD3x.cpp',
|
2021-04-10 17:29:35 +00:00
|
|
|
'platform/drivers/chSelector/chSelector_UV3x0.c',
|
2021-05-03 07:42:41 +00:00
|
|
|
'platform/drivers/baseband/radio_UV3x0.cpp',
|
|
|
|
'platform/drivers/baseband/AT1846S_UV3x0.cpp',
|
|
|
|
'platform/drivers/baseband/HR_C6000_UV3x0.cpp']
|
2020-10-31 08:17:42 +00:00
|
|
|
|
2021-04-01 06:48:56 +00:00
|
|
|
mduv3x0_inc = inc + stm32f405_inc + ['platform/targets/MD-UV3x0']
|
2021-04-10 09:56:41 +00:00
|
|
|
mduv3x0_def = def + stm32f405_def + {'PLATFORM_MDUV3x0': '', 'timegm': 'mktime'}
|
2020-10-25 10:54:16 +00:00
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2021-01-04 19:53:42 +00:00
|
|
|
## TYT MD-9600
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2021-04-10 10:37:45 +00:00
|
|
|
md9600_src = src + mdx_src + stm32f405_src + ['platform/targets/MD-9600/platform.c',
|
|
|
|
'platform/drivers/display/ST7567_MD9600.c',
|
|
|
|
'platform/drivers/keyboard/keyboard_MD9600.c',
|
2021-04-10 17:29:35 +00:00
|
|
|
'platform/drivers/chSelector/chSelector_MD9600.c',
|
2021-05-24 12:32:35 +00:00
|
|
|
'platform/drivers/baseband/radio_MD9600.cpp',
|
2021-04-10 10:37:45 +00:00
|
|
|
'platform/drivers/NVM/nvmem_MD9600.c',
|
2022-03-29 16:31:39 +00:00
|
|
|
'platform/drivers/NVM/spiFlash_MD9600.c',
|
|
|
|
'platform/drivers/CPS/cps_io_native_MD9600.c']
|
2021-01-04 19:53:42 +00:00
|
|
|
|
|
|
|
md9600_inc = inc + stm32f405_inc + ['platform/targets/MD-9600']
|
|
|
|
md9600_def = def + stm32f405_def + {'PLATFORM_MD9600': ''}
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2021-02-01 14:55:45 +00:00
|
|
|
## Radioddity GD-77
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
gd77_src = src + gdx_src + mk22fn512_src + ['platform/targets/GD-77/platform.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': ''}
|
|
|
|
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
2020-12-20 14:14:50 +00:00
|
|
|
## Baofeng DM-1801
|
2021-04-10 09:56:41 +00:00
|
|
|
##
|
|
|
|
dm1801_src = src + gdx_src + mk22fn512_src + ['platform/targets/DM-1801/platform.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': ''}
|
|
|
|
|
2021-09-19 20:26:35 +00:00
|
|
|
##
|
|
|
|
## Module 17
|
|
|
|
##
|
|
|
|
mod17_src = src + stm32f405_src + ['platform/targets/Module17/platform.c',
|
2021-11-27 07:55:58 +00:00
|
|
|
'platform/drivers/display/SH110x_Mod17.c',
|
2021-12-23 13:14:09 +00:00
|
|
|
'platform/drivers/ADC/ADC1_Mod17.c',
|
2021-09-23 18:50:47 +00:00
|
|
|
'platform/drivers/keyboard/keyboard_Mod17.c',
|
|
|
|
'platform/drivers/NVM/nvmem_Mod17.c',
|
2022-03-29 16:31:39 +00:00
|
|
|
'platform/drivers/CPS/cps_io_native_Mod17.c',
|
2021-09-19 20:26:35 +00:00
|
|
|
'platform/drivers/baseband/radio_Mod17.cpp',
|
2021-09-25 17:28:50 +00:00
|
|
|
'platform/drivers/audio/inputStream_Mod17.cpp',
|
2022-03-24 16:31:13 +00:00
|
|
|
'platform/drivers/audio/outputStream_Mod17.cpp',
|
2021-12-23 13:14:09 +00:00
|
|
|
'platform/drivers/audio/audio_Mod17.c',
|
|
|
|
'platform/drivers/baseband/MCP4551_Mod17.cpp']
|
2021-09-19 20:26:35 +00:00
|
|
|
|
|
|
|
mod17_inc = inc + stm32f405_inc + ['platform/targets/Module17']
|
|
|
|
mod17_def = def + stm32f405_def + {'PLATFORM_MOD17': ''}
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
## -------------------------- Compilation arguments ----------------------------
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
|
2021-08-23 17:18:29 +00:00
|
|
|
linux_c_args = ['-DPLATFORM_LINUX']
|
|
|
|
linux_cpp_args = ['-std=c++14', '-DPLATFORM_LINUX']
|
2022-06-28 20:49:52 +00:00
|
|
|
linux_l_args = ['-lm', '-lreadline', '-lpulse-simple']
|
2020-11-13 11:38:39 +00:00
|
|
|
|
|
|
|
# Add AddressSanitizer if required
|
|
|
|
if get_option('asan')
|
|
|
|
linux_c_args += '-fsanitize=address'
|
2022-01-20 11:54:34 +00:00
|
|
|
linux_cpp_args += '-fsanitize=address'
|
2020-11-13 11:38:39 +00:00
|
|
|
linux_l_args += '-fsanitize=address'
|
|
|
|
endif
|
2021-02-17 08:52:36 +00:00
|
|
|
# Add Undefined Behaviour Sanitizer if required
|
|
|
|
if get_option('ubsan')
|
|
|
|
linux_c_args += '-fsanitize=undefined'
|
2022-01-20 11:54:34 +00:00
|
|
|
linux_cpp_args += '-fsanitize=undefined'
|
2021-02-17 08:52:36 +00:00
|
|
|
linux_l_args += '-fsanitize=undefined'
|
|
|
|
endif
|
2020-11-13 11:38:39 +00:00
|
|
|
|
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)
|
2022-01-20 11:54:34 +00:00
|
|
|
linux_cpp_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)
|
2022-01-20 11:54:34 +00:00
|
|
|
linux_cpp_args += '-D@0@=@1@'.format(k, v)
|
2020-10-10 22:25:59 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2021-02-03 14:09:59 +00:00
|
|
|
md3x0_args = []
|
|
|
|
foreach k, v : md3x0_def
|
2020-11-13 15:57:49 +00:00
|
|
|
if v == ''
|
2021-02-03 14:09:59 +00:00
|
|
|
md3x0_args += '-D@0@'.format(k)
|
2020-11-13 15:57:49 +00:00
|
|
|
else
|
2021-02-03 14:09:59 +00:00
|
|
|
md3x0_args += '-D@0@=@1@'.format(k, v)
|
2020-11-13 15:57:49 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2021-03-21 17:26:53 +00:00
|
|
|
mduv3x0_args = []
|
|
|
|
foreach k, v : mduv3x0_def
|
2020-10-25 10:54:16 +00:00
|
|
|
if v == ''
|
2021-03-21 17:26:53 +00:00
|
|
|
mduv3x0_args += '-D@0@'.format(k)
|
2020-10-25 10:54:16 +00:00
|
|
|
else
|
2021-03-21 17:26:53 +00:00
|
|
|
mduv3x0_args += '-D@0@=@1@'.format(k, v)
|
2020-10-25 10:54:16 +00:00
|
|
|
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
|
|
|
|
|
2021-09-19 20:26:35 +00:00
|
|
|
mod17_args = []
|
|
|
|
foreach k, v : mod17_def
|
|
|
|
if v == ''
|
|
|
|
mod17_args += '-D@0@'.format(k)
|
|
|
|
else
|
|
|
|
mod17_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,
|
2021-08-23 17:18:29 +00:00
|
|
|
'cpp_args' : linux_cpp_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
|
|
|
|
2021-03-10 15:32:40 +00:00
|
|
|
md3x0_opts = {'sources' : md3x0_src,
|
|
|
|
'c_args' : md3x0_args,
|
|
|
|
'cpp_args': md3x0_args,
|
2021-09-19 20:26:35 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script_MDx.ld',
|
2020-11-27 11:23:59 +00:00
|
|
|
'-Wl,--print-memory-usage'],
|
2022-10-19 12:40:44 +00:00
|
|
|
'dependencies': [codec2_dep],
|
2021-02-03 14:09:59 +00:00
|
|
|
'include_directories': md3x0_inc}
|
2020-10-25 10:54:16 +00:00
|
|
|
|
2021-03-21 17:26:53 +00:00
|
|
|
mduv3x0_opts = {'sources': mduv3x0_src,
|
|
|
|
'c_args': mduv3x0_args,
|
|
|
|
'cpp_args': mduv3x0_args,
|
2021-09-19 20:26:35 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script_MDx.ld',
|
2020-11-27 11:23:59 +00:00
|
|
|
'-Wl,--print-memory-usage'],
|
2022-10-19 12:40:44 +00:00
|
|
|
'dependencies': [codec2_dep],
|
2021-03-21 17:26:53 +00:00
|
|
|
'include_directories': mduv3x0_inc}
|
2020-10-25 10:54:16 +00:00
|
|
|
|
2020-12-01 08:40:50 +00:00
|
|
|
gd77_opts = {'sources': gd77_src,
|
|
|
|
'c_args': gd77_args,
|
2021-03-10 15:32:40 +00:00
|
|
|
'cpp_args': gd77_args,
|
2020-12-01 08:40:50 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/MK22FN512xxx12/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2021-10-06 19:43:07 +00:00
|
|
|
'dependencies': [codec2_dep],
|
2020-12-01 08:40:50 +00:00
|
|
|
'include_directories':gd77_inc}
|
|
|
|
|
2020-12-20 14:14:50 +00:00
|
|
|
dm1801_opts = {'sources': dm1801_src,
|
|
|
|
'c_args': dm1801_args,
|
2021-03-10 15:32:40 +00:00
|
|
|
'cpp_args': dm1801_args,
|
2020-12-20 14:14:50 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/MK22FN512xxx12/linker_script.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2021-10-06 19:43:07 +00:00
|
|
|
'dependencies': [codec2_dep],
|
2020-12-20 14:14:50 +00:00
|
|
|
'include_directories':dm1801_inc}
|
|
|
|
|
2021-01-01 17:32:05 +00:00
|
|
|
md9600_opts = {'sources': md9600_src,
|
|
|
|
'c_args': md9600_args,
|
2021-03-10 15:32:40 +00:00
|
|
|
'cpp_args': md9600_args,
|
2021-09-19 20:26:35 +00:00
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script_MDx.ld',
|
2021-01-01 17:32:05 +00:00
|
|
|
'-Wl,--print-memory-usage'],
|
2022-10-19 12:40:44 +00:00
|
|
|
'dependencies': [codec2_dep],
|
2021-01-01 17:32:05 +00:00
|
|
|
'include_directories': md9600_inc}
|
|
|
|
|
2021-09-19 20:26:35 +00:00
|
|
|
mod17_opts = {'sources': mod17_src,
|
|
|
|
'c_args': mod17_args,
|
|
|
|
'cpp_args': mod17_args,
|
|
|
|
'link_args' : ['-Wl,-T../platform/mcu/STM32F4xx/linker_script_Mod17.ld',
|
|
|
|
'-Wl,--print-memory-usage'],
|
2022-10-19 12:40:44 +00:00
|
|
|
'dependencies': [codec2_dep],
|
2021-09-19 20:26:35 +00:00
|
|
|
'include_directories': mod17_inc}
|
|
|
|
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
## ---------------------------- Compilation targets ----------------------------
|
2020-10-04 16:25:26 +00:00
|
|
|
##
|
2021-04-10 09:56:41 +00:00
|
|
|
|
2020-10-21 19:42:36 +00:00
|
|
|
targets = [
|
|
|
|
|
|
|
|
{'name': 'linux',
|
|
|
|
'opts': linux_opts,
|
|
|
|
'flashable': false},
|
|
|
|
|
2021-02-03 14:09:59 +00:00
|
|
|
{'name': 'md3x0',
|
|
|
|
'opts': md3x0_opts,
|
2020-10-21 19:42:36 +00:00
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'MD380',
|
|
|
|
'load_addr': '0x0800C000'},
|
|
|
|
|
2021-03-21 17:26:53 +00:00
|
|
|
{'name': 'mduv3x0',
|
|
|
|
'opts': mduv3x0_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-03-21 08:20:46 +00:00
|
|
|
{'name': 'gd77',
|
2020-12-01 08:40:50 +00:00
|
|
|
'opts': gd77_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': 'UV3X0',
|
|
|
|
'load_addr': '0x0800C000'},
|
2020-12-20 14:14:50 +00:00
|
|
|
|
2021-03-21 08:20:46 +00:00
|
|
|
{'name': 'dm1801',
|
2020-12-20 14:14:50 +00:00
|
|
|
'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'},
|
2021-09-19 20:26:35 +00:00
|
|
|
|
|
|
|
{'name': 'mod17',
|
|
|
|
'opts': mod17_opts,
|
|
|
|
'flashable': true,
|
|
|
|
'wrap': ' ',
|
|
|
|
'load_addr': ' '},
|
2020-10-21 19:42:36 +00:00
|
|
|
]
|
2020-10-19 13:02:18 +00:00
|
|
|
|
2021-08-26 06:15:56 +00:00
|
|
|
radio_tool = find_program('radio_tool')
|
2021-04-10 09:56:41 +00:00
|
|
|
objcopy = find_program('objcopy', required:false, disabler:true)
|
2022-05-02 20:31:49 +00:00
|
|
|
if build_machine.system() == 'linux'
|
|
|
|
bin2sgl = find_program('scripts/bin2sgl.Linux', required:false, disabler:true)
|
|
|
|
elif build_machine.system() == 'windows'
|
|
|
|
bin2sgl = find_program('scripts/bin2sgl.exe', required:false, disabler:true)
|
|
|
|
endif
|
2021-03-24 11:09:03 +00:00
|
|
|
gd77_loader = find_program('scripts/gd-77_firmware_loader.py', required:false, disabler:true)
|
2021-12-28 20:41:24 +00:00
|
|
|
dfu_util = find_program('dfu-util', 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']
|
2022-06-17 10:44:38 +00:00
|
|
|
exe = executable(name, kwargs:t['opts'])
|
2020-10-21 19:42:36 +00:00
|
|
|
|
|
|
|
if t['flashable']
|
|
|
|
|
2020-10-22 19:55:54 +00:00
|
|
|
bin = custom_target(name+'_bin',
|
2022-06-17 10:44:38 +00:00
|
|
|
output : name+'_bin',
|
|
|
|
input : exe,
|
|
|
|
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
|
2020-10-22 19:55:54 +00:00
|
|
|
|
2021-01-01 18:08:35 +00:00
|
|
|
# Handle GD77 custom wrapping and flashing tools
|
|
|
|
if name == 'openrtx_gd77'
|
|
|
|
|
2022-06-17 10:44:38 +00:00
|
|
|
if build_machine.system() == 'linux'
|
|
|
|
wrap = custom_target(name+'_wrap',
|
|
|
|
output : name+'_wrap.sgl',
|
|
|
|
input : bin,
|
|
|
|
command : [bin2sgl, '-f', '@INPUT@', '&&',
|
|
|
|
'mv', '@INPUT@.sgl', '@OUTPUT@'])
|
|
|
|
elif build_machine.system() == 'windows'
|
|
|
|
wrap = custom_target(name+'_wrap',
|
|
|
|
output : name+'_bin.sgl',
|
|
|
|
input : bin,
|
|
|
|
command : [bin2sgl, '@INPUT@'])
|
|
|
|
endif
|
|
|
|
|
|
|
|
custom_target(name+'_flash',
|
|
|
|
input : wrap,
|
|
|
|
output : name+'_flash',
|
|
|
|
command : [gd77_loader, '-f', '@INPUT@'])
|
|
|
|
|
|
|
|
# Handle DM1801 custom wrapping and flashing tools
|
|
|
|
elif name == 'openrtx_dm1801'
|
|
|
|
|
|
|
|
if build_machine.system() == 'linux'
|
|
|
|
wrap = custom_target(name+'_wrap',
|
|
|
|
output : name+'_wrap.sgl',
|
|
|
|
input : bin,
|
|
|
|
command : [bin2sgl, '-f', '@INPUT@',
|
|
|
|
'-m', 'DM-1801', '&&', 'mv',
|
|
|
|
'@INPUT@.sgl', '@OUTPUT@'])
|
|
|
|
elif build_machine.system() == 'windows'
|
|
|
|
wrap = custom_target(name+'_wrap',
|
|
|
|
output : name+'_bin.sgl',
|
|
|
|
input : bin,
|
|
|
|
command : [bin2sgl, '@INPUT@', '-m DM-1801'])
|
|
|
|
endif
|
2021-01-01 18:08:35 +00:00
|
|
|
|
|
|
|
custom_target(name+'_flash',
|
2022-06-17 10:44:38 +00:00
|
|
|
input : wrap,
|
|
|
|
output : name+'_flash',
|
|
|
|
command : [gd77_loader, '-f', '@INPUT@', '-m', 'DM-1801',])
|
2021-01-01 18:08:35 +00:00
|
|
|
|
2021-12-28 20:41:24 +00:00
|
|
|
# Module17 also uses dfu-tool for flashing
|
|
|
|
elif name == 'openrtx_mod17'
|
2022-09-26 12:34:43 +00:00
|
|
|
|
|
|
|
# Wrap target for Module17 for consistency, same output as bin target
|
|
|
|
custom_target(name+'_wrap',
|
|
|
|
output : name+'_wrap',
|
|
|
|
input : exe,
|
|
|
|
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
|
|
|
|
|
2021-12-28 20:41:24 +00:00
|
|
|
|
|
|
|
custom_target(name+'_flash',
|
2022-06-17 10:44:38 +00:00
|
|
|
input : bin,
|
|
|
|
output : name+'_flash',
|
|
|
|
command : [dfu_util, '-d', '0483:df11', '-a', '0',
|
|
|
|
'-D', '@INPUT@', '-s', '0x08000000'])
|
2021-12-28 20:41:24 +00:00
|
|
|
|
2021-01-01 18:08:35 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
wrap = custom_target(name+'_wrap',
|
2022-06-17 10:44:38 +00:00
|
|
|
output : name+'_wrap',
|
|
|
|
input : bin,
|
|
|
|
command : [radio_tool,
|
|
|
|
'--wrap',
|
|
|
|
'-o', '@OUTPUT@',
|
|
|
|
'-r', t['wrap'],
|
|
|
|
'-s', t['load_addr']+':@INPUT@'])
|
2021-01-01 18:08:35 +00:00
|
|
|
|
|
|
|
custom_target(name+'_flash',
|
2022-06-17 10:44:38 +00:00
|
|
|
input : wrap,
|
|
|
|
output : name+'_flash',
|
|
|
|
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
|
2021-01-01 18:08:35 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2020-10-21 19:42:36 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
2021-11-02 18:42:16 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
## ----------------------------------- Unit Tests ------------------------------
|
|
|
|
##
|
|
|
|
|
2021-12-13 20:33:46 +00:00
|
|
|
unit_test_opts = {'c_args' : linux_c_args,
|
|
|
|
'cpp_args' : linux_cpp_args,
|
2021-11-03 17:58:05 +00:00
|
|
|
'include_directories': linux_inc,
|
2021-12-13 20:33:46 +00:00
|
|
|
'dependencies' : linux_dep,
|
|
|
|
'link_args' : linux_l_args}
|
2021-11-03 17:58:05 +00:00
|
|
|
unit_test_src = openrtx_src + minmea_src + linux_platform_src
|
|
|
|
|
2021-11-02 19:20:54 +00:00
|
|
|
m17_golay_test = executable('m17_golay_test',
|
2021-12-13 20:33:46 +00:00
|
|
|
sources : unit_test_src + ['tests/unit/M17_golay.cpp'],
|
|
|
|
kwargs : unit_test_opts)
|
|
|
|
|
|
|
|
m17_viterbi_test = executable('m17_viterbi_test',
|
|
|
|
sources : unit_test_src + ['tests/unit/M17_viterbi.cpp'],
|
|
|
|
kwargs : unit_test_opts)
|
|
|
|
|
2021-12-22 20:00:55 +00:00
|
|
|
m17_demodulator_test = executable('m17_demodulator_test',
|
|
|
|
sources: unit_test_src + ['tests/unit/M17_demodulator.cpp'],
|
|
|
|
kwargs: unit_test_opts)
|
|
|
|
|
|
|
|
m17_rrc_test = executable('m17_rrc_test',
|
|
|
|
sources: unit_test_src + ['tests/unit/M17_rrc.cpp'],
|
|
|
|
kwargs: unit_test_opts)
|
|
|
|
|
2022-03-29 16:31:39 +00:00
|
|
|
cps_test = executable('cps_test',
|
|
|
|
sources : unit_test_src + ['tests/unit/cps.c'],
|
|
|
|
kwargs : unit_test_opts)
|
|
|
|
|
2022-06-02 23:36:32 +00:00
|
|
|
linux_inputStream_test = executable('linux_inputStream_test',
|
|
|
|
sources : unit_test_src + ['tests/unit/linux_inputStream_test.cpp'],
|
|
|
|
kwargs : unit_test_opts)
|
|
|
|
|
2022-06-28 20:49:52 +00:00
|
|
|
sine_test = executable('sine_test',
|
|
|
|
sources : unit_test_src + ['tests/unit/play_sine.c'],
|
|
|
|
kwargs : unit_test_opts)
|
|
|
|
|
2022-07-23 21:35:29 +00:00
|
|
|
vp_test = executable('vp_test',
|
|
|
|
sources : unit_test_src + ['tests/unit/voice_prompts.c'],
|
|
|
|
kwargs : unit_test_opts)
|
|
|
|
|
2021-12-13 20:33:46 +00:00
|
|
|
test('M17 Golay Unit Test', m17_golay_test)
|
|
|
|
test('M17 Viterbi Unit Test', m17_viterbi_test)
|
2022-03-29 16:31:39 +00:00
|
|
|
test('M17 Demodulator Test', m17_demodulator_test)
|
|
|
|
test('M17 RRC Test', m17_rrc_test)
|
|
|
|
test('Codeplug Test', cps_test)
|
2022-06-02 23:36:32 +00:00
|
|
|
test('Linux InputStream Test', linux_inputStream_test)
|
2022-07-23 21:35:29 +00:00
|
|
|
test('Sine Test', sine_test)
|
|
|
|
test('Voice Prompts Test', vp_test)
|