1 option(DISK_CACHE "Enable SD card disk cache" ON)
2 option(UNEXPECTED_SHUTDOWN "Enable the Unexpected Shutdown screen" ON)
3 option(PXX1 "PXX1 protocol support" ON)
4 option(PXX2 "PXX2 protocol support" OFF)
5 option(MULTIMODULE "DIY Multiprotocol TX Module (https://github.com/pascallanger/DIY-Multiprotocol-TX-Module)" ON)
7 set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
9 set(HSE_VALUE 12000000)
14 set(NAVIGATION_TYPE horus)
16 set(LINKER_SCRIPT targets/horus/stm32f4_flash.ld)
17 set(RTC_BACKUP_RAM YES)
19 set(PPM_LIMITS_SYMETRICAL YES)
20 set(USB_SERIAL ON CACHE BOOL "Enable USB serial (CDC)")
22 # for size report script
23 set(CPU_TYPE_FULL STM32F429xI)
24 set(SIZE_TARGET_MEM_DEFINE "MEM_SIZE_SDRAM2=8192")
26 if(SPLASH STREQUAL OFF)
27 message(FATAL_ERROR "Option SPLASH=OFF not supported on Horus")
31 set(PCBREV "STD" CACHE STRING "PCB Revision")
32 add_definitions(-DPCBX10)
33 add_definitions(-DSOFTWARE_VOLUME)
36 ../common/arm/stm32/audio_dac_driver.cpp
37 ../common/arm/stm32/adc_driver.cpp
38 ../common/arm/stm32/sticks_pwm_driver.cpp
40 set(BITMAPS_TARGET x10_bitmaps)
41 set(FONTS_TARGET x10_fonts)
42 set(LCD_DRIVER lcd_driver.cpp)
43 set(LUA_EXPORT lua_export_x10)
45 if (PCBREV STREQUAL EXPRESS)
46 set(FLAVOUR x10express)
47 option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" OFF)
48 option(INTERNAL_MODULE_PXX2 "Support for PXX2 internal module" ON)
50 add_definitions(-DHARDWARE_POWER_MANAGEMENT_UNIT)
51 elseif (PCBREV STREQUAL T16)
53 set(LUA_EXPORT lua_export_t16)
54 add_definitions(-DRADIO_T16)
55 option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" OFF)
56 option(BLUETOOTH "Support for bluetooth module" OFF)
59 option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" ON)
60 option(INTERNAL_MODULE_PXX2 "Support for PXX2 internal module" OFF)
63 elseif (PCB STREQUAL X12S)
64 option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" ON)
65 option(INTERNAL_MODULE_PXX2 "Support for PXX2 internal module" OFF)
68 set(PCBREV "13" CACHE STRING "PCB Revision")
69 if(${PCBREV} GREATER 10)
70 option(INTERNAL_GPS "Internal GPS installed" YES)
72 option(INTERNAL_GPS "Internal GPS installed" NO)
74 message("Horus: Internal GPS is optional, use INTERNAL_GPS=YES option to enable it")
77 set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
78 add_definitions(-DPCBX12S)
85 set(BITMAPS_TARGET x12s_bitmaps)
86 set(FONTS_TARGET x12s_fonts)
87 set(LCD_DRIVER lcd_driver.cpp)
88 set(LUA_EXPORT lua_export_x12s)
91 add_definitions(-DPCBREV=${PCBREV})
92 add_definitions(-DPCBREV_${PCBREV})
94 set(RADIO_DEPENDENCIES
99 set(FIRMWARE_DEPENDENCIES datacopy)
101 add_definitions(-DPCBHORUS -DSTM32F429_439xx -DSDRAM -DCOLORLCD)
102 add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
103 add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
104 add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
106 if(NOT UNEXPECTED_SHUTDOWN)
107 add_definitions(-DNO_UNEXPECTED_SHUTDOWN)
110 if(INTERNAL_MODULE_PXX1)
111 add_definitions(-DHARDWARE_INTERNAL_MODULE)
112 add_definitions(-DINTERNAL_MODULE_PXX1)
115 if(INTERNAL_MODULE_PXX2)
117 add_definitions(-DHARDWARE_INTERNAL_MODULE)
118 add_definitions(-DINTERNAL_MODULE_PXX2)
119 if (NOT PCBREV STREQUAL EXPRESS)
121 add_definitions(-DACCESS_LIB)
125 if(INTERNAL_MODULE_MULTI)
126 add_definitions(-DHARDWARE_INTERNAL_MODULE)
127 add_definitions(-DINTERNAL_MODULE_MULTI)
130 include_directories(${RADIO_SRC_DIRECTORY}/fonts/480x272 gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
132 file(GLOB THEMES_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/480x272 ${RADIO_SRC_DIRECTORY}/gui/480x272/themes/*.cpp)
133 file(GLOB LAYOUTS_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/480x272 ${RADIO_SRC_DIRECTORY}/gui/480x272/layouts/*.cpp)
134 file(GLOB WIDGETS_SRC RELATIVE ${RADIO_SRC_DIRECTORY}/gui/480x272 ${RADIO_SRC_DIRECTORY}/gui/480x272/widgets/*.cpp)
148 view_logical_switches.cpp
163 if(PXX2 OR LUA OR MULTIMODULE)
164 set(GUI_SRC ${GUI_SRC} radio_tools.cpp)
167 if(PXX2 OR MULTIMODULE)
168 set(GUI_SRC ${GUI_SRC} radio_spectrum_analyser.cpp)
172 set(GUI_SRC ${GUI_SRC} radio_power_meter.cpp)
176 set(SRC ${SRC} disk_cache.cpp)
177 add_definitions(-DDISK_CACHE)
181 set(SRC ${SRC} gps.cpp)
182 add_definitions(-DINTERNAL_GPS)
183 message("Horus: Internal GPS enabled")
186 set(GVAR_SCREEN model_gvars.cpp)
193 ../common/arm/stm32/heartbeat_driver.cpp
194 ../common/arm/stm32/timers_driver.cpp
195 ../common/arm/stm32/intmodule_serial_driver.cpp
196 ../common/arm/stm32/rotary_encoder_driver.cpp
200 add_definitions(-DBLUETOOTH)
201 set(TARGET_SRC ${TARGET_SRC} ../common/arm/stm32/bluetooth_driver.cpp)
202 set(SRC ${SRC} bluetooth.cpp)
205 set(FIRMWARE_TARGET_SRC
206 ${FIRMWARE_TARGET_SRC}
212 startup_stm32f42_43xxx.s
213 ../common/arm/stm32/sdio_sd.c
214 ../common/arm/loadboot.cpp
219 io/frsky_firmware_update.cpp
220 io/multi_firmware_update.cpp
224 STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
225 STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c
226 STM32F4xx_StdPeriph_Driver/src/stm32f4xx_ltdc.c
227 STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c
228 STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma2d.c
231 if(PYTHONINTERP_FOUND)
233 OUTPUT ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp
234 WORKING_DIRECTORY ${RADIO_DIRECTORY}/src
235 COMMAND ${PYTHON_EXECUTABLE} ${RADIO_DIRECTORY}/util/generate_datacopy.py datastructs.h -DPCBHORUS -DPCBX10 -DCPUARM -DCOLORLCD -DBACKUP -Itargets/horus > ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp
236 DEPENDS ${RADIO_DIRECTORY}/src/datastructs.h ${RADIO_DIRECTORY}/util/generate_datacopy.py
238 add_custom_target(datacopy
239 DEPENDS ${PROJECT_BINARY_DIR}/radio/src/datacopy.cpp