mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 23:05:12 +03:00
split up the cmakelist by target (#3661)
* split up the cmakelist by target * new target for the flysky-i6 * organization per @bsongis suggestion
This commit is contained in:
parent
0ad015f3e7
commit
e25db7e9e0
18 changed files with 1621 additions and 645 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,3 +10,4 @@ radio/src/bootloader/bootloader_ramBoot*
|
||||||
*.stamp
|
*.stamp
|
||||||
radio/src/lua/lua_fields_*.txt
|
radio/src/lua/lua_fields_*.txt
|
||||||
radio/src/lua/lua_exports_*.txt
|
radio/src/lua/lua_exports_*.txt
|
||||||
|
build-*/
|
||||||
|
|
24
build_all.sh
Executable file
24
build_all.sh
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -o nounset # exit if trying to use an uninitialized var
|
||||||
|
#set -o errexit # exit if any program fails
|
||||||
|
set -o pipefail # exit if any program in a pipeline fails, also
|
||||||
|
set -x # debug mode
|
||||||
|
|
||||||
|
TARGETS=(
|
||||||
|
9X
|
||||||
|
GRUVIN9X
|
||||||
|
HORUS
|
||||||
|
I6
|
||||||
|
MEGA2560
|
||||||
|
SKY9X
|
||||||
|
TARANIS
|
||||||
|
)
|
||||||
|
for target in "${TARGETS[@]}"
|
||||||
|
do
|
||||||
|
echo building $target
|
||||||
|
mkdir build-${target}
|
||||||
|
pushd build-${target}
|
||||||
|
cmake -DPCB=${target} -DGVARS=YES -DLUA=YES -DDEBUG=YES -DCMAKE_BUILD_TYPE=Debug ../
|
||||||
|
make
|
||||||
|
popd
|
||||||
|
done
|
|
@ -65,253 +65,13 @@ set(FATFS_SRC
|
||||||
)
|
)
|
||||||
|
|
||||||
if(PCB STREQUAL HORUS)
|
if(PCB STREQUAL HORUS)
|
||||||
set(CPU_TYPE STM32F4)
|
include(targets/horus/CMakeLists.txt)
|
||||||
set(HSE_VALUE 12000000)
|
|
||||||
set(SDCARD YES)
|
|
||||||
set(EEPROM SDCARD)
|
|
||||||
set(HAPTIC YES)
|
|
||||||
set(GUI_DIR horus)
|
|
||||||
set(TARGET_DIR horus)
|
|
||||||
set(LINKER_SCRIPT targets/horus/stm32f4_flash.ld)
|
|
||||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} horus_bitmaps)
|
|
||||||
set(LUA_EXPORT lua_export_horus)
|
|
||||||
set(FLAVOUR horus)
|
|
||||||
set(VIRTUAL_INPUTS YES)
|
|
||||||
set(RAMBACKUP YES)
|
|
||||||
option(DISK_CACHE "Enable SD card disk cache" YES)
|
|
||||||
add_definitions(-DPCBHORUS -DCOLORLCD -DSTM32F429_439xx -DPPM_PIN_UART -DPPM_PIN_TIMER)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
|
||||||
add_definitions(-DLUAINPUTS -DXCURVES -DVARIO)
|
|
||||||
include_directories(${RADIO_SRC_DIRECTORY}/fonts/horus gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
|
|
||||||
file(GLOB THEMES_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/horus ${RADIO_SRC_DIRECTORY}/gui/horus/themes/*.cpp)
|
|
||||||
file(GLOB LAYOUTS_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/horus ${RADIO_SRC_DIRECTORY}/gui/horus/layouts/*.cpp)
|
|
||||||
file(GLOB WIDGETS_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/horus ${RADIO_SRC_DIRECTORY}/gui/horus/widgets/*.cpp)
|
|
||||||
set(GUI_SRC
|
|
||||||
${GUI_SRC}
|
|
||||||
bitmapbuffer.cpp
|
|
||||||
curves.cpp
|
|
||||||
bitmaps.cpp
|
|
||||||
menu_general_hardware.cpp
|
|
||||||
menu_model_inputs.cpp
|
|
||||||
menu_model_mixes.cpp
|
|
||||||
view_channels.cpp
|
|
||||||
view_logical_switches.cpp
|
|
||||||
view_about.cpp
|
|
||||||
view_text.cpp
|
|
||||||
screens_setup.cpp
|
|
||||||
theme.cpp
|
|
||||||
topbar.cpp
|
|
||||||
layout.cpp
|
|
||||||
widget.cpp
|
|
||||||
${THEMES_SRC}
|
|
||||||
${LAYOUTS_SRC}
|
|
||||||
${WIDGETS_SRC}
|
|
||||||
)
|
|
||||||
set(SRC ${SRC} targets/taranis/rtc_driver.cpp)
|
|
||||||
if(DISK_CACHE)
|
|
||||||
set(SRC ${SRC} disk_cache.cpp)
|
|
||||||
add_definitions(-DDISK_CACHE)
|
|
||||||
endif()
|
|
||||||
set(TARGET_SRC
|
|
||||||
${TARGET_SRC}
|
|
||||||
board_horus.cpp
|
|
||||||
extmodule_driver.cpp
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
sdio_sd.c
|
|
||||||
lcd_driver.cpp
|
|
||||||
delays.c
|
|
||||||
usb_driver.c
|
|
||||||
pwr_driver.cpp
|
|
||||||
sdram_driver.c
|
|
||||||
led_driver.cpp
|
|
||||||
startup_stm32f40_41xxx.s
|
|
||||||
)
|
|
||||||
set(STM32LIB_SRC
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_ltdc.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma2d.c
|
|
||||||
)
|
|
||||||
add_custom_target(datacopy
|
|
||||||
WORKING_DIRECTORY ${RADIO_DIRECTORY}/src
|
|
||||||
COMMAND python ${RADIO_DIRECTORY}/util/generate_datacopy.py datastructs.h -DPCBHORUS -DCPUARM -DCOLORLCD -DVIRTUALINPUTS -DBACKUP > storage/datacopy.cpp
|
|
||||||
DEPENDS ${RADIO_DIRECTORY}/src/datastructs.h ${RADIO_DIRECTORY}/util/generate_datacopy.py
|
|
||||||
)
|
|
||||||
elseif(PCB STREQUAL TARANIS)
|
elseif(PCB STREQUAL TARANIS)
|
||||||
option(PCBREV "PCB Revision" REVPLUS)
|
include(targets/taranis/CMakeLists.txt)
|
||||||
option(SHUTDOWN_CONFIRMATION "Shutdown confirmation" OFF)
|
|
||||||
option(LCD_DUAL_BUFFER "Dual LCD Buffer" OFF)
|
|
||||||
option(TARANIS_INTERNAL_PPM "Taranis internal module hack to output PPM" OFF)
|
|
||||||
if(PCBREV STREQUAL REV9E)
|
|
||||||
option(STICKS "Sticks type" STANDARD)
|
|
||||||
set(CPU_TYPE STM32F4)
|
|
||||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
|
||||||
set(HAPTIC YES)
|
|
||||||
set(LUA_EXPORT lua_export_taranis_x9e)
|
|
||||||
set(FLAVOUR taranisx9e)
|
|
||||||
add_definitions(-DSTM32F40_41xxx -DREVPLUS -DREV9E)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=32768)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
top_lcd_driver.cpp
|
|
||||||
bluetooth_driver.cpp
|
|
||||||
startup_stm32f40_41xxx.s
|
|
||||||
)
|
|
||||||
if(STICKS STREQUAL HORUS)
|
|
||||||
add_definitions(-DHORUS_STICKS)
|
|
||||||
endif()
|
|
||||||
elseif(PCBREV STREQUAL REVPLUS)
|
|
||||||
set(CPU_TYPE STM32F2)
|
|
||||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
|
||||||
set(HAPTIC YES)
|
|
||||||
set(LUA_EXPORT lua_export_taranis)
|
|
||||||
set(FLAVOUR taranisplus)
|
|
||||||
add_definitions(-DREVPLUS)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=0)
|
|
||||||
else()
|
|
||||||
set(CPU_TYPE STM32F2)
|
|
||||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
|
||||||
set(HAPTIC NO)
|
|
||||||
set(LUA_EXPORT lua_export_taranis)
|
|
||||||
set(FLAVOUR taranis)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=0)
|
|
||||||
endif()
|
|
||||||
set(HSE_VALUE 12000000)
|
|
||||||
set(SDCARD YES)
|
|
||||||
set(EEPROM EEPROM_RLC)
|
|
||||||
set(GUI_DIR taranis)
|
|
||||||
set(TARGET_DIR taranis)
|
|
||||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} taranis_bitmaps)
|
|
||||||
set(VIRTUAL_INPUTS YES)
|
|
||||||
add_definitions(-DPCBTARANIS -DPPM_PIN_TIMER)
|
|
||||||
add_definitions(-DAUDIO -DVOICE -DRTCLOCK)
|
|
||||||
add_definitions(-DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DVARIO)
|
|
||||||
set(GUI_SRC ${GUI_SRC} bmp.cpp menu_model_inputs.cpp menu_model_mixes.cpp menu_model_display.cpp menu_general_diagkeys.cpp menu_general_diaganas.cpp menu_general_hardware.cpp view_channels.cpp view_telemetry.cpp view_text.cpp view_about.cpp)
|
|
||||||
set(TARGET_SRC
|
|
||||||
${TARGET_SRC}
|
|
||||||
board_taranis.cpp
|
|
||||||
extmodule_driver.cpp
|
|
||||||
rtc_driver.cpp
|
|
||||||
)
|
|
||||||
set(FIRMWARE_SRC
|
|
||||||
${FIRMWARE_SRC}
|
|
||||||
loadboot.cpp
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
lcd_driver.cpp
|
|
||||||
delays.c
|
|
||||||
i2c_driver.cpp
|
|
||||||
usb_driver.c
|
|
||||||
pwr_driver.c
|
|
||||||
configure_pins.cpp
|
|
||||||
flash_driver.cpp
|
|
||||||
aspi.c
|
|
||||||
)
|
|
||||||
if(LCD_DUAL_BUFFER)
|
|
||||||
add_definitions(-DLCD_DUAL_BUFFER)
|
|
||||||
endif()
|
|
||||||
if(TARANIS_INTERNAL_PPM)
|
|
||||||
add_definitions(-DTARANIS_INTERNAL_PPM)
|
|
||||||
endif()
|
|
||||||
if(MIXERS_MONITOR)
|
|
||||||
add_definitions(-DMIXERS_MONITOR)
|
|
||||||
endif()
|
|
||||||
elseif(PCB STREQUAL SKY9X OR PCB STREQUAL 9XRPRO OR PCB STREQUAL AR9X)
|
elseif(PCB STREQUAL SKY9X OR PCB STREQUAL 9XRPRO OR PCB STREQUAL AR9X)
|
||||||
set(ARCH ARM)
|
include(targets/sky9x/CMakeLists.txt)
|
||||||
set(LUA NO)
|
|
||||||
if(PCB STREQUAL 9XRPRO)
|
|
||||||
add_definitions(-Dat91sam3s8 -DREVX)
|
|
||||||
set(FLAVOUR 9xrpro)
|
|
||||||
set(LINKER_SCRIPT targets/sky9x/sam3s8c_flash.ld)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} rtc_driver.cpp)
|
|
||||||
set(BOOTLOADER bootflash8.lbm)
|
|
||||||
elseif(PCB STREQUAL AR9X)
|
|
||||||
add_definitions(-Dat91sam3s8 -DAR9X -DSOFTWARE_VOLUME)
|
|
||||||
set(FLAVOUR ar9x)
|
|
||||||
include_directories(${THIRDPARTY_DIR}/xdk-asf-3.31.0/sam/drivers/twi)
|
|
||||||
set(SRC ${SRC} ${THIRDPARTY_DIR}/xdk-asf-3.31.0/sam/drivers/twi/twi.c)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} i2c_driver.cpp rtc_ds3231_driver.cpp)
|
|
||||||
set(LINKER_SCRIPT targets/sky9x/sam3s8c_flash.ld)
|
|
||||||
set(BOOTLOADER bootflash8.lbm)
|
|
||||||
else()
|
|
||||||
set(FLAVOUR sky9x)
|
|
||||||
option(PCBREV "PCB Revision" REVC)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} coproc_driver.cpp rotenc_driver.cpp rtc_driver.cpp)
|
|
||||||
add_definitions(-DROTARY_ENCODERS=1)
|
|
||||||
set(BOOTLOADER bootflash4.lbm)
|
|
||||||
if(PCBREV STREQUAL REVA)
|
|
||||||
add_definitions(-DDREVA)
|
|
||||||
set(LINKER_SCRIPT targets/sky9x/sam3s2c_flash.ld)
|
|
||||||
elseif(PCBREV STREQUAL REVB)
|
|
||||||
add_definitions(-DDREVB -DCOPROCESSOR)
|
|
||||||
set(LINKER_SCRIPT targets/sky9x/sam3s4c_flash.ld)
|
|
||||||
else()
|
|
||||||
add_definitions(-DDREVC -DCOPROCESSOR)
|
|
||||||
set(LINKER_SCRIPT targets/sky9x/sam3s4c_flash.ld)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set(MCU cortex-m3)
|
|
||||||
set(SDCARD YES)
|
|
||||||
set(HAPTIC YES)
|
|
||||||
set(EEPROM EEPROM_RAW)
|
|
||||||
set(GUI_DIR 9x)
|
|
||||||
set(TARGET_DIR sky9x)
|
|
||||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
|
||||||
add_definitions(-DPCBSKY9X -DPPM_PIN_SERIAL)
|
|
||||||
add_definitions(-DAUDIO -DVOICE -DRTCLOCK -DVARIO)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=0)
|
|
||||||
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC} menu_general_hardware.cpp view_telemetry.cpp view_text.cpp view_about.cpp)
|
|
||||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} core_cm3.c board_lowlevel.c crt.c vectors_sam3s.c)
|
|
||||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} lcd_driver.cpp pwr_driver.cpp
|
|
||||||
usb/device/core/USBD_UDP.c usb/device/core/USBDDriver.c
|
|
||||||
usb/device/massstorage/MSDDriver.c usb/device/massstorage/MSDDStateMachine.c usb/device/massstorage/MSDLun.c
|
|
||||||
usb/device/massstorage/MSDDriverDescriptors.c usb/device/massstorage/SBCMethods.c usb/common/core/USBEndpointDescriptor.c
|
|
||||||
usb/common/core/USBGenericRequest.c usb/common/core/USBFeatureRequest.c usb/common/core/USBInterfaceRequest.c
|
|
||||||
usb/common/core/USBGetDescriptorRequest.c usb/common/core/USBSetAddressRequest.c usb/common/core/USBSetConfigurationRequest.c
|
|
||||||
usb/common/core/USBConfigurationDescriptor.c usb/common/core/USBGenericDescriptor.c MEDSdcard.c
|
|
||||||
)
|
|
||||||
set(TARGET_SRC
|
|
||||||
${TARGET_SRC}
|
|
||||||
board_sky9x.cpp
|
|
||||||
telemetry_driver.cpp
|
|
||||||
serial2_driver.cpp
|
|
||||||
adc_driver.cpp
|
|
||||||
eeprom_driver.cpp
|
|
||||||
pulses_driver.cpp
|
|
||||||
keys_driver.cpp
|
|
||||||
audio_driver.cpp
|
|
||||||
buzzer_driver.cpp
|
|
||||||
haptic_driver.cpp
|
|
||||||
sdcard_driver.cpp
|
|
||||||
massstorage.cpp
|
|
||||||
)
|
|
||||||
set(SRC ${SRC} debug.cpp)
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} loadboot.cpp)
|
|
||||||
elseif(PCB STREQUAL 9X OR PCB STREQUAL 9XR OR PCB STREQUAL 9X128 OR PCB STREQUAL 9XR128)
|
elseif(PCB STREQUAL 9X OR PCB STREQUAL 9XR OR PCB STREQUAL 9X128 OR PCB STREQUAL 9XR128)
|
||||||
option(SP22 "SmartieParts 2.2 Backlight support" OFF)
|
include(targets/9x/CMakeLists.txt)
|
||||||
option(PWM_BACKLIGHT "PWM Backlight" OFF)
|
|
||||||
set(ARCH AVR)
|
|
||||||
set(MCU atmega64)
|
|
||||||
string(TOLOWER ${PCB} FLAVOUR)
|
|
||||||
set(EEPROM_VARIANT_NEEDED ON)
|
|
||||||
set(EEPROM EEPROM_RLC)
|
|
||||||
set(GUI_DIR 9x)
|
|
||||||
set(TARGET_DIR 9x)
|
|
||||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
|
||||||
add_definitions(-DPCBSTD -DPCB${PCB} -DCPUM64)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} board_stock.cpp)
|
|
||||||
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC})
|
|
||||||
if(SP22)
|
|
||||||
add_definitions(-DSP22)
|
|
||||||
endif()
|
|
||||||
if(PWM_BACKLIGHT)
|
|
||||||
add_definitions(-DPWM_BACKLIGHT)
|
|
||||||
endif()
|
|
||||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} lcd_driver.cpp)
|
|
||||||
elseif(PCB STREQUAL 9X2561)
|
elseif(PCB STREQUAL 9X2561)
|
||||||
set(ARCH AVR)
|
set(ARCH AVR)
|
||||||
set(MCU atmega2561)
|
set(MCU atmega2561)
|
||||||
|
@ -332,36 +92,11 @@ elseif(PCB STREQUAL 9X2561)
|
||||||
endif()
|
endif()
|
||||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} lcd_driver.cpp)
|
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} lcd_driver.cpp)
|
||||||
elseif(PCB STREQUAL GRUVIN9X)
|
elseif(PCB STREQUAL GRUVIN9X)
|
||||||
set(ARCH AVR)
|
include(targets/gruvin9x/CMakeLists.txt)
|
||||||
set(MCU atmega2560)
|
|
||||||
string(TOLOWER ${PCB} FLAVOUR)
|
|
||||||
set(EEPROM EEPROM_RLC)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=0)
|
|
||||||
set(GUI_DIR 9x)
|
|
||||||
set(TARGET_DIR gruvin9x)
|
|
||||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
|
||||||
add_definitions(-DPCB${PCB} -DCPUM2560 -DROTARY_ENCODERS=2)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} board_gruvin9x.cpp)
|
|
||||||
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC})
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/9x/lcd_driver.cpp)
|
|
||||||
elseif(PCB STREQUAL MEGA2560)
|
elseif(PCB STREQUAL MEGA2560)
|
||||||
option(PWRMANAGE "Pwr Manage" OFF)
|
include(targets/mega2560/CMakeLists.txt)
|
||||||
option(SDCARD "SD card support" ON)
|
elseif(PCB STREQUAL I6)
|
||||||
set(ARCH AVR)
|
include(targets/i6/CMakeLists.txt)
|
||||||
set(MCU atmega2560)
|
|
||||||
string(TOLOWER ${PCB} FLAVOUR)
|
|
||||||
set(EEPROM EEPROM_RLC)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=0)
|
|
||||||
set(GUI_DIR 9x)
|
|
||||||
set(TARGET_DIR mega2560)
|
|
||||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
|
||||||
add_definitions(-DPCB${PCB} -DCPUM2560 -DROTARY_ENCODERS=2)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} board_mega2560.cpp)
|
|
||||||
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC})
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/9x/lcd_driver.cpp)
|
|
||||||
if(PWRMANAGE)
|
|
||||||
add_definitions(-DPWRMANAGE)
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unknown PCB '${PCB}'")
|
message(FATAL_ERROR "Unknown PCB '${PCB}'")
|
||||||
endif()
|
endif()
|
||||||
|
@ -374,388 +109,21 @@ if(NOT PCB STREQUAL 9XR AND NOT PCB STREQUAL 9XRPRO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CPU_TYPE STREQUAL STM32F4)
|
if(CPU_TYPE STREQUAL STM32F4)
|
||||||
set(CPU_FAMILY STM32)
|
include(common/arm/stm32/f4/CMakeLists.txt)
|
||||||
set(MCU cortex-m4)
|
|
||||||
set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries)
|
|
||||||
include_directories(${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/inc)
|
|
||||||
include_directories(${STM32LIB_DIR}/CMSIS/Device/ST/STM32F4xx/Include)
|
|
||||||
include_directories(${STM32LIB_DIR}/CMSIS/include)
|
|
||||||
add_definitions(-DSTM32F4)
|
|
||||||
set(STM32LIB_SRC
|
|
||||||
${STM32LIB_SRC}
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/misc.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} system_stm32f4xx.c)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CPU_TYPE STREQUAL STM32F2)
|
if(CPU_TYPE STREQUAL STM32F2)
|
||||||
set(CPU_FAMILY STM32)
|
include(common/arm/stm32/f2/CMakeLists.txt)
|
||||||
set(MCU cortex-m3)
|
|
||||||
set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries)
|
|
||||||
include_directories(${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/inc)
|
|
||||||
include_directories(${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Include)
|
|
||||||
include_directories(${STM32LIB_DIR}/CMSIS/include)
|
|
||||||
set(STM32LIB_SRC
|
|
||||||
${STM32LIB_SRC}
|
|
||||||
CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/misc.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c
|
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} system_stm32f2xx.c)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CPU_FAMILY STREQUAL STM32)
|
if(CPU_FAMILY STREQUAL STM32)
|
||||||
set(LUA "NO" CACHE STRING "Lua scripts (YES/NO/NO_MODEL_SCRIPTS)")
|
include(common/arm/stm32/CMakeLists.txt)
|
||||||
set(USB "JOYSTICK" CACHE STRING "USB option (JOYSTICK/MASSSTORAGE/SERIAL)")
|
|
||||||
set(ARCH ARM)
|
|
||||||
set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.1.0/Libraries)
|
|
||||||
add_definitions(-DCPUSTM32)
|
|
||||||
add_definitions(-DSBUS -DCROSSFIRE)
|
|
||||||
include_directories(${STM32USB_DIR}/STM32_USB_OTG_Driver/inc)
|
|
||||||
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc)
|
|
||||||
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/inc)
|
|
||||||
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/hid/inc)
|
|
||||||
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/cdc/inc)
|
|
||||||
set(STM32USB_SRC
|
|
||||||
STM32_USB_OTG_Driver/src/usb_core.c
|
|
||||||
STM32_USB_OTG_Driver/src/usb_dcd.c
|
|
||||||
STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
|
||||||
STM32_USB_Device_Library/Core/src/usbd_core.c
|
|
||||||
STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
|
||||||
STM32_USB_Device_Library/Core/src/usbd_req.c
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
usb_bsp.c
|
|
||||||
usbd_desc.c
|
|
||||||
usbd_usr.cpp
|
|
||||||
)
|
|
||||||
if(USB STREQUAL SERIAL)
|
|
||||||
add_definitions(-DUSB_SERIAL)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
usbd_cdc.cpp
|
|
||||||
)
|
|
||||||
set(STM32USB_SRC
|
|
||||||
${STM32USB_SRC}
|
|
||||||
STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c
|
|
||||||
)
|
|
||||||
elseif(USB STREQUAL MASSSTORAGE)
|
|
||||||
add_definitions(-DUSB_MASS_STORAGE)
|
|
||||||
set(STM32USB_SRC
|
|
||||||
${STM32USB_SRC}
|
|
||||||
STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
|
||||||
STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
|
||||||
STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
|
||||||
STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
usbd_storage_msd.cpp
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
add_definitions(-DUSB_JOYSTICK)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
usbd_hid_joystick.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(GVARS)
|
|
||||||
set(GUI_SRC
|
|
||||||
${GUI_SRC}
|
|
||||||
menu_model_gvars.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
set(FIRMWARE_SRC
|
|
||||||
${FIRMWARE_SRC}
|
|
||||||
serial.cpp
|
|
||||||
syscalls.c
|
|
||||||
)
|
|
||||||
foreach(FILE ${STM32LIB_SRC})
|
|
||||||
set(FIRMWARE_SRC
|
|
||||||
${FIRMWARE_SRC}
|
|
||||||
${STM32LIB_DIR}/${FILE}
|
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
foreach(FILE ${STM32USB_SRC})
|
|
||||||
set(FIRMWARE_SRC
|
|
||||||
${FIRMWARE_SRC}
|
|
||||||
${STM32USB_DIR}/${FILE}
|
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
set(SRC
|
|
||||||
${SRC}
|
|
||||||
sbus.cpp
|
|
||||||
telemetry/crossfire.cpp
|
|
||||||
)
|
|
||||||
set(PULSES_SRC
|
|
||||||
${PULSES_SRC}
|
|
||||||
crossfire.cpp
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ARCH STREQUAL ARM)
|
if(ARCH STREQUAL ARM)
|
||||||
option(TIMERS "Timers count" 2)
|
include(common/arm/CMakeLists.txt)
|
||||||
option(CLI "Command Line Interface" OFF)
|
|
||||||
option(DEBUG "Debug mode" OFF)
|
|
||||||
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
|
|
||||||
option(TRACE_SD_CARD "Traces SD enabled" OFF)
|
|
||||||
option(TRACE_FATFS "Traces FatFS enabled" OFF)
|
|
||||||
option(TRACE_AUDIO "Traces audio enabled" OFF)
|
|
||||||
option(DEBUG_TRACE_BUFFER "Debug Trace Screen" OFF)
|
|
||||||
option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" OFF)
|
|
||||||
option(SUPPORT_D16_EU_ONLY "XJT module only supports D16-EU and LR12-EU" OFF) # TODO rename to XJT_EU_ONLY
|
|
||||||
option(DEBUG_INTERRUPTS "Count interrupts" OFF)
|
|
||||||
option(DEBUG_TASKS "Task switching statistics" OFF)
|
|
||||||
option(DEBUG_TIMERS "Time critical parts of the code" OFF)
|
|
||||||
|
|
||||||
if(TIMERS EQUAL 3)
|
|
||||||
add_definitions(-DTIMERS=3)
|
|
||||||
else()
|
|
||||||
add_definitions(-DTIMERS=2)
|
|
||||||
endif()
|
|
||||||
if(LOG_TELEMETRY)
|
|
||||||
add_definitions(-DLOG_TELEMETRY)
|
|
||||||
endif()
|
|
||||||
if(TRACE_SD_CARD)
|
|
||||||
add_definitions(-DTRACE_SD_CARD)
|
|
||||||
set(DEBUG ON)
|
|
||||||
set(DEBUG_TRACE_BUFFER ON)
|
|
||||||
endif()
|
|
||||||
if(TRACE_FATFS)
|
|
||||||
add_definitions(-DTRACE_FATFS)
|
|
||||||
set(DEBUG ON)
|
|
||||||
set(DEBUG_TRACE_BUFFER ON)
|
|
||||||
endif()
|
|
||||||
if(TRACE_AUDIO)
|
|
||||||
add_definitions(-DTRACE_AUDIO)
|
|
||||||
set(DEBUG ON)
|
|
||||||
set(DEBUG_TRACE_BUFFER ON)
|
|
||||||
endif()
|
|
||||||
if(DEBUG_TRACE_BUFFER)
|
|
||||||
add_definitions(-DDEBUG_TRACE_BUFFER)
|
|
||||||
endif()
|
|
||||||
if(DEBUG_INTERRUPTS)
|
|
||||||
add_definitions(-DDEBUG_INTERRUPTS)
|
|
||||||
set(DEBUG ON)
|
|
||||||
endif()
|
|
||||||
if(DEBUG_TASKS)
|
|
||||||
add_definitions(-DDEBUG_TASKS)
|
|
||||||
set(DEBUG ON)
|
|
||||||
endif()
|
|
||||||
if(DEBUG_TIMERS)
|
|
||||||
add_definitions(-DDEBUG_TIMERS)
|
|
||||||
set(DEBUG ON)
|
|
||||||
endif()
|
|
||||||
if(CLI)
|
|
||||||
add_definitions(-DCLI)
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} cli.cpp)
|
|
||||||
set(SRC ${SRC} dump.cpp)
|
|
||||||
elseif(DEBUG)
|
|
||||||
set(SRC ${SRC} dump.cpp)
|
|
||||||
endif()
|
|
||||||
if(DEBUG)
|
|
||||||
add_definitions(-DDEBUG)
|
|
||||||
endif()
|
|
||||||
if(SUPPORT_D16_EU_ONLY)
|
|
||||||
add_definitions(-DMODULE_D16_EU_ONLY_SUPPORT)
|
|
||||||
endif()
|
|
||||||
if(HAPTIC)
|
|
||||||
add_definitions(-DHAPTIC)
|
|
||||||
set(SRC ${SRC} haptic.cpp)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} haptic_driver.cpp)
|
|
||||||
endif()
|
|
||||||
if(MULTIMODULE)
|
|
||||||
add_definitions(-DMULTIMODULE)
|
|
||||||
set(SRC ${SRC} pulses/multi_arm.cpp telemetry/spektrum.cpp)
|
|
||||||
endif()
|
|
||||||
add_definitions(-DCPUARM)
|
|
||||||
add_definitions(-DFRSKY -DFRSKY_SPORT -DFRSKY_HUB -DGPS -DPXX -DDSM2)
|
|
||||||
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE)
|
|
||||||
include_directories(targets/${TARGET_DIR} ${THIRDPARTY_DIR})
|
|
||||||
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
|
|
||||||
foreach(LANGUAGE ${TTS_LANGUAGES})
|
|
||||||
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
|
|
||||||
endforeach()
|
|
||||||
set(SRC
|
|
||||||
${SRC}
|
|
||||||
main_arm.cpp
|
|
||||||
tasks_arm.cpp
|
|
||||||
audio_arm.cpp
|
|
||||||
telemetry/telemetry.cpp
|
|
||||||
telemetry/telemetry_holders.cpp
|
|
||||||
telemetry/telemetry_sensors.cpp
|
|
||||||
telemetry/frsky.cpp
|
|
||||||
telemetry/frsky_d_arm.cpp
|
|
||||||
telemetry/frsky_sport.cpp
|
|
||||||
crc16.cpp
|
|
||||||
vario.cpp
|
|
||||||
)
|
|
||||||
set(FIRMWARE_TARGET_SRC
|
|
||||||
${FIRMWARE_TARGET_SRC}
|
|
||||||
diskio.cpp
|
|
||||||
)
|
|
||||||
set(TARGET_SRC
|
|
||||||
${TARGET_SRC}
|
|
||||||
pulses_driver.cpp
|
|
||||||
keys_driver.cpp
|
|
||||||
adc_driver.cpp
|
|
||||||
trainer_driver.cpp
|
|
||||||
audio_driver.cpp
|
|
||||||
serial2_driver.cpp
|
|
||||||
telemetry_driver.cpp
|
|
||||||
)
|
|
||||||
set(FIRMWARE_SRC
|
|
||||||
${FIRMWARE_SRC}
|
|
||||||
${COOS_DIR}/kernel/core.c
|
|
||||||
${COOS_DIR}/kernel/hook.c
|
|
||||||
${COOS_DIR}/kernel/task.c
|
|
||||||
${COOS_DIR}/kernel/event.c
|
|
||||||
${COOS_DIR}/kernel/time.c
|
|
||||||
${COOS_DIR}/kernel/timer.c
|
|
||||||
${COOS_DIR}/kernel/flag.c
|
|
||||||
${COOS_DIR}/kernel/mutex.c
|
|
||||||
${COOS_DIR}/kernel/serviceReq.c
|
|
||||||
${COOS_DIR}/portable/GCC/port.c
|
|
||||||
${COOS_DIR}/portable/arch.c
|
|
||||||
)
|
|
||||||
set(PULSES_SRC
|
|
||||||
${PULSES_SRC}
|
|
||||||
pulses_arm.cpp
|
|
||||||
ppm_arm.cpp
|
|
||||||
pxx_arm.cpp
|
|
||||||
dsm2_arm.cpp
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
option(EXT "Telemetry protocol" OFF) # TODO rename this EXT option to TELEMETRY
|
include(common/avr/CMakeLists.txt)
|
||||||
option(AUDIO "Audio support" OFF)
|
|
||||||
option(VOICE "Voice support" OFF)
|
|
||||||
option(GRAPHICS "Additional graphics" ON)
|
|
||||||
option(BOLD "Bold font" ON)
|
|
||||||
option(BATTGRAPH "Battery graph" OFF)
|
|
||||||
option(HAPTIC "Haptic support" OFF)
|
|
||||||
set(TTS "EN" CACHE STRING "TTS language")
|
|
||||||
set(LCD "DEFAULT" CACHE STRING "LCD type (DEFAULT/ST7565P/ST7565R/ERC12864FSF/ST7920/KS108)")
|
|
||||||
set(DSM2 "NO" CACHE STRING "LCD type (NO/PPM/SERIAL)")
|
|
||||||
set(LUA NO)
|
|
||||||
set(PULSES_SRC pulses_avr.cpp)
|
|
||||||
set(SRC ${SRC} main_avr.cpp)
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/common_avr/adc_driver.cpp)
|
|
||||||
add_definitions(-DLCD_${LCD})
|
|
||||||
if(DSM2)
|
|
||||||
add_definitions(-DDSM2 -DDSM2_${DSM2})
|
|
||||||
endif()
|
|
||||||
if(SDCARD)
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/gruvin9x/diskio.cpp)
|
|
||||||
endif()
|
|
||||||
if(AUDIO)
|
|
||||||
add_definitions(-DAUDIO)
|
|
||||||
set(SRC ${SRC} audio_avr.cpp)
|
|
||||||
set(BUZZER OFF)
|
|
||||||
else()
|
|
||||||
set(BUZZER ON)
|
|
||||||
endif()
|
|
||||||
if(BUZZER)
|
|
||||||
add_definitions(-DBUZZER)
|
|
||||||
set(SRC ${SRC} buzzer.cpp)
|
|
||||||
endif()
|
|
||||||
if(VOICE)
|
|
||||||
add_definitions(-DVOICE)
|
|
||||||
set(TARGET_SRC ${TARGET_SRC} voice.cpp)
|
|
||||||
foreach(LANGUAGE ${TTS_LANGUAGES})
|
|
||||||
string(TOUPPER ${LANGUAGE} LANGUAGE_CAPITALIZED)
|
|
||||||
if(TTS STREQUAL ${LANGUAGE_CAPITALIZED})
|
|
||||||
add_definitions(-DTTS_${LANGUAGE_CAPITALIZED})
|
|
||||||
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
if(GRAPHICS)
|
|
||||||
add_definitions(-DGRAPHICS)
|
|
||||||
endif()
|
|
||||||
if(BOLD)
|
|
||||||
add_definitions(-DBOLD_FONT)
|
|
||||||
endif()
|
|
||||||
if(BATTGRAPH)
|
|
||||||
add_definitions(-DBATTGRAPH)
|
|
||||||
endif()
|
|
||||||
if(HAPTIC)
|
|
||||||
add_definitions(-DHAPTIC)
|
|
||||||
set(SRC ${SRC} haptic.cpp)
|
|
||||||
endif()
|
|
||||||
if(${EXT} STREQUAL OFF)
|
|
||||||
add_definitions(-DEXTSTD)
|
|
||||||
elseif(EXT STREQUAL ARDUPILOT)
|
|
||||||
add_definitions(-DARDUPILOT)
|
|
||||||
set(SRC ${SRC} telemetry/ardupilot.cpp)
|
|
||||||
elseif(EXT STREQUAL NMEA)
|
|
||||||
add_definitions(-DNMEA)
|
|
||||||
set(SRC ${SRC} telemetry/nmea.cpp)
|
|
||||||
elseif(EXT STREQUAL JETI)
|
|
||||||
add_definitions(-DJETI)
|
|
||||||
set(SRC ${SRC} telemetry/jeti.cpp)
|
|
||||||
elseif(EXT STREQUAL MAVLINK)
|
|
||||||
add_definitions(-DMAVLINK)
|
|
||||||
include_directories(${THIRDPARTY_DIR} gui/${GUI_DIR} targets/common_avr)
|
|
||||||
set(SRC ${SRC} telemetry/mavlink.cpp targets/common_avr/serial_driver.cpp)
|
|
||||||
set(GUI_SRC ${GUI_SRC} view_mavlink.cpp)
|
|
||||||
math(EXPR EEPROM_VARIANT ${EEPROM_VARIANT}+${MAVLINK_VARIANT})
|
|
||||||
elseif(EXT STREQUAL TELEMETREZ)
|
|
||||||
add_definitions(-DTELEMETREZ)
|
|
||||||
set(SRC ${SRC} telemetry/jeti.cpp)
|
|
||||||
elseif(EXT STREQUAL FRSKY_SPORT)
|
|
||||||
add_definitions(-DFRSKY_SPORT)
|
|
||||||
set(SRC ${SRC} crc16.cpp telemetry/frsky_sport.cpp)
|
|
||||||
endif()
|
|
||||||
if(EXT STREQUAL FRSKY OR EXT STREQUAL FRSKY_SPORT OR EXT STREQUAL TELEMETREZ)
|
|
||||||
option(FRSKY_HUB "FrSky Hub support" ON)
|
|
||||||
option(WS_HOW_HIGH "Winged Shadow sensors support" ON)
|
|
||||||
option(GAUGES "Telemetry gauges" OFF)
|
|
||||||
option(GPS "GPS support" ON)
|
|
||||||
option(VARIO "Vario support" ON)
|
|
||||||
add_definitions(-DFRSKY)
|
|
||||||
set(SRC ${SRC} telemetry/telemetry.cpp telemetry/telemetry_holders.cpp telemetry/frsky.cpp telemetry/frsky_d.cpp)
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/common_avr/telemetry_driver.cpp)
|
|
||||||
set(GUI_SRC ${GUI_SRC} view_telemetry.cpp)
|
|
||||||
if(FRSKY_HUB)
|
|
||||||
add_definitions(-DFRSKY_HUB)
|
|
||||||
endif()
|
|
||||||
if(WS_HOW_HIGH)
|
|
||||||
add_definitions(-DWS_HOW_HIGH)
|
|
||||||
endif()
|
|
||||||
if(GAUGES)
|
|
||||||
add_definitions(-DGAUGES)
|
|
||||||
endif()
|
|
||||||
if(GPS)
|
|
||||||
add_definitions(-DGPS)
|
|
||||||
endif()
|
|
||||||
if(VARIO)
|
|
||||||
add_definitions(-DVARIO)
|
|
||||||
set(SRC ${SRC} vario.cpp)
|
|
||||||
endif()
|
|
||||||
math(EXPR EEPROM_VARIANT ${EEPROM_VARIANT}+${FRSKY_VARIANT})
|
|
||||||
endif()
|
|
||||||
add_definitions(-DTIMERS=2)
|
|
||||||
if(EEPROM_VARIANT_NEEDED)
|
|
||||||
add_definitions(-DEEPROM_VARIANT=${EEPROM_VARIANT})
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(LANGUAGE ${GUI_LANGUAGES})
|
foreach(LANGUAGE ${GUI_LANGUAGES})
|
||||||
|
|
131
radio/src/common/arm/CMakeLists.txt
Normal file
131
radio/src/common/arm/CMakeLists.txt
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
option(TIMERS "Timers count" 2)
|
||||||
|
option(CLI "Command Line Interface" OFF)
|
||||||
|
option(DEBUG "Debug mode" OFF)
|
||||||
|
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
|
||||||
|
option(TRACE_SD_CARD "Traces SD enabled" OFF)
|
||||||
|
option(TRACE_FATFS "Traces FatFS enabled" OFF)
|
||||||
|
option(TRACE_AUDIO "Traces audio enabled" OFF)
|
||||||
|
option(DEBUG_TRACE_BUFFER "Debug Trace Screen" OFF)
|
||||||
|
option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" OFF)
|
||||||
|
option(SUPPORT_D16_EU_ONLY "XJT module only supports D16-EU and LR12-EU" OFF) # TODO rename to XJT_EU_ONLY
|
||||||
|
option(DEBUG_INTERRUPTS "Count interrupts" OFF)
|
||||||
|
option(DEBUG_TASKS "Task switching statistics" OFF)
|
||||||
|
option(DEBUG_TIMERS "Time critical parts of the code" OFF)
|
||||||
|
|
||||||
|
if(TIMERS EQUAL 3)
|
||||||
|
add_definitions(-DTIMERS=3)
|
||||||
|
else()
|
||||||
|
add_definitions(-DTIMERS=2)
|
||||||
|
endif()
|
||||||
|
if(LOG_TELEMETRY)
|
||||||
|
add_definitions(-DLOG_TELEMETRY)
|
||||||
|
endif()
|
||||||
|
if(TRACE_SD_CARD)
|
||||||
|
add_definitions(-DTRACE_SD_CARD)
|
||||||
|
set(DEBUG ON)
|
||||||
|
set(DEBUG_TRACE_BUFFER ON)
|
||||||
|
endif()
|
||||||
|
if(TRACE_FATFS)
|
||||||
|
add_definitions(-DTRACE_FATFS)
|
||||||
|
set(DEBUG ON)
|
||||||
|
set(DEBUG_TRACE_BUFFER ON)
|
||||||
|
endif()
|
||||||
|
if(TRACE_AUDIO)
|
||||||
|
add_definitions(-DTRACE_AUDIO)
|
||||||
|
set(DEBUG ON)
|
||||||
|
set(DEBUG_TRACE_BUFFER ON)
|
||||||
|
endif()
|
||||||
|
if(DEBUG_TRACE_BUFFER)
|
||||||
|
add_definitions(-DDEBUG_TRACE_BUFFER)
|
||||||
|
endif()
|
||||||
|
if(DEBUG_INTERRUPTS)
|
||||||
|
add_definitions(-DDEBUG_INTERRUPTS)
|
||||||
|
set(DEBUG ON)
|
||||||
|
endif()
|
||||||
|
if(DEBUG_TASKS)
|
||||||
|
add_definitions(-DDEBUG_TASKS)
|
||||||
|
set(DEBUG ON)
|
||||||
|
endif()
|
||||||
|
if(DEBUG_TIMERS)
|
||||||
|
add_definitions(-DDEBUG_TIMERS)
|
||||||
|
set(DEBUG ON)
|
||||||
|
endif()
|
||||||
|
if(CLI)
|
||||||
|
add_definitions(-DCLI)
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} cli.cpp)
|
||||||
|
set(SRC ${SRC} dump.cpp)
|
||||||
|
elseif(DEBUG)
|
||||||
|
set(SRC ${SRC} dump.cpp)
|
||||||
|
endif()
|
||||||
|
if(DEBUG)
|
||||||
|
add_definitions(-DDEBUG)
|
||||||
|
endif()
|
||||||
|
if(SUPPORT_D16_EU_ONLY)
|
||||||
|
add_definitions(-DMODULE_D16_EU_ONLY_SUPPORT)
|
||||||
|
endif()
|
||||||
|
if(HAPTIC)
|
||||||
|
add_definitions(-DHAPTIC)
|
||||||
|
set(SRC ${SRC} haptic.cpp)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} haptic_driver.cpp)
|
||||||
|
endif()
|
||||||
|
if(MULTIMODULE)
|
||||||
|
add_definitions(-DMULTIMODULE)
|
||||||
|
set(SRC ${SRC} pulses/multi_arm.cpp)
|
||||||
|
endif()
|
||||||
|
add_definitions(-DCPUARM)
|
||||||
|
add_definitions(-DFRSKY -DFRSKY_SPORT -DFRSKY_HUB -DGPS -DPXX -DDSM2)
|
||||||
|
add_definitions(-DBOLD_FONT -DBATTGRAPH -DTHRTRACE)
|
||||||
|
include_directories(targets/${TARGET_DIR} ${THIRDPARTY_DIR})
|
||||||
|
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
|
||||||
|
foreach(LANGUAGE ${TTS_LANGUAGES})
|
||||||
|
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
|
||||||
|
endforeach()
|
||||||
|
set(SRC
|
||||||
|
${SRC}
|
||||||
|
main_arm.cpp
|
||||||
|
tasks_arm.cpp
|
||||||
|
audio_arm.cpp
|
||||||
|
telemetry/telemetry.cpp
|
||||||
|
telemetry/telemetry_holders.cpp
|
||||||
|
telemetry/telemetry_sensors.cpp
|
||||||
|
telemetry/frsky.cpp
|
||||||
|
telemetry/frsky_d_arm.cpp
|
||||||
|
telemetry/frsky_sport.cpp
|
||||||
|
crc16.cpp
|
||||||
|
vario.cpp
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
diskio.cpp
|
||||||
|
)
|
||||||
|
set(TARGET_SRC
|
||||||
|
${TARGET_SRC}
|
||||||
|
pulses_driver.cpp
|
||||||
|
keys_driver.cpp
|
||||||
|
adc_driver.cpp
|
||||||
|
trainer_driver.cpp
|
||||||
|
audio_driver.cpp
|
||||||
|
serial2_driver.cpp
|
||||||
|
telemetry_driver.cpp
|
||||||
|
)
|
||||||
|
set(FIRMWARE_SRC
|
||||||
|
${FIRMWARE_SRC}
|
||||||
|
${COOS_DIR}/kernel/core.c
|
||||||
|
${COOS_DIR}/kernel/hook.c
|
||||||
|
${COOS_DIR}/kernel/task.c
|
||||||
|
${COOS_DIR}/kernel/event.c
|
||||||
|
${COOS_DIR}/kernel/time.c
|
||||||
|
${COOS_DIR}/kernel/timer.c
|
||||||
|
${COOS_DIR}/kernel/flag.c
|
||||||
|
${COOS_DIR}/kernel/mutex.c
|
||||||
|
${COOS_DIR}/kernel/serviceReq.c
|
||||||
|
${COOS_DIR}/portable/GCC/port.c
|
||||||
|
${COOS_DIR}/portable/arch.c
|
||||||
|
)
|
||||||
|
set(PULSES_SRC
|
||||||
|
${PULSES_SRC}
|
||||||
|
pulses_arm.cpp
|
||||||
|
ppm_arm.cpp
|
||||||
|
pxx_arm.cpp
|
||||||
|
dsm2_arm.cpp
|
||||||
|
)
|
87
radio/src/common/arm/stm32/CMakeLists.txt
Normal file
87
radio/src/common/arm/stm32/CMakeLists.txt
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
set(LUA "NO" CACHE STRING "Lua scripts (YES/NO/NO_MODEL_SCRIPTS)")
|
||||||
|
set(USB "JOYSTICK" CACHE STRING "USB option (JOYSTICK/MASSSTORAGE/SERIAL)")
|
||||||
|
set(ARCH ARM)
|
||||||
|
set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.1.0/Libraries)
|
||||||
|
add_definitions(-DCPUSTM32)
|
||||||
|
add_definitions(-DSBUS -DCROSSFIRE)
|
||||||
|
include_directories(${STM32USB_DIR}/STM32_USB_OTG_Driver/inc)
|
||||||
|
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc)
|
||||||
|
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/inc)
|
||||||
|
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/hid/inc)
|
||||||
|
include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/cdc/inc)
|
||||||
|
set(STM32USB_SRC
|
||||||
|
STM32_USB_OTG_Driver/src/usb_core.c
|
||||||
|
STM32_USB_OTG_Driver/src/usb_dcd.c
|
||||||
|
STM32_USB_OTG_Driver/src/usb_dcd_int.c
|
||||||
|
STM32_USB_Device_Library/Core/src/usbd_core.c
|
||||||
|
STM32_USB_Device_Library/Core/src/usbd_ioreq.c
|
||||||
|
STM32_USB_Device_Library/Core/src/usbd_req.c
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
usb_bsp.c
|
||||||
|
usbd_desc.c
|
||||||
|
usbd_usr.cpp
|
||||||
|
)
|
||||||
|
if(USB STREQUAL SERIAL)
|
||||||
|
add_definitions(-DUSB_SERIAL)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
usbd_cdc.cpp
|
||||||
|
)
|
||||||
|
set(STM32USB_SRC
|
||||||
|
${STM32USB_SRC}
|
||||||
|
STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c
|
||||||
|
)
|
||||||
|
elseif(USB STREQUAL MASSSTORAGE)
|
||||||
|
add_definitions(-DUSB_MASS_STORAGE)
|
||||||
|
set(STM32USB_SRC
|
||||||
|
${STM32USB_SRC}
|
||||||
|
STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
|
||||||
|
STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
|
||||||
|
STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
|
||||||
|
STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
usbd_storage_msd.cpp
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_definitions(-DUSB_JOYSTICK)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
usbd_hid_joystick.c
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
if(GVARS)
|
||||||
|
set(GUI_SRC
|
||||||
|
${GUI_SRC}
|
||||||
|
menu_model_gvars.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
set(FIRMWARE_SRC
|
||||||
|
${FIRMWARE_SRC}
|
||||||
|
serial.cpp
|
||||||
|
syscalls.c
|
||||||
|
)
|
||||||
|
foreach(FILE ${STM32LIB_SRC})
|
||||||
|
set(FIRMWARE_SRC
|
||||||
|
${FIRMWARE_SRC}
|
||||||
|
${STM32LIB_DIR}/${FILE}
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
foreach(FILE ${STM32USB_SRC})
|
||||||
|
set(FIRMWARE_SRC
|
||||||
|
${FIRMWARE_SRC}
|
||||||
|
${STM32USB_DIR}/${FILE}
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
set(SRC
|
||||||
|
${SRC}
|
||||||
|
sbus.cpp
|
||||||
|
telemetry/crossfire.cpp
|
||||||
|
)
|
||||||
|
set(PULSES_SRC
|
||||||
|
${PULSES_SRC}
|
||||||
|
crossfire.cpp
|
||||||
|
)
|
22
radio/src/common/arm/stm32/f2/CMakeLists.txt
Normal file
22
radio/src/common/arm/stm32/f2/CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
set(CPU_FAMILY STM32)
|
||||||
|
set(MCU cortex-m3)
|
||||||
|
set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries)
|
||||||
|
include_directories(${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/inc)
|
||||||
|
include_directories(${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Include)
|
||||||
|
include_directories(${STM32LIB_DIR}/CMSIS/include)
|
||||||
|
set(STM32LIB_SRC
|
||||||
|
${STM32LIB_SRC}
|
||||||
|
CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/misc.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c
|
||||||
|
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} system_stm32f2xx.c)
|
||||||
|
|
22
radio/src/common/arm/stm32/f4/CMakeLists.txt
Normal file
22
radio/src/common/arm/stm32/f4/CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
set(CPU_FAMILY STM32)
|
||||||
|
set(MCU cortex-m4)
|
||||||
|
set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries)
|
||||||
|
include_directories(${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/inc)
|
||||||
|
include_directories(${STM32LIB_DIR}/CMSIS/Device/ST/STM32F4xx/Include)
|
||||||
|
include_directories(${STM32LIB_DIR}/CMSIS/include)
|
||||||
|
add_definitions(-DSTM32F4)
|
||||||
|
set(STM32LIB_SRC
|
||||||
|
${STM32LIB_SRC}
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/misc.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} system_stm32f4xx.c)
|
||||||
|
|
113
radio/src/common/avr/CMakeLists.txt
Normal file
113
radio/src/common/avr/CMakeLists.txt
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
option(EXT "Telemetry protocol" OFF) # TODO rename this EXT option to TELEMETRY
|
||||||
|
option(AUDIO "Audio support" OFF)
|
||||||
|
option(VOICE "Voice support" OFF)
|
||||||
|
option(GRAPHICS "Additional graphics" ON)
|
||||||
|
option(BOLD "Bold font" ON)
|
||||||
|
option(BATTGRAPH "Battery graph" OFF)
|
||||||
|
option(HAPTIC "Haptic support" OFF)
|
||||||
|
set(TTS "EN" CACHE STRING "TTS language")
|
||||||
|
set(LCD "DEFAULT" CACHE STRING "LCD type (DEFAULT/ST7565P/ST7565R/ERC12864FSF/ST7920/KS108)")
|
||||||
|
set(DSM2 "NO" CACHE STRING "LCD type (NO/PPM/SERIAL)")
|
||||||
|
set(LUA NO)
|
||||||
|
set(PULSES_SRC pulses_avr.cpp)
|
||||||
|
set(SRC ${SRC} main_avr.cpp)
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/common_avr/adc_driver.cpp)
|
||||||
|
add_definitions(-DLCD_${LCD})
|
||||||
|
if(DSM2)
|
||||||
|
add_definitions(-DDSM2 -DDSM2_${DSM2})
|
||||||
|
endif()
|
||||||
|
if(SDCARD)
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/gruvin9x/diskio.cpp)
|
||||||
|
endif()
|
||||||
|
if(AUDIO)
|
||||||
|
add_definitions(-DAUDIO)
|
||||||
|
set(SRC ${SRC} audio_avr.cpp)
|
||||||
|
set(BUZZER OFF)
|
||||||
|
else()
|
||||||
|
set(BUZZER ON)
|
||||||
|
endif()
|
||||||
|
if(BUZZER)
|
||||||
|
add_definitions(-DBUZZER)
|
||||||
|
set(SRC ${SRC} buzzer.cpp)
|
||||||
|
endif()
|
||||||
|
if(VOICE)
|
||||||
|
add_definitions(-DVOICE)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} voice.cpp)
|
||||||
|
foreach(LANGUAGE ${TTS_LANGUAGES})
|
||||||
|
string(TOUPPER ${LANGUAGE} LANGUAGE_CAPITALIZED)
|
||||||
|
if(TTS STREQUAL ${LANGUAGE_CAPITALIZED})
|
||||||
|
add_definitions(-DTTS_${LANGUAGE_CAPITALIZED})
|
||||||
|
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
if(GRAPHICS)
|
||||||
|
add_definitions(-DGRAPHICS)
|
||||||
|
endif()
|
||||||
|
if(BOLD)
|
||||||
|
add_definitions(-DBOLD_FONT)
|
||||||
|
endif()
|
||||||
|
if(BATTGRAPH)
|
||||||
|
add_definitions(-DBATTGRAPH)
|
||||||
|
endif()
|
||||||
|
if(HAPTIC)
|
||||||
|
add_definitions(-DHAPTIC)
|
||||||
|
set(SRC ${SRC} haptic.cpp)
|
||||||
|
endif()
|
||||||
|
if(${EXT} STREQUAL OFF)
|
||||||
|
add_definitions(-DEXTSTD)
|
||||||
|
elseif(EXT STREQUAL ARDUPILOT)
|
||||||
|
add_definitions(-DARDUPILOT)
|
||||||
|
set(SRC ${SRC} telemetry/ardupilot.cpp)
|
||||||
|
elseif(EXT STREQUAL NMEA)
|
||||||
|
add_definitions(-DNMEA)
|
||||||
|
set(SRC ${SRC} telemetry/nmea.cpp)
|
||||||
|
elseif(EXT STREQUAL JETI)
|
||||||
|
add_definitions(-DJETI)
|
||||||
|
set(SRC ${SRC} telemetry/jeti.cpp)
|
||||||
|
elseif(EXT STREQUAL MAVLINK)
|
||||||
|
add_definitions(-DMAVLINK)
|
||||||
|
include_directories(${THIRDPARTY_DIR} gui/${GUI_DIR} targets/common_avr)
|
||||||
|
set(SRC ${SRC} telemetry/mavlink.cpp targets/common_avr/serial_driver.cpp)
|
||||||
|
set(GUI_SRC ${GUI_SRC} view_mavlink.cpp)
|
||||||
|
math(EXPR EEPROM_VARIANT ${EEPROM_VARIANT}+${MAVLINK_VARIANT})
|
||||||
|
elseif(EXT STREQUAL TELEMETREZ)
|
||||||
|
add_definitions(-DTELEMETREZ)
|
||||||
|
set(SRC ${SRC} telemetry/jeti.cpp)
|
||||||
|
elseif(EXT STREQUAL FRSKY_SPORT)
|
||||||
|
add_definitions(-DFRSKY_SPORT)
|
||||||
|
set(SRC ${SRC} crc16.cpp telemetry/frsky_sport.cpp)
|
||||||
|
endif()
|
||||||
|
if(EXT STREQUAL FRSKY OR EXT STREQUAL FRSKY_SPORT OR EXT STREQUAL TELEMETREZ)
|
||||||
|
option(FRSKY_HUB "FrSky Hub support" ON)
|
||||||
|
option(WS_HOW_HIGH "Winged Shadow sensors support" ON)
|
||||||
|
option(GAUGES "Telemetry gauges" OFF)
|
||||||
|
option(GPS "GPS support" ON)
|
||||||
|
option(VARIO "Vario support" ON)
|
||||||
|
add_definitions(-DFRSKY)
|
||||||
|
set(SRC ${SRC} telemetry/telemetry.cpp telemetry/telemetry_holders.cpp telemetry/frsky.cpp telemetry/frsky_d.cpp)
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/common_avr/telemetry_driver.cpp)
|
||||||
|
set(GUI_SRC ${GUI_SRC} view_telemetry.cpp)
|
||||||
|
if(FRSKY_HUB)
|
||||||
|
add_definitions(-DFRSKY_HUB)
|
||||||
|
endif()
|
||||||
|
if(WS_HOW_HIGH)
|
||||||
|
add_definitions(-DWS_HOW_HIGH)
|
||||||
|
endif()
|
||||||
|
if(GAUGES)
|
||||||
|
add_definitions(-DGAUGES)
|
||||||
|
endif()
|
||||||
|
if(GPS)
|
||||||
|
add_definitions(-DGPS)
|
||||||
|
endif()
|
||||||
|
if(VARIO)
|
||||||
|
add_definitions(-DVARIO)
|
||||||
|
set(SRC ${SRC} vario.cpp)
|
||||||
|
endif()
|
||||||
|
math(EXPR EEPROM_VARIANT ${EEPROM_VARIANT}+${FRSKY_VARIANT})
|
||||||
|
endif()
|
||||||
|
add_definitions(-DTIMERS=2)
|
||||||
|
if(EEPROM_VARIANT_NEEDED)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=${EEPROM_VARIANT})
|
||||||
|
endif()
|
||||||
|
|
21
radio/src/targets/9x/CMakeLists.txt
Normal file
21
radio/src/targets/9x/CMakeLists.txt
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
option(SP22 "SmartieParts 2.2 Backlight support" OFF)
|
||||||
|
option(PWM_BACKLIGHT "PWM Backlight" OFF)
|
||||||
|
set(ARCH AVR)
|
||||||
|
set(MCU atmega64)
|
||||||
|
string(TOLOWER ${PCB} FLAVOUR)
|
||||||
|
set(EEPROM_VARIANT_NEEDED ON)
|
||||||
|
set(EEPROM EEPROM_RLC)
|
||||||
|
set(GUI_DIR 9x)
|
||||||
|
set(TARGET_DIR 9x)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
||||||
|
add_definitions(-DPCBSTD -DPCB${PCB} -DCPUM64)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} board_stock.cpp)
|
||||||
|
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC})
|
||||||
|
if(SP22)
|
||||||
|
add_definitions(-DSP22)
|
||||||
|
endif()
|
||||||
|
if(PWM_BACKLIGHT)
|
||||||
|
add_definitions(-DPWM_BACKLIGHT)
|
||||||
|
endif()
|
||||||
|
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} lcd_driver.cpp)
|
||||||
|
|
12
radio/src/targets/gruvin9x/CMakeLists.txt
Normal file
12
radio/src/targets/gruvin9x/CMakeLists.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
set(ARCH AVR)
|
||||||
|
set(MCU atmega2560)
|
||||||
|
string(TOLOWER ${PCB} FLAVOUR)
|
||||||
|
set(EEPROM EEPROM_RLC)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=0)
|
||||||
|
set(GUI_DIR 9x)
|
||||||
|
set(TARGET_DIR gruvin9x)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
||||||
|
add_definitions(-DPCB${PCB} -DCPUM2560 -DROTARY_ENCODERS=2)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} board_gruvin9x.cpp)
|
||||||
|
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC})
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/9x/lcd_driver.cpp)
|
75
radio/src/targets/horus/CMakeLists.txt
Normal file
75
radio/src/targets/horus/CMakeLists.txt
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
set(CPU_TYPE STM32F4)
|
||||||
|
set(HSE_VALUE 12000000)
|
||||||
|
set(SDCARD YES)
|
||||||
|
set(EEPROM SDCARD)
|
||||||
|
set(HAPTIC YES)
|
||||||
|
set(GUI_DIR horus)
|
||||||
|
set(TARGET_DIR horus)
|
||||||
|
set(LINKER_SCRIPT targets/horus/stm32f4_flash.ld)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} horus_bitmaps)
|
||||||
|
set(LUA_EXPORT lua_export_horus)
|
||||||
|
set(FLAVOUR horus)
|
||||||
|
set(VIRTUAL_INPUTS YES)
|
||||||
|
set(RAMBACKUP YES)
|
||||||
|
option(DISK_CACHE "Enable SD card disk cache" YES)
|
||||||
|
add_definitions(-DPCBHORUS -DCOLORLCD -DSTM32F429_439xx -DPPM_PIN_UART -DPPM_PIN_TIMER)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
||||||
|
add_definitions(-DLUAINPUTS -DXCURVES -DVARIO)
|
||||||
|
include_directories(${RADIO_SRC_DIRECTORY}/fonts/horus gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
|
||||||
|
file(GLOB THEMES_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/horus ${RADIO_SRC_DIRECTORY}/gui/horus/themes/*.cpp)
|
||||||
|
file(GLOB LAYOUTS_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/horus ${RADIO_SRC_DIRECTORY}/gui/horus/layouts/*.cpp)
|
||||||
|
file(GLOB WIDGETS_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/horus ${RADIO_SRC_DIRECTORY}/gui/horus/widgets/*.cpp)
|
||||||
|
set(GUI_SRC
|
||||||
|
${GUI_SRC}
|
||||||
|
bitmapbuffer.cpp
|
||||||
|
curves.cpp
|
||||||
|
bitmaps.cpp
|
||||||
|
menu_general_hardware.cpp
|
||||||
|
menu_model_inputs.cpp
|
||||||
|
menu_model_mixes.cpp
|
||||||
|
view_channels.cpp
|
||||||
|
view_logical_switches.cpp
|
||||||
|
view_about.cpp
|
||||||
|
view_text.cpp
|
||||||
|
screens_setup.cpp
|
||||||
|
theme.cpp
|
||||||
|
topbar.cpp
|
||||||
|
layout.cpp
|
||||||
|
widget.cpp
|
||||||
|
${THEMES_SRC}
|
||||||
|
${LAYOUTS_SRC}
|
||||||
|
${WIDGETS_SRC}
|
||||||
|
)
|
||||||
|
set(SRC ${SRC} targets/taranis/rtc_driver.cpp)
|
||||||
|
if(DISK_CACHE)
|
||||||
|
set(SRC ${SRC} disk_cache.cpp)
|
||||||
|
add_definitions(-DDISK_CACHE)
|
||||||
|
endif()
|
||||||
|
set(TARGET_SRC
|
||||||
|
${TARGET_SRC}
|
||||||
|
board_horus.cpp
|
||||||
|
extmodule_driver.cpp
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
sdio_sd.c
|
||||||
|
lcd_driver.cpp
|
||||||
|
delays.c
|
||||||
|
usb_driver.c
|
||||||
|
pwr_driver.cpp
|
||||||
|
sdram_driver.c
|
||||||
|
led_driver.cpp
|
||||||
|
startup_stm32f40_41xxx.s
|
||||||
|
)
|
||||||
|
set(STM32LIB_SRC
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_ltdc.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c
|
||||||
|
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma2d.c
|
||||||
|
)
|
||||||
|
add_custom_target(datacopy
|
||||||
|
WORKING_DIRECTORY ${RADIO_DIRECTORY}/src
|
||||||
|
COMMAND python ${RADIO_DIRECTORY}/util/generate_datacopy.py datastructs.h -DPCBHORUS -DCPUARM -DCOLORLCD -DVIRTUALINPUTS -DBACKUP > storage/datacopy.cpp
|
||||||
|
DEPENDS ${RADIO_DIRECTORY}/src/datastructs.h ${RADIO_DIRECTORY}/util/generate_datacopy.py
|
||||||
|
)
|
52
radio/src/targets/i6/CMakeLists.txt
Normal file
52
radio/src/targets/i6/CMakeLists.txt
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
option(STICKS "Sticks type" STANDARD)
|
||||||
|
set(CPU_TYPE MKL16Z64)
|
||||||
|
set(LINKER_SCRIPT targets/i6/startup/stm32f4_flash.ld)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
#top_lcd_driver.cpp
|
||||||
|
#bluetooth_driver.cpp
|
||||||
|
startup_MKL16Z4.s
|
||||||
|
)
|
||||||
|
#set(HSE_VALUE 12000000)
|
||||||
|
#set(SDCARD YES)
|
||||||
|
#set(EEPROM EEPROM_RLC)
|
||||||
|
set(GUI_DIR i6)
|
||||||
|
set(TARGET_DIR i6)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} i6_bitmaps)
|
||||||
|
set(VIRTUAL_INPUTS YES)
|
||||||
|
add_definitions(-DPCBI6 -DPPM_PIN_TIMER)
|
||||||
|
#add_definitions(-DAUDIO -DRTCLOCK)
|
||||||
|
#add_definitions(-DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DVARIO)
|
||||||
|
set(GUI_SRC ${GUI_SRC}
|
||||||
|
#bmp.cpp
|
||||||
|
#menu_model_inputs.cpp
|
||||||
|
#menu_model_mixes.cpp
|
||||||
|
#menu_model_display.cpp
|
||||||
|
#menu_general_diagkeys.cpp
|
||||||
|
#menu_general_diaganas.cpp
|
||||||
|
#menu_general_hardware.cpp
|
||||||
|
#view_channels.cpp
|
||||||
|
#view_telemetry.cpp
|
||||||
|
#view_text.cpp
|
||||||
|
#view_about.cpp
|
||||||
|
)
|
||||||
|
set(TARGET_SRC
|
||||||
|
${TARGET_SRC}
|
||||||
|
board_i6.cpp
|
||||||
|
#extmodule_driver.cpp
|
||||||
|
#rtc_driver.cpp
|
||||||
|
)
|
||||||
|
set(FIRMWARE_SRC
|
||||||
|
${FIRMWARE_SRC}
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
#lcd_driver.cpp
|
||||||
|
#delays.c
|
||||||
|
#i2c_driver.cpp
|
||||||
|
#usb_driver.c
|
||||||
|
#pwr_driver.c
|
||||||
|
#configure_pins.cpp
|
||||||
|
#flash_driver.cpp
|
||||||
|
#aspi.c
|
||||||
|
)
|
255
radio/src/targets/i6/startup/MKL16Z64xxx4_flash.ld
Normal file
255
radio/src/targets/i6/startup/MKL16Z64xxx4_flash.ld
Normal file
|
@ -0,0 +1,255 @@
|
||||||
|
/*
|
||||||
|
** ###################################################################
|
||||||
|
** Processors: MKL16Z64VFM4
|
||||||
|
** MKL16Z64VFT4
|
||||||
|
** MKL16Z64VLH4
|
||||||
|
**
|
||||||
|
** Compiler: GNU C Compiler
|
||||||
|
** Reference manual: KL26P121M48SF4RM Rev. 3.2, October 2013
|
||||||
|
** Version: rev. 1.7, 2015-07-29
|
||||||
|
** Build: b160406
|
||||||
|
**
|
||||||
|
** Abstract:
|
||||||
|
** Linker file for the GNU C Compiler
|
||||||
|
**
|
||||||
|
** Copyright (c) 2016 Freescale Semiconductor, Inc.
|
||||||
|
** All rights reserved.
|
||||||
|
**
|
||||||
|
** Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
** are permitted provided that the following conditions are met:
|
||||||
|
**
|
||||||
|
** o Redistributions of source code must retain the above copyright notice, this list
|
||||||
|
** of conditions and the following disclaimer.
|
||||||
|
**
|
||||||
|
** o Redistributions in binary form must reproduce the above copyright notice, this
|
||||||
|
** list of conditions and the following disclaimer in the documentation and/or
|
||||||
|
** other materials provided with the distribution.
|
||||||
|
**
|
||||||
|
** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived from this
|
||||||
|
** software without specific prior written permission.
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**
|
||||||
|
** http: www.freescale.com
|
||||||
|
** mail: support@freescale.com
|
||||||
|
**
|
||||||
|
** ###################################################################
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Entry Point */
|
||||||
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0200;
|
||||||
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0100;
|
||||||
|
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0200 : 0x0;
|
||||||
|
|
||||||
|
/* Specify the memory areas */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000200
|
||||||
|
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
|
||||||
|
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0000FBF0
|
||||||
|
m_data (RW) : ORIGIN = 0x1FFFF800, LENGTH = 0x00002000
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Define output sections */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* The startup code goes first into internal flash */
|
||||||
|
.interrupts :
|
||||||
|
{
|
||||||
|
__VECTOR_TABLE = .;
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.isr_vector)) /* Startup code */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} > m_interrupts
|
||||||
|
|
||||||
|
.flash_config :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} > m_flash_config
|
||||||
|
|
||||||
|
/* The program code and other data goes into internal flash */
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.text) /* .text sections (code) */
|
||||||
|
*(.text*) /* .text* sections (code) */
|
||||||
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||||
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||||
|
*(.glue_7) /* glue arm to thumb code */
|
||||||
|
*(.glue_7t) /* glue thumb to arm code */
|
||||||
|
*(.eh_frame)
|
||||||
|
KEEP (*(.init))
|
||||||
|
KEEP (*(.fini))
|
||||||
|
. = ALIGN(4);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.ARM.extab :
|
||||||
|
{
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.ARM :
|
||||||
|
{
|
||||||
|
__exidx_start = .;
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
__exidx_end = .;
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.ctors :
|
||||||
|
{
|
||||||
|
__CTOR_LIST__ = .;
|
||||||
|
/* gcc uses crtbegin.o to find the start of
|
||||||
|
the constructors, so we make sure it is
|
||||||
|
first. Because this is a wildcard, it
|
||||||
|
doesn't matter if the user does not
|
||||||
|
actually link against crtbegin.o; the
|
||||||
|
linker won't look for a file to match a
|
||||||
|
wildcard. The wildcard also means that it
|
||||||
|
doesn't matter which directory crtbegin.o
|
||||||
|
is in. */
|
||||||
|
KEEP (*crtbegin.o(.ctors))
|
||||||
|
KEEP (*crtbegin?.o(.ctors))
|
||||||
|
/* We don't want to include the .ctor section from
|
||||||
|
from the crtend.o file until after the sorted ctors.
|
||||||
|
The .ctor section from the crtend file contains the
|
||||||
|
end of ctors marker and it must be last */
|
||||||
|
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
|
||||||
|
KEEP (*(SORT(.ctors.*)))
|
||||||
|
KEEP (*(.ctors))
|
||||||
|
__CTOR_END__ = .;
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.dtors :
|
||||||
|
{
|
||||||
|
__DTOR_LIST__ = .;
|
||||||
|
KEEP (*crtbegin.o(.dtors))
|
||||||
|
KEEP (*crtbegin?.o(.dtors))
|
||||||
|
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
|
||||||
|
KEEP (*(SORT(.dtors.*)))
|
||||||
|
KEEP (*(.dtors))
|
||||||
|
__DTOR_END__ = .;
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.preinit_array :
|
||||||
|
{
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||||
|
KEEP (*(.preinit_array*))
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.init_array :
|
||||||
|
{
|
||||||
|
PROVIDE_HIDDEN (__init_array_start = .);
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array*))
|
||||||
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.fini_array :
|
||||||
|
{
|
||||||
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
KEEP (*(.fini_array*))
|
||||||
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
__etext = .; /* define a global symbol at end of code */
|
||||||
|
__DATA_ROM = .; /* Symbol is used by startup for data initialization */
|
||||||
|
|
||||||
|
/* reserve MTB memory at the beginning of m_data */
|
||||||
|
.mtb : /* MTB buffer address as defined by the hardware */
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_mtb_start = .;
|
||||||
|
KEEP(*(.mtb_buf)) /* need to KEEP Micro Trace Buffer as not referenced by application */
|
||||||
|
. = ALIGN(8);
|
||||||
|
_mtb_end = .;
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
.interrupts_ram :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
__VECTOR_RAM__ = .;
|
||||||
|
__interrupts_ram_start__ = .; /* Create a global symbol at data start */
|
||||||
|
*(.m_interrupts_ram) /* This is a user defined section */
|
||||||
|
. += M_VECTOR_RAM_SIZE;
|
||||||
|
. = ALIGN(4);
|
||||||
|
__interrupts_ram_end__ = .; /* Define a global symbol at data end */
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
__VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
|
||||||
|
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
|
||||||
|
|
||||||
|
.data : AT(__DATA_ROM)
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
__DATA_RAM = .;
|
||||||
|
__data_start__ = .; /* create a global symbol at data start */
|
||||||
|
*(.data) /* .data sections */
|
||||||
|
*(.data*) /* .data* sections */
|
||||||
|
KEEP(*(.jcr*))
|
||||||
|
. = ALIGN(4);
|
||||||
|
__data_end__ = .; /* define a global symbol at data end */
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
|
||||||
|
text_end = ORIGIN(m_text) + LENGTH(m_text);
|
||||||
|
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
|
||||||
|
|
||||||
|
/* Uninitialized data section */
|
||||||
|
.bss :
|
||||||
|
{
|
||||||
|
/* This is used by the startup in order to initialize the .bss section */
|
||||||
|
. = ALIGN(4);
|
||||||
|
__START_BSS = .;
|
||||||
|
__bss_start__ = .;
|
||||||
|
*(.bss)
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
__bss_end__ = .;
|
||||||
|
__END_BSS = .;
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
.heap :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
__end__ = .;
|
||||||
|
PROVIDE(end = .);
|
||||||
|
__HeapBase = .;
|
||||||
|
. += HEAP_SIZE;
|
||||||
|
__HeapLimit = .;
|
||||||
|
__heap_limit = .; /* Add for _sbrk */
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
.stack :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
. += STACK_SIZE;
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
|
||||||
|
/* Initializes stack on the end of block */
|
||||||
|
__StackTop = ORIGIN(m_data) + LENGTH(m_data);
|
||||||
|
__StackLimit = __StackTop - STACK_SIZE;
|
||||||
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
|
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||||
|
|
||||||
|
ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
|
||||||
|
}
|
||||||
|
|
235
radio/src/targets/i6/startup/MKL16Z64xxx4_ram.ld
Normal file
235
radio/src/targets/i6/startup/MKL16Z64xxx4_ram.ld
Normal file
|
@ -0,0 +1,235 @@
|
||||||
|
/*
|
||||||
|
** ###################################################################
|
||||||
|
** Processors: MKL16Z64VFM4
|
||||||
|
** MKL16Z64VFT4
|
||||||
|
** MKL16Z64VLH4
|
||||||
|
**
|
||||||
|
** Compiler: GNU C Compiler
|
||||||
|
** Reference manual: KL26P121M48SF4RM Rev. 3.2, October 2013
|
||||||
|
** Version: rev. 1.7, 2015-07-29
|
||||||
|
** Build: b160406
|
||||||
|
**
|
||||||
|
** Abstract:
|
||||||
|
** Linker file for the GNU C Compiler
|
||||||
|
**
|
||||||
|
** Copyright (c) 2016 Freescale Semiconductor, Inc.
|
||||||
|
** All rights reserved.
|
||||||
|
**
|
||||||
|
** Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
** are permitted provided that the following conditions are met:
|
||||||
|
**
|
||||||
|
** o Redistributions of source code must retain the above copyright notice, this list
|
||||||
|
** of conditions and the following disclaimer.
|
||||||
|
**
|
||||||
|
** o Redistributions in binary form must reproduce the above copyright notice, this
|
||||||
|
** list of conditions and the following disclaimer in the documentation and/or
|
||||||
|
** other materials provided with the distribution.
|
||||||
|
**
|
||||||
|
** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived from this
|
||||||
|
** software without specific prior written permission.
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**
|
||||||
|
** http: www.freescale.com
|
||||||
|
** mail: support@freescale.com
|
||||||
|
**
|
||||||
|
** ###################################################################
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Entry Point */
|
||||||
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0200;
|
||||||
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0100;
|
||||||
|
|
||||||
|
/* Specify the memory areas */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
m_interrupts (RX) : ORIGIN = 0x1FFFF800, LENGTH = 0x00000200
|
||||||
|
m_text (RX) : ORIGIN = 0x1FFFFA00, LENGTH = 0x00000600
|
||||||
|
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00001800
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Define output sections */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* The startup code goes first into internal RAM */
|
||||||
|
.interrupts :
|
||||||
|
{
|
||||||
|
__VECTOR_TABLE = .;
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.isr_vector)) /* Startup code */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} > m_interrupts
|
||||||
|
|
||||||
|
__VECTOR_RAM = __VECTOR_TABLE;
|
||||||
|
__RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;
|
||||||
|
|
||||||
|
/* The program code and other data goes into internal RAM */
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.text) /* .text sections (code) */
|
||||||
|
*(.text*) /* .text* sections (code) */
|
||||||
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||||
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||||
|
*(.glue_7) /* glue arm to thumb code */
|
||||||
|
*(.glue_7t) /* glue thumb to arm code */
|
||||||
|
*(.eh_frame)
|
||||||
|
KEEP (*(.init))
|
||||||
|
KEEP (*(.fini))
|
||||||
|
. = ALIGN(4);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.ARM.extab :
|
||||||
|
{
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.ARM :
|
||||||
|
{
|
||||||
|
__exidx_start = .;
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
__exidx_end = .;
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.ctors :
|
||||||
|
{
|
||||||
|
__CTOR_LIST__ = .;
|
||||||
|
/* gcc uses crtbegin.o to find the start of
|
||||||
|
the constructors, so we make sure it is
|
||||||
|
first. Because this is a wildcard, it
|
||||||
|
doesn't matter if the user does not
|
||||||
|
actually link against crtbegin.o; the
|
||||||
|
linker won't look for a file to match a
|
||||||
|
wildcard. The wildcard also means that it
|
||||||
|
doesn't matter which directory crtbegin.o
|
||||||
|
is in. */
|
||||||
|
KEEP (*crtbegin.o(.ctors))
|
||||||
|
KEEP (*crtbegin?.o(.ctors))
|
||||||
|
/* We don't want to include the .ctor section from
|
||||||
|
from the crtend.o file until after the sorted ctors.
|
||||||
|
The .ctor section from the crtend file contains the
|
||||||
|
end of ctors marker and it must be last */
|
||||||
|
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
|
||||||
|
KEEP (*(SORT(.ctors.*)))
|
||||||
|
KEEP (*(.ctors))
|
||||||
|
__CTOR_END__ = .;
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.dtors :
|
||||||
|
{
|
||||||
|
__DTOR_LIST__ = .;
|
||||||
|
KEEP (*crtbegin.o(.dtors))
|
||||||
|
KEEP (*crtbegin?.o(.dtors))
|
||||||
|
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
|
||||||
|
KEEP (*(SORT(.dtors.*)))
|
||||||
|
KEEP (*(.dtors))
|
||||||
|
__DTOR_END__ = .;
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.preinit_array :
|
||||||
|
{
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||||
|
KEEP (*(.preinit_array*))
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.init_array :
|
||||||
|
{
|
||||||
|
PROVIDE_HIDDEN (__init_array_start = .);
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array*))
|
||||||
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
.fini_array :
|
||||||
|
{
|
||||||
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
KEEP (*(.fini_array*))
|
||||||
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
|
} > m_text
|
||||||
|
|
||||||
|
__etext = .; /* define a global symbol at end of code */
|
||||||
|
__DATA_ROM = .; /* Symbol is used by startup for data initialization */
|
||||||
|
|
||||||
|
/* reserve MTB memory at the beginning of m_data */
|
||||||
|
.mtb : /* MTB buffer address as defined by the hardware */
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_mtb_start = .;
|
||||||
|
KEEP(*(.mtb_buf)) /* need to KEEP Micro Trace Buffer as not referenced by application */
|
||||||
|
. = ALIGN(8);
|
||||||
|
_mtb_end = .;
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
.data : AT(__DATA_ROM)
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
__DATA_RAM = .;
|
||||||
|
__data_start__ = .; /* create a global symbol at data start */
|
||||||
|
*(.data) /* .data sections */
|
||||||
|
*(.data*) /* .data* sections */
|
||||||
|
KEEP(*(.jcr*))
|
||||||
|
. = ALIGN(4);
|
||||||
|
__data_end__ = .; /* define a global symbol at data end */
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
|
||||||
|
text_end = ORIGIN(m_text) + LENGTH(m_text);
|
||||||
|
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
|
||||||
|
|
||||||
|
/* Uninitialized data section */
|
||||||
|
.bss :
|
||||||
|
{
|
||||||
|
/* This is used by the startup in order to initialize the .bss section */
|
||||||
|
. = ALIGN(4);
|
||||||
|
__START_BSS = .;
|
||||||
|
__bss_start__ = .;
|
||||||
|
*(.bss)
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
|
__bss_end__ = .;
|
||||||
|
__END_BSS = .;
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
.heap :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
__end__ = .;
|
||||||
|
PROVIDE(end = .);
|
||||||
|
__HeapBase = .;
|
||||||
|
. += HEAP_SIZE;
|
||||||
|
__HeapLimit = .;
|
||||||
|
__heap_limit = .; /* Add for _sbrk */
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
.stack :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
. += STACK_SIZE;
|
||||||
|
} > m_data
|
||||||
|
|
||||||
|
|
||||||
|
/* Initializes stack on the end of block */
|
||||||
|
__StackTop = ORIGIN(m_data) + LENGTH(m_data);
|
||||||
|
__StackLimit = __StackTop - STACK_SIZE;
|
||||||
|
PROVIDE(__stack = __StackTop);
|
||||||
|
|
||||||
|
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||||
|
|
||||||
|
ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
|
||||||
|
}
|
||||||
|
|
391
radio/src/targets/i6/startup/startup_MKL16Z4.s
Normal file
391
radio/src/targets/i6/startup/startup_MKL16Z4.s
Normal file
|
@ -0,0 +1,391 @@
|
||||||
|
/* ---------------------------------------------------------------------------------------*/
|
||||||
|
/* @file: startup_MKL16Z4.s */
|
||||||
|
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
|
||||||
|
/* MKL16Z4 */
|
||||||
|
/* @version: 1.4 */
|
||||||
|
/* @date: 2015-7-29 */
|
||||||
|
/* @build: b151111 */
|
||||||
|
/* ---------------------------------------------------------------------------------------*/
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
|
||||||
|
/* All rights reserved. */
|
||||||
|
/* */
|
||||||
|
/* Redistribution and use in source and binary forms, with or without modification, */
|
||||||
|
/* are permitted provided that the following conditions are met: */
|
||||||
|
/* */
|
||||||
|
/* o Redistributions of source code must retain the above copyright notice, this list */
|
||||||
|
/* of conditions and the following disclaimer. */
|
||||||
|
/* */
|
||||||
|
/* o Redistributions in binary form must reproduce the above copyright notice, this */
|
||||||
|
/* list of conditions and the following disclaimer in the documentation and/or */
|
||||||
|
/* other materials provided with the distribution. */
|
||||||
|
/* */
|
||||||
|
/* o Neither the name of Freescale Semiconductor, Inc. nor the names of its */
|
||||||
|
/* contributors may be used to endorse or promote products derived from this */
|
||||||
|
/* software without specific prior written permission. */
|
||||||
|
/* */
|
||||||
|
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
|
||||||
|
/* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
|
||||||
|
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
|
||||||
|
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
|
||||||
|
/* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
|
||||||
|
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
|
||||||
|
/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
|
||||||
|
/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
|
||||||
|
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
|
||||||
|
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Version: GCC for ARM Embedded Processors */
|
||||||
|
/*****************************************************************************/
|
||||||
|
.syntax unified
|
||||||
|
.arch armv6-m
|
||||||
|
|
||||||
|
.section .isr_vector, "a"
|
||||||
|
.align 2
|
||||||
|
.globl __isr_vector
|
||||||
|
__isr_vector:
|
||||||
|
.long __StackTop /* Top of Stack */
|
||||||
|
.long Reset_Handler /* Reset Handler */
|
||||||
|
.long NMI_Handler /* NMI Handler*/
|
||||||
|
.long HardFault_Handler /* Hard Fault Handler*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long SVC_Handler /* SVCall Handler*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long 0 /* Reserved*/
|
||||||
|
.long PendSV_Handler /* PendSV Handler*/
|
||||||
|
.long SysTick_Handler /* SysTick Handler*/
|
||||||
|
|
||||||
|
/* External Interrupts*/
|
||||||
|
.long DMA0_IRQHandler /* DMA channel 0 transfer complete and error interrupt*/
|
||||||
|
.long DMA1_IRQHandler /* DMA channel 1 transfer complete and error interrupt*/
|
||||||
|
.long DMA2_IRQHandler /* DMA channel 2 transfer complete and error interrupt*/
|
||||||
|
.long DMA3_IRQHandler /* DMA channel 3 transfer complete and error interrupt*/
|
||||||
|
.long Reserved20_IRQHandler /* Reserved interrupt*/
|
||||||
|
.long FTFA_IRQHandler /* FTFA command complete and read collision*/
|
||||||
|
.long LVD_LVW_IRQHandler /* Low-voltage detect, low-voltage warning*/
|
||||||
|
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
|
||||||
|
.long I2C0_IRQHandler /* I2C0 interrupt*/
|
||||||
|
.long I2C1_IRQHandler /* I2C1 interrupt*/
|
||||||
|
.long SPI0_IRQHandler /* SPI0 single interrupt vector for all sources*/
|
||||||
|
.long SPI1_IRQHandler /* SPI1 single interrupt vector for all sources*/
|
||||||
|
.long UART0_IRQHandler /* UART0 status and error*/
|
||||||
|
.long UART1_IRQHandler /* UART1 status and error*/
|
||||||
|
.long UART2_IRQHandler /* UART2 status and error*/
|
||||||
|
.long ADC0_IRQHandler /* ADC0 interrupt*/
|
||||||
|
.long CMP0_IRQHandler /* CMP0 interrupt*/
|
||||||
|
.long TPM0_IRQHandler /* TPM0 single interrupt vector for all sources*/
|
||||||
|
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
|
||||||
|
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
|
||||||
|
.long RTC_IRQHandler /* RTC alarm interrupt*/
|
||||||
|
.long RTC_Seconds_IRQHandler /* RTC seconds interrupt*/
|
||||||
|
.long PIT_IRQHandler /* PIT single interrupt vector for all channels*/
|
||||||
|
.long I2S0_IRQHandler /* I2S0 Single interrupt vector for all sources*/
|
||||||
|
.long Reserved40_IRQHandler /* Reserved interrupt*/
|
||||||
|
.long DAC0_IRQHandler /* DAC0 interrupt*/
|
||||||
|
.long TSI0_IRQHandler /* TSI0 interrupt*/
|
||||||
|
.long MCG_IRQHandler /* MCG interrupt*/
|
||||||
|
.long LPTMR0_IRQHandler /* LPTMR0 interrupt*/
|
||||||
|
.long Reserved45_IRQHandler /* Reserved interrupt*/
|
||||||
|
.long PORTA_IRQHandler /* PORTA pin detect*/
|
||||||
|
.long PORTC_PORTD_IRQHandler /* Single interrupt vector for PORTC and PORTD pin detect*/
|
||||||
|
|
||||||
|
.size __isr_vector, . - __isr_vector
|
||||||
|
|
||||||
|
/* Flash Configuration */
|
||||||
|
.section .FlashConfig, "a"
|
||||||
|
.long 0xFFFFFFFF
|
||||||
|
.long 0xFFFFFFFF
|
||||||
|
.long 0xFFFFFFFF
|
||||||
|
.long 0xFFFFFFFE
|
||||||
|
|
||||||
|
.text
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
/* Reset Handler */
|
||||||
|
|
||||||
|
.thumb_func
|
||||||
|
.align 2
|
||||||
|
.globl Reset_Handler
|
||||||
|
.weak Reset_Handler
|
||||||
|
.type Reset_Handler, %function
|
||||||
|
Reset_Handler:
|
||||||
|
cpsid i /* Mask interrupts */
|
||||||
|
.equ VTOR, 0xE000ED08
|
||||||
|
ldr r0, =VTOR
|
||||||
|
ldr r1, =__isr_vector
|
||||||
|
str r1, [r0]
|
||||||
|
#ifndef __NO_SYSTEM_INIT
|
||||||
|
ldr r0,=SystemInit
|
||||||
|
blx r0
|
||||||
|
#endif
|
||||||
|
/* Loop to copy data from read only memory to RAM. The ranges
|
||||||
|
* of copy from/to are specified by following symbols evaluated in
|
||||||
|
* linker script.
|
||||||
|
* __etext: End of code section, i.e., begin of data sections to copy from.
|
||||||
|
* __data_start__/__data_end__: RAM address range that data should be
|
||||||
|
* copied to. Both must be aligned to 4 bytes boundary. */
|
||||||
|
|
||||||
|
ldr r1, =__etext
|
||||||
|
ldr r2, =__data_start__
|
||||||
|
ldr r3, =__data_end__
|
||||||
|
|
||||||
|
subs r3, r2
|
||||||
|
ble .LC0
|
||||||
|
|
||||||
|
.LC1:
|
||||||
|
subs r3, 4
|
||||||
|
ldr r0, [r1,r3]
|
||||||
|
str r0, [r2,r3]
|
||||||
|
bgt .LC1
|
||||||
|
.LC0:
|
||||||
|
|
||||||
|
#ifdef __STARTUP_CLEAR_BSS
|
||||||
|
/* This part of work usually is done in C library startup code. Otherwise,
|
||||||
|
* define this macro to enable it in this startup.
|
||||||
|
*
|
||||||
|
* Loop to zero out BSS section, which uses following symbols
|
||||||
|
* in linker script:
|
||||||
|
* __bss_start__: start of BSS section. Must align to 4
|
||||||
|
* __bss_end__: end of BSS section. Must align to 4
|
||||||
|
*/
|
||||||
|
ldr r1, =__bss_start__
|
||||||
|
ldr r2, =__bss_end__
|
||||||
|
|
||||||
|
subs r2, r1
|
||||||
|
ble .LC3
|
||||||
|
|
||||||
|
movs r0, 0
|
||||||
|
.LC2:
|
||||||
|
str r0, [r1, r2]
|
||||||
|
subs r2, 4
|
||||||
|
bge .LC2
|
||||||
|
.LC3:
|
||||||
|
#endif
|
||||||
|
cpsie i /* Unmask interrupts */
|
||||||
|
#ifndef __START
|
||||||
|
#define __START _start
|
||||||
|
#endif
|
||||||
|
#ifndef __ATOLLIC__
|
||||||
|
ldr r0,=__START
|
||||||
|
blx r0
|
||||||
|
#else
|
||||||
|
ldr r0,=__libc_init_array
|
||||||
|
blx r0
|
||||||
|
ldr r0,=main
|
||||||
|
bx r0
|
||||||
|
#endif
|
||||||
|
.pool
|
||||||
|
.size Reset_Handler, . - Reset_Handler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak DefaultISR
|
||||||
|
.type DefaultISR, %function
|
||||||
|
DefaultISR:
|
||||||
|
ldr r0, =DefaultISR
|
||||||
|
bx r0
|
||||||
|
.size DefaultISR, . - DefaultISR
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak NMI_Handler
|
||||||
|
.type NMI_Handler, %function
|
||||||
|
NMI_Handler:
|
||||||
|
ldr r0,=NMI_Handler
|
||||||
|
bx r0
|
||||||
|
.size NMI_Handler, . - NMI_Handler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak HardFault_Handler
|
||||||
|
.type HardFault_Handler, %function
|
||||||
|
HardFault_Handler:
|
||||||
|
ldr r0,=HardFault_Handler
|
||||||
|
bx r0
|
||||||
|
.size HardFault_Handler, . - HardFault_Handler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak SVC_Handler
|
||||||
|
.type SVC_Handler, %function
|
||||||
|
SVC_Handler:
|
||||||
|
ldr r0,=SVC_Handler
|
||||||
|
bx r0
|
||||||
|
.size SVC_Handler, . - SVC_Handler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak PendSV_Handler
|
||||||
|
.type PendSV_Handler, %function
|
||||||
|
PendSV_Handler:
|
||||||
|
ldr r0,=PendSV_Handler
|
||||||
|
bx r0
|
||||||
|
.size PendSV_Handler, . - PendSV_Handler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak SysTick_Handler
|
||||||
|
.type SysTick_Handler, %function
|
||||||
|
SysTick_Handler:
|
||||||
|
ldr r0,=SysTick_Handler
|
||||||
|
bx r0
|
||||||
|
.size SysTick_Handler, . - SysTick_Handler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak DMA0_IRQHandler
|
||||||
|
.type DMA0_IRQHandler, %function
|
||||||
|
DMA0_IRQHandler:
|
||||||
|
ldr r0,=DMA0_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size DMA0_IRQHandler, . - DMA0_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak DMA1_IRQHandler
|
||||||
|
.type DMA1_IRQHandler, %function
|
||||||
|
DMA1_IRQHandler:
|
||||||
|
ldr r0,=DMA1_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size DMA1_IRQHandler, . - DMA1_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak DMA2_IRQHandler
|
||||||
|
.type DMA2_IRQHandler, %function
|
||||||
|
DMA2_IRQHandler:
|
||||||
|
ldr r0,=DMA2_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size DMA2_IRQHandler, . - DMA2_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak DMA3_IRQHandler
|
||||||
|
.type DMA3_IRQHandler, %function
|
||||||
|
DMA3_IRQHandler:
|
||||||
|
ldr r0,=DMA3_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size DMA3_IRQHandler, . - DMA3_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak I2C0_IRQHandler
|
||||||
|
.type I2C0_IRQHandler, %function
|
||||||
|
I2C0_IRQHandler:
|
||||||
|
ldr r0,=I2C0_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size I2C0_IRQHandler, . - I2C0_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak I2C1_IRQHandler
|
||||||
|
.type I2C1_IRQHandler, %function
|
||||||
|
I2C1_IRQHandler:
|
||||||
|
ldr r0,=I2C1_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size I2C1_IRQHandler, . - I2C1_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak SPI0_IRQHandler
|
||||||
|
.type SPI0_IRQHandler, %function
|
||||||
|
SPI0_IRQHandler:
|
||||||
|
ldr r0,=SPI0_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size SPI0_IRQHandler, . - SPI0_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak SPI1_IRQHandler
|
||||||
|
.type SPI1_IRQHandler, %function
|
||||||
|
SPI1_IRQHandler:
|
||||||
|
ldr r0,=SPI1_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size SPI1_IRQHandler, . - SPI1_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak UART0_IRQHandler
|
||||||
|
.type UART0_IRQHandler, %function
|
||||||
|
UART0_IRQHandler:
|
||||||
|
ldr r0,=UART0_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size UART0_IRQHandler, . - UART0_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak UART1_IRQHandler
|
||||||
|
.type UART1_IRQHandler, %function
|
||||||
|
UART1_IRQHandler:
|
||||||
|
ldr r0,=UART1_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size UART1_IRQHandler, . - UART1_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak UART2_IRQHandler
|
||||||
|
.type UART2_IRQHandler, %function
|
||||||
|
UART2_IRQHandler:
|
||||||
|
ldr r0,=UART2_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size UART2_IRQHandler, . - UART2_IRQHandler
|
||||||
|
|
||||||
|
.align 1
|
||||||
|
.thumb_func
|
||||||
|
.weak I2S0_IRQHandler
|
||||||
|
.type I2S0_IRQHandler, %function
|
||||||
|
I2S0_IRQHandler:
|
||||||
|
ldr r0,=I2S0_DriverIRQHandler
|
||||||
|
bx r0
|
||||||
|
.size I2S0_IRQHandler, . - I2S0_IRQHandler
|
||||||
|
|
||||||
|
|
||||||
|
/* Macro to define default handlers. Default handler
|
||||||
|
* will be weak symbol and just dead loops. They can be
|
||||||
|
* overwritten by other handlers */
|
||||||
|
.macro def_irq_handler handler_name
|
||||||
|
.weak \handler_name
|
||||||
|
.set \handler_name, DefaultISR
|
||||||
|
.endm
|
||||||
|
|
||||||
|
/* Exception Handlers */
|
||||||
|
def_irq_handler DMA0_DriverIRQHandler
|
||||||
|
def_irq_handler DMA1_DriverIRQHandler
|
||||||
|
def_irq_handler DMA2_DriverIRQHandler
|
||||||
|
def_irq_handler DMA3_DriverIRQHandler
|
||||||
|
def_irq_handler Reserved20_IRQHandler
|
||||||
|
def_irq_handler FTFA_IRQHandler
|
||||||
|
def_irq_handler LVD_LVW_IRQHandler
|
||||||
|
def_irq_handler LLWU_IRQHandler
|
||||||
|
def_irq_handler I2C0_DriverIRQHandler
|
||||||
|
def_irq_handler I2C1_DriverIRQHandler
|
||||||
|
def_irq_handler SPI0_DriverIRQHandler
|
||||||
|
def_irq_handler SPI1_DriverIRQHandler
|
||||||
|
def_irq_handler UART0_DriverIRQHandler
|
||||||
|
def_irq_handler UART1_DriverIRQHandler
|
||||||
|
def_irq_handler UART2_DriverIRQHandler
|
||||||
|
def_irq_handler ADC0_IRQHandler
|
||||||
|
def_irq_handler CMP0_IRQHandler
|
||||||
|
def_irq_handler TPM0_IRQHandler
|
||||||
|
def_irq_handler TPM1_IRQHandler
|
||||||
|
def_irq_handler TPM2_IRQHandler
|
||||||
|
def_irq_handler RTC_IRQHandler
|
||||||
|
def_irq_handler RTC_Seconds_IRQHandler
|
||||||
|
def_irq_handler PIT_IRQHandler
|
||||||
|
def_irq_handler I2S0_DriverIRQHandler
|
||||||
|
def_irq_handler Reserved40_IRQHandler
|
||||||
|
def_irq_handler DAC0_IRQHandler
|
||||||
|
def_irq_handler TSI0_IRQHandler
|
||||||
|
def_irq_handler MCG_IRQHandler
|
||||||
|
def_irq_handler LPTMR0_IRQHandler
|
||||||
|
def_irq_handler Reserved45_IRQHandler
|
||||||
|
def_irq_handler PORTA_IRQHandler
|
||||||
|
def_irq_handler PORTC_PORTD_IRQHandler
|
||||||
|
|
||||||
|
.end
|
17
radio/src/targets/mega2560/CMakeLists.txt
Normal file
17
radio/src/targets/mega2560/CMakeLists.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
option(PWRMANAGE "Pwr Manage" OFF)
|
||||||
|
option(SDCARD "SD card support" ON)
|
||||||
|
set(ARCH AVR)
|
||||||
|
set(MCU atmega2560)
|
||||||
|
string(TOLOWER ${PCB} FLAVOUR)
|
||||||
|
set(EEPROM EEPROM_RLC)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=0)
|
||||||
|
set(GUI_DIR 9x)
|
||||||
|
set(TARGET_DIR mega2560)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
||||||
|
add_definitions(-DPCB${PCB} -DCPUM2560 -DROTARY_ENCODERS=2)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} board_mega2560.cpp)
|
||||||
|
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC})
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/9x/lcd_driver.cpp)
|
||||||
|
if(PWRMANAGE)
|
||||||
|
add_definitions(-DPWRMANAGE)
|
||||||
|
endif()
|
70
radio/src/targets/sky9x/CMakeLists.txt
Normal file
70
radio/src/targets/sky9x/CMakeLists.txt
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
set(ARCH ARM)
|
||||||
|
set(LUA NO)
|
||||||
|
if(PCB STREQUAL 9XRPRO)
|
||||||
|
add_definitions(-Dat91sam3s8 -DREVX)
|
||||||
|
set(FLAVOUR 9xrpro)
|
||||||
|
set(LINKER_SCRIPT targets/sky9x/sam3s8c_flash.ld)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} rtc_driver.cpp)
|
||||||
|
set(BOOTLOADER bootflash8.lbm)
|
||||||
|
elseif(PCB STREQUAL AR9X)
|
||||||
|
add_definitions(-Dat91sam3s8 -DAR9X -DSOFTWARE_VOLUME)
|
||||||
|
set(FLAVOUR ar9x)
|
||||||
|
include_directories(${THIRDPARTY_DIR}/xdk-asf-3.31.0/sam/drivers/twi)
|
||||||
|
set(SRC ${SRC} ${THIRDPARTY_DIR}/xdk-asf-3.31.0/sam/drivers/twi/twi.c)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} i2c_driver.cpp rtc_ds3231_driver.cpp)
|
||||||
|
set(LINKER_SCRIPT targets/sky9x/sam3s8c_flash.ld)
|
||||||
|
set(BOOTLOADER bootflash8.lbm)
|
||||||
|
else()
|
||||||
|
set(FLAVOUR sky9x)
|
||||||
|
option(PCBREV "PCB Revision" REVC)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} coproc_driver.cpp rotenc_driver.cpp rtc_driver.cpp)
|
||||||
|
add_definitions(-DROTARY_ENCODERS=1)
|
||||||
|
set(BOOTLOADER bootflash4.lbm)
|
||||||
|
if(PCBREV STREQUAL REVA)
|
||||||
|
add_definitions(-DDREVA)
|
||||||
|
set(LINKER_SCRIPT targets/sky9x/sam3s2c_flash.ld)
|
||||||
|
elseif(PCBREV STREQUAL REVB)
|
||||||
|
add_definitions(-DDREVB -DCOPROCESSOR)
|
||||||
|
set(LINKER_SCRIPT targets/sky9x/sam3s4c_flash.ld)
|
||||||
|
else()
|
||||||
|
add_definitions(-DDREVC -DCOPROCESSOR)
|
||||||
|
set(LINKER_SCRIPT targets/sky9x/sam3s4c_flash.ld)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
set(MCU cortex-m3)
|
||||||
|
set(SDCARD YES)
|
||||||
|
set(HAPTIC YES)
|
||||||
|
set(EEPROM EEPROM_RAW)
|
||||||
|
set(GUI_DIR 9x)
|
||||||
|
set(TARGET_DIR sky9x)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} 9x_bitmaps)
|
||||||
|
add_definitions(-DPCBSKY9X -DPPM_PIN_SERIAL)
|
||||||
|
add_definitions(-DAUDIO -DVOICE -DRTCLOCK -DVARIO)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=0)
|
||||||
|
set(GUI_SRC ${GUI_SRC} ${9X_GUI_SRC} menu_general_hardware.cpp view_telemetry.cpp view_text.cpp view_about.cpp)
|
||||||
|
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} core_cm3.c board_lowlevel.c crt.c vectors_sam3s.c)
|
||||||
|
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} lcd_driver.cpp pwr_driver.cpp
|
||||||
|
usb/device/core/USBD_UDP.c usb/device/core/USBDDriver.c
|
||||||
|
usb/device/massstorage/MSDDriver.c usb/device/massstorage/MSDDStateMachine.c usb/device/massstorage/MSDLun.c
|
||||||
|
usb/device/massstorage/MSDDriverDescriptors.c usb/device/massstorage/SBCMethods.c usb/common/core/USBEndpointDescriptor.c
|
||||||
|
usb/common/core/USBGenericRequest.c usb/common/core/USBFeatureRequest.c usb/common/core/USBInterfaceRequest.c
|
||||||
|
usb/common/core/USBGetDescriptorRequest.c usb/common/core/USBSetAddressRequest.c usb/common/core/USBSetConfigurationRequest.c
|
||||||
|
usb/common/core/USBConfigurationDescriptor.c usb/common/core/USBGenericDescriptor.c MEDSdcard.c
|
||||||
|
)
|
||||||
|
set(TARGET_SRC
|
||||||
|
${TARGET_SRC}
|
||||||
|
board_sky9x.cpp
|
||||||
|
telemetry_driver.cpp
|
||||||
|
serial2_driver.cpp
|
||||||
|
adc_driver.cpp
|
||||||
|
eeprom_driver.cpp
|
||||||
|
pulses_driver.cpp
|
||||||
|
keys_driver.cpp
|
||||||
|
audio_driver.cpp
|
||||||
|
buzzer_driver.cpp
|
||||||
|
haptic_driver.cpp
|
||||||
|
sdcard_driver.cpp
|
||||||
|
massstorage.cpp
|
||||||
|
)
|
||||||
|
set(SRC ${SRC} debug.cpp)
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} loadboot.cpp)
|
80
radio/src/targets/taranis/CMakeLists.txt
Normal file
80
radio/src/targets/taranis/CMakeLists.txt
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
option(PCBREV "PCB Revision" REVPLUS)
|
||||||
|
option(SHUTDOWN_CONFIRMATION "Shutdown confirmation" OFF)
|
||||||
|
option(LCD_DUAL_BUFFER "Dual LCD Buffer" OFF)
|
||||||
|
option(TARANIS_INTERNAL_PPM "Taranis internal module hack to output PPM" OFF)
|
||||||
|
if(PCBREV STREQUAL REV9E)
|
||||||
|
option(STICKS "Sticks type" STANDARD)
|
||||||
|
set(CPU_TYPE STM32F4)
|
||||||
|
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||||
|
set(HAPTIC YES)
|
||||||
|
set(LUA_EXPORT lua_export_taranis_x9e)
|
||||||
|
set(FLAVOUR taranisx9e)
|
||||||
|
add_definitions(-DSTM32F40_41xxx -DREVPLUS -DREV9E)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=32768)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
top_lcd_driver.cpp
|
||||||
|
bluetooth_driver.cpp
|
||||||
|
startup_stm32f40_41xxx.s
|
||||||
|
)
|
||||||
|
if(STICKS STREQUAL HORUS)
|
||||||
|
add_definitions(-DHORUS_STICKS)
|
||||||
|
endif()
|
||||||
|
elseif(PCBREV STREQUAL REVPLUS)
|
||||||
|
set(CPU_TYPE STM32F2)
|
||||||
|
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||||
|
set(HAPTIC YES)
|
||||||
|
set(LUA_EXPORT lua_export_taranis)
|
||||||
|
set(FLAVOUR taranisplus)
|
||||||
|
add_definitions(-DREVPLUS)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=0)
|
||||||
|
else()
|
||||||
|
set(CPU_TYPE STM32F2)
|
||||||
|
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||||
|
set(HAPTIC NO)
|
||||||
|
set(LUA_EXPORT lua_export_taranis)
|
||||||
|
set(FLAVOUR taranis)
|
||||||
|
add_definitions(-DEEPROM_VARIANT=0)
|
||||||
|
endif()
|
||||||
|
set(HSE_VALUE 12000000)
|
||||||
|
set(SDCARD YES)
|
||||||
|
set(EEPROM EEPROM_RLC)
|
||||||
|
set(GUI_DIR taranis)
|
||||||
|
set(TARGET_DIR taranis)
|
||||||
|
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} taranis_bitmaps)
|
||||||
|
set(VIRTUAL_INPUTS YES)
|
||||||
|
add_definitions(-DPCBTARANIS -DPPM_PIN_TIMER)
|
||||||
|
add_definitions(-DAUDIO -DVOICE -DRTCLOCK)
|
||||||
|
add_definitions(-DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DVARIO)
|
||||||
|
set(GUI_SRC ${GUI_SRC} bmp.cpp menu_model_inputs.cpp menu_model_mixes.cpp menu_model_display.cpp menu_general_diagkeys.cpp menu_general_diaganas.cpp menu_general_hardware.cpp view_channels.cpp view_telemetry.cpp view_text.cpp view_about.cpp)
|
||||||
|
set(TARGET_SRC
|
||||||
|
${TARGET_SRC}
|
||||||
|
board_taranis.cpp
|
||||||
|
extmodule_driver.cpp
|
||||||
|
rtc_driver.cpp
|
||||||
|
)
|
||||||
|
set(FIRMWARE_SRC
|
||||||
|
${FIRMWARE_SRC}
|
||||||
|
loadboot.cpp
|
||||||
|
)
|
||||||
|
set(FIRMWARE_TARGET_SRC
|
||||||
|
${FIRMWARE_TARGET_SRC}
|
||||||
|
lcd_driver.cpp
|
||||||
|
delays.c
|
||||||
|
i2c_driver.cpp
|
||||||
|
usb_driver.c
|
||||||
|
pwr_driver.c
|
||||||
|
configure_pins.cpp
|
||||||
|
flash_driver.cpp
|
||||||
|
aspi.c
|
||||||
|
)
|
||||||
|
if(LCD_DUAL_BUFFER)
|
||||||
|
add_definitions(-DLCD_DUAL_BUFFER)
|
||||||
|
endif()
|
||||||
|
if(TARANIS_INTERNAL_PPM)
|
||||||
|
add_definitions(-DTARANIS_INTERNAL_PPM)
|
||||||
|
endif()
|
||||||
|
if(MIXERS_MONITOR)
|
||||||
|
add_definitions(-DMIXERS_MONITOR)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue