Switch to CMake
@@ -0,0 +1,569 @@
|
||||
option(PCB "Radio type")
|
||||
option(HELI "Heli menu" ON)
|
||||
option(FLIGHT_MODES "Flight Modes" ON)
|
||||
option(CURVES "Curves" ON)
|
||||
option(GVARS "Global variables")
|
||||
option(LUA "Lua scripts")
|
||||
option(GUI "GUI enabled" ON)
|
||||
option(SPLASH "Splash enabled" ON)
|
||||
option(PPM_UNIT "PPM display unit (US/PERCENT_PREC1/PERCENT_PREC0)" PERCENT_PREC0)
|
||||
option(PPM_CENTER_ADJUSTABLE "PPM center adjustable" OFF)
|
||||
option(PPM_LIMITS_SYMETRICAL "PPM limits symetrical" OFF)
|
||||
option(OVERRIDE_CHANNEL_FUNCTION "OverrideChannel function available" OFF)
|
||||
option(DANGEROUS_MODULE_FUNCTIONS "Dangerous module functions (RangeCheck / Bind / Module OFF, etc.) available" OFF)
|
||||
option(FAI "Competition mode (no telemetry)" OFF)
|
||||
option(AUTOSOURCE "Automatic source detection in menus" ON)
|
||||
option(AUTOSWITCH "Automatic switch detection in menus" ON)
|
||||
|
||||
set(OPT s)
|
||||
|
||||
enable_language(ASM)
|
||||
|
||||
set(THIRDPARTY_DIR thirdparty)
|
||||
set(LUA_DIR ${THIRDPARTY_DIR}/Lua/src)
|
||||
set(COOS_DIR ${THIRDPARTY_DIR}/CoOS)
|
||||
set(FATFS_DIR ${THIRDPARTY_DIR}/FatFs)
|
||||
set(RADIO_BIN_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_subdirectory(translations)
|
||||
add_subdirectory(bitmaps/9x)
|
||||
add_subdirectory(bitmaps/taranis)
|
||||
add_subdirectory(bitmaps/horus)
|
||||
add_subdirectory(lua)
|
||||
|
||||
set(FIRMWARE_DEPENDENCIES firmware_translations)
|
||||
|
||||
if(PCB STREQUAL HORUS)
|
||||
include_directories(${RADIO_SRC_DIRECTORY}/fonts/horus)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(HSE_VALUE 12000000)
|
||||
set(GUI_DIR horus)
|
||||
set(TARGET_DIR horus)
|
||||
set(SDCARD YES)
|
||||
set(LINKER_SCRIPT targets/horus/stm32f4_flash.ld)
|
||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} horus_bitmaps)
|
||||
set(LUA_EXPORT lua_export_horus)
|
||||
add_definitions(-DFLAVOUR="horus")
|
||||
add_definitions(-DPCBHORUS -DCOLORLCD -DSTM32F429_439xx)
|
||||
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
||||
add_definitions(-DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DVARIO)
|
||||
set(EEPROM SDCARD)
|
||||
set(HAPTIC YES)
|
||||
set(SRC ${SRC} bmp.cpp debug.cpp)
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
curves.cpp
|
||||
bitmaps.cpp
|
||||
view_channels.cpp
|
||||
view_about.cpp
|
||||
view_text.cpp
|
||||
view_telemetry.cpp # TODO remove it
|
||||
)
|
||||
set(SRC ${SRC} targets/taranis/rtc_driver.cpp)
|
||||
set(TARGET_SRC ${TARGET_SRC} board_horus.cpp)
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
sdio_sd.c
|
||||
lcd_driver.cpp
|
||||
delays.c
|
||||
i2c_driver.cpp
|
||||
usb_driver.c
|
||||
pwr_driver.c
|
||||
sdram_driver.c
|
||||
led_driver.cpp
|
||||
)
|
||||
set(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
|
||||
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
|
||||
)
|
||||
elseif(PCB STREQUAL TARANIS)
|
||||
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)
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f4_flash.ld)
|
||||
add_definitions(-DSTM32F40_41xxx -DEEPROM_VARIANT=32768)
|
||||
add_definitions(-DREVPLUS -DREV9E)
|
||||
add_definitions(-DFLAVOUR="taranis-x9e")
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_taranis_x9e)
|
||||
elseif(PCBREV STREQUAL REVPLUS)
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
add_definitions(-DEEPROM_VARIANT=0)
|
||||
add_definitions(-DREVPLUS)
|
||||
add_definitions(-DFLAVOUR="taranis-plus")
|
||||
set(HAPTIC YES)
|
||||
set(LUA_EXPORT lua_export_taranis)
|
||||
else()
|
||||
set(CPU_TYPE STM32F2)
|
||||
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
|
||||
add_definitions(-DEEPROM_VARIANT=0)
|
||||
add_definitions(-DFLAVOUR="taranis")
|
||||
set(HAPTIC NO)
|
||||
set(LUA_EXPORT lua_export_taranis)
|
||||
endif()
|
||||
set(HSE_VALUE 12000000)
|
||||
add_definitions(-DPCBTARANIS)
|
||||
add_definitions(-DAUDIO -DVOICE -DRTCLOCK)
|
||||
add_definitions(-DDBLKEYS -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DVARIO)
|
||||
set(EEPROM EEPROM_RLC)
|
||||
set(GUI_DIR taranis)
|
||||
set(TARGET_DIR taranis)
|
||||
set(SDCARD YES)
|
||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} taranis_bitmaps)
|
||||
set(SRC ${SRC} bmp.cpp debug.cpp)
|
||||
set(GUI_SRC ${GUI_SRC} 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 rtc_driver.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()
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown PCB '${PCB}'")
|
||||
endif()
|
||||
|
||||
if(CPU_TYPE STREQUAL STM32F4)
|
||||
set(MCU cortex-m4)
|
||||
set(CPU_FAMILY STM32)
|
||||
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)
|
||||
set(STM32LIB_SRC
|
||||
${STM32LIB_SRC}
|
||||
CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
||||
)
|
||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} system_stm32f4xx.c)
|
||||
endif()
|
||||
|
||||
if(CPU_TYPE STREQUAL STM32F2)
|
||||
set(MCU cortex-m3)
|
||||
set(CPU_FAMILY STM32)
|
||||
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()
|
||||
|
||||
if(CPU_FAMILY STREQUAL STM32)
|
||||
option(USB "USB option (JOYSTICK/MASSSTORAGE/SERIAL)" JOYSTICK)
|
||||
set(ARCH ARM)
|
||||
set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.1.0/Libraries)
|
||||
add_definitions(-DCPUSTM32)
|
||||
add_definitions(-DFRSKY -DFRSKY_SPORT -DFRSKY_HUB -DGPS -DPXX -DDSM2 -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(${EEPROM} STREQUAL SDCARD)
|
||||
set(SRC ${SRC} storage/storage_common.cpp storage/sdcard_raw.cpp)
|
||||
elseif(${EEPROM} STREQUAL EEPROM_RLC)
|
||||
set(SRC ${SRC} storage/storage_common.cpp storage/eeprom_common.cpp storage/eeprom_rlc.cpp storage/eeprom_conversions.cpp)
|
||||
add_definitions(-DEEPROM -DEEPROM_RLC)
|
||||
else()
|
||||
set(SRC ${SRC} storage/storage_common.cpp storage/eeprom_common.cpp storage/eeprom_raw.cpp storage/eeprom_conversions.cpp)
|
||||
add_definitions(-DEEPROM)
|
||||
endif()
|
||||
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()
|
||||
set(FIRMWARE_SRC
|
||||
${FIRMWARE_SRC}
|
||||
serial.cpp
|
||||
${FATFS_DIR}/ff.c
|
||||
${FATFS_DIR}/fattime.c
|
||||
${FATFS_DIR}/option/ccsbcs.c
|
||||
${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
|
||||
syscalls.c
|
||||
targets/taranis/configure_pins.cpp
|
||||
)
|
||||
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()
|
||||
endif()
|
||||
|
||||
if(ARCH STREQUAL ARM)
|
||||
option(TIMERS "Timers count" 2)
|
||||
option(SPORT_FILE_LOG "S.PORT Logs on SD card" OFF)
|
||||
option(TRACE_SD_CARD "SD Logs" OFF)
|
||||
option(TRACE_FATFS "FatFS Logs" OFF)
|
||||
option(TRACE_AUDIO "Audio Logs" OFF)
|
||||
option(DEBUG_TRACE_BUFFER "Debug Trace Screen" OFF)
|
||||
option(SUPPORT_D16_EU_ONLY "XJT module only supports D16-EU and LR12-EU" OFF) # TODO rename to XJT_EU_ONLY
|
||||
if(TIMERS EQUAL 3)
|
||||
add_definitions(-DTIMERS=3)
|
||||
else()
|
||||
add_definitions(-DTIMERS=2)
|
||||
endif()
|
||||
if(SPORT_FILE_LOG)
|
||||
add_definitions(-DSPORT_FILE_LOG)
|
||||
endif()
|
||||
if(TRACE_SD_CARD)
|
||||
add_definitions(-DTRACE_SD_CARD)
|
||||
# DEBUG = YES
|
||||
# DEBUG_TRACE_BUFFER = YES
|
||||
endif()
|
||||
if(TRACE_FATFS)
|
||||
add_definitions(-DTRACE_FATFS)
|
||||
# DEBUG = YES
|
||||
# DEBUG_TRACE_BUFFER = YES
|
||||
endif()
|
||||
if(TRACE_AUDIO)
|
||||
add_definitions(-DTRACE_AUDIO)
|
||||
# DEBUG = YES
|
||||
# DEBUG_TRACE_BUFFER = YES
|
||||
endif()
|
||||
if(DEBUG_TRACE_BUFFER)
|
||||
add_definitions(-DDEBUG_TRACE_BUFFER)
|
||||
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()
|
||||
add_definitions(-DCPUARM)
|
||||
include_directories(targets/${TARGET_DIR} ${THIRDPARTY_DIR})
|
||||
include_directories(${COOS_DIR} ${COOS_DIR}/kernel ${COOS_DIR}/portable)
|
||||
foreach(LANGUAGE cz de en es fr it pt sk se pl hu) # TODO add nl
|
||||
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
|
||||
string(TOUPPER LANGUAGE_UPPER LANGUAGE)
|
||||
if(TRANSLATIONS STREQUAL LANGUAGE_CAPITALIZED)
|
||||
add_definitions(-DTRANSLATIONS_${LANGUAGE_UPPER})
|
||||
endif()
|
||||
endforeach()
|
||||
set(SRC
|
||||
${SRC}
|
||||
main_arm.cpp
|
||||
tasks_arm.cpp
|
||||
audio_arm.cpp
|
||||
sbus.cpp
|
||||
telemetry/telemetry.cpp
|
||||
telemetry/frsky.cpp
|
||||
telemetry/frsky_d_arm.cpp
|
||||
telemetry/frsky_sport.cpp
|
||||
telemetry/telemetry.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(PULSES_SRC
|
||||
pulses_arm.cpp
|
||||
ppm_arm.cpp
|
||||
pxx_arm.cpp
|
||||
dsm2_arm.cpp
|
||||
crossfire.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/bitmaps/${GUI_DIR})
|
||||
|
||||
if(NOT LUA STREQUAL OFF)
|
||||
add_definitions(-DLUA)
|
||||
include_directories(${LUA_DIR})
|
||||
set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} ${LUA_EXPORT})
|
||||
if(LUA STREQUAL ON)
|
||||
add_definitions(-DLUA_MODEL_SCRIPTS)
|
||||
set(GUI_SRC ${GUI_SRC} menu_model_custom_scripts.cpp)
|
||||
endif()
|
||||
set(SRC ${SRC} lua/interface.cpp lua/api_general.cpp lua/api_lcd.cpp lua/api_model.cpp)
|
||||
set(LUA_SRC
|
||||
lapi.c
|
||||
lcode.c
|
||||
lctype.c
|
||||
ldebug.c
|
||||
ldo.c
|
||||
ldump.c
|
||||
lfunc.c
|
||||
lgc.c
|
||||
llex.c
|
||||
lmem.c
|
||||
lobject.c
|
||||
lopcodes.c
|
||||
lparser.c
|
||||
lstate.c
|
||||
lstring.c
|
||||
ltable.c
|
||||
lrotable.c
|
||||
ltm.c
|
||||
lundump.c
|
||||
lvm.c
|
||||
lzio.c
|
||||
lbaselib.c
|
||||
linit.c
|
||||
lmathlib.c
|
||||
lbitlib.c
|
||||
loadlib.c
|
||||
lauxlib.c
|
||||
ltablib.c
|
||||
lcorolib.c
|
||||
liolib.c
|
||||
lstrlib.c
|
||||
)
|
||||
foreach(FILE ${LUA_SRC})
|
||||
set(SRC ${SRC} ${LUA_DIR}/${FILE})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(HELI)
|
||||
add_definitions(-DHELI)
|
||||
set(GUI_SRC ${GUI_SRC} menu_model_heli.cpp)
|
||||
endif()
|
||||
|
||||
if(FLIGHT_MODES)
|
||||
add_definitions(-DFLIGHT_MODES)
|
||||
set(GUI_SRC ${GUI_SRC} menu_model_flightmodes.cpp)
|
||||
endif()
|
||||
|
||||
if(CURVES)
|
||||
add_definitions(-DCURVES)
|
||||
set(GUI_SRC ${GUI_SRC} menu_model_curves.cpp)
|
||||
endif()
|
||||
|
||||
if(GVARS)
|
||||
add_definitions(-DGVARS)
|
||||
set(GUI_SRC ${GUI_SRC} menu_model_gvars.cpp)
|
||||
endif()
|
||||
|
||||
if(FAI STREQUAL YES)
|
||||
add_definitions(-DFAI)
|
||||
elseif(FAI STREQUAL CHOICE)
|
||||
add_definitions(-DFAI_CHOICE)
|
||||
endif()
|
||||
|
||||
if(AUTOSOURCE)
|
||||
add_definitions(-DAUTOSOURCE)
|
||||
endif()
|
||||
|
||||
if(AUTOSWITCH)
|
||||
add_definitions(-DAUTOSWITCH)
|
||||
endif()
|
||||
|
||||
if(SDCARD STREQUAL YES)
|
||||
add_definitions(-DSDCARD)
|
||||
set(SRC ${SRC} sdcard.cpp rtc.cpp logs.cpp)
|
||||
set(GUI_SRC ${GUI_SRC} menu_general_sdmanager.cpp)
|
||||
include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
|
||||
endif()
|
||||
|
||||
if(SHUTDOWN_CONFIRMATION)
|
||||
add_definitions(-DSHUTDOWN_CONFIRMATION)
|
||||
endif()
|
||||
|
||||
if(PPM_UNIT STREQUAL US)
|
||||
add_definitions(-DPPM_UNIT_US)
|
||||
elseif(PPM_UNIT STREQUAL PERCENT_PREC1)
|
||||
add_definitions(-DPPM_UNIT_PERCENT_PREC1)
|
||||
else()
|
||||
add_definitions(-DPPM_UNIT_PERCENT_PREC0)
|
||||
endif()
|
||||
|
||||
if(PPM_CENTER_ADJUSTABLE)
|
||||
add_definitions(-DPPM_CENTER_ADJUSTABLE)
|
||||
endif()
|
||||
|
||||
if(PPM_LIMITS_SYMETRICAL)
|
||||
add_definitions(-DPPM_LIMITS_SYMETRICAL)
|
||||
endif()
|
||||
|
||||
if(OVERRIDE_CHANNEL_FUNCTION)
|
||||
add_definitions(-DOVERRIDE_CHANNEL_FUNCTION)
|
||||
endif()
|
||||
|
||||
if(DANGEROUS_MODULE_FUNCTIONS)
|
||||
add_definitions(-DDANGEROUS_MODULE_FUNCTIONS)
|
||||
endif()
|
||||
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
lcd.cpp
|
||||
splash.cpp
|
||||
fonts.cpp
|
||||
helpers.cpp
|
||||
navigation.cpp
|
||||
popups.cpp
|
||||
widgets.cpp
|
||||
menus.cpp
|
||||
)
|
||||
|
||||
set(GUI_SRC
|
||||
${GUI_SRC}
|
||||
menu_model.cpp
|
||||
menu_model_select.cpp
|
||||
menu_model_setup.cpp
|
||||
menu_model_inputs_mixes.cpp
|
||||
menu_model_limits.cpp
|
||||
menu_model_logical_switches.cpp
|
||||
menu_model_custom_functions.cpp
|
||||
menu_model_telemetry.cpp
|
||||
menu_general.cpp
|
||||
menu_general_setup.cpp
|
||||
menu_general_trainer.cpp
|
||||
menu_general_version.cpp
|
||||
menu_general_calib.cpp
|
||||
view_main.cpp
|
||||
view_statistics.cpp
|
||||
)
|
||||
|
||||
set(SRC
|
||||
${SRC}
|
||||
opentx.cpp
|
||||
functions.cpp
|
||||
strhelpers.cpp
|
||||
switches.cpp
|
||||
curves.cpp
|
||||
mixer.cpp
|
||||
stamp.cpp
|
||||
timers.cpp
|
||||
trainer_input.cpp
|
||||
)
|
||||
|
||||
if(SPLASH)
|
||||
add_definitions(-DSPLASH)
|
||||
endif()
|
||||
|
||||
if(GUI)
|
||||
add_definitions(-DGUI)
|
||||
set(SRC
|
||||
${SRC}
|
||||
keys.cpp
|
||||
maths.cpp
|
||||
translations.cpp
|
||||
gui/gui_helpers.cpp
|
||||
)
|
||||
foreach(FILE ${GUI_SRC})
|
||||
set(SRC ${SRC} gui/${GUI_DIR}/${FILE})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach(FILE ${TARGET_SRC})
|
||||
set(SRC ${SRC} targets/${TARGET_DIR}/${FILE})
|
||||
endforeach()
|
||||
|
||||
foreach(FILE ${FIRMWARE_TARGET_SRC})
|
||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/${TARGET_DIR}/${FILE})
|
||||
endforeach()
|
||||
|
||||
foreach(FILE ${PULSES_SRC})
|
||||
set(SRC ${SRC} pulses/${FILE})
|
||||
endforeach()
|
||||
|
||||
add_subdirectory(targets/simu)
|
||||
|
||||
include(CMakeForceCompiler)
|
||||
cmake_force_c_compiler(arm-none-eabi-gcc GNU)
|
||||
cmake_force_cxx_compiler(arm-none-eabi-gcc GNU)
|
||||
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -o <OBJECT> <SOURCE>")
|
||||
|
||||
set(COMMON_FLAGS "-mcpu=${MCU} -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=opentx.lst -DRUN_FROM_FLASH=1 -O${OPT} -gdwarf-2 -DHSE_VALUE=${HSE_VALUE} -Wall -fno-exceptions -Wno-strict-aliasing -Wformat -Wreturn-type -Wunused -Wuninitialized -Wunknown-pragmas -Wno-switch -Wtype-limits -fdata-sections -ffunction-sections")
|
||||
set(CMAKE_C_FLAGS "${COMMON_FLAGS} -Wimplicit")
|
||||
set(CMAKE_CXX_FLAGS "${COMMON_FLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-mcpu=${MCU} -mthumb -nostartfiles -lm -T${RADIO_SRC_DIRECTORY}/${LINKER_SCRIPT} -Wl,-Map=opentx.map,--cref,--no-warn-mismatch,--gc-sections")
|
||||
|
||||
add_executable(firmware ${SRC} ${FIRMWARE_SRC})
|
||||
add_dependencies(firmware ${FIRMWARE_DEPENDENCIES})
|
||||
@@ -444,7 +444,7 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
|
||||
OPT = s
|
||||
SDCARD = NO
|
||||
THR_TRACE = NO
|
||||
INCDIRS += targets/9x
|
||||
INCDIRS += targets/9x bitmaps bitmaps/9x
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM64 -DEEPROM -DEEPROM_RLC -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
BOARDSRC = main_avr.cpp targets/9x/board_stock.cpp
|
||||
EXTRABOARDSRC = targets/common_avr/adc_driver.cpp targets/common_avr/telemetry_driver.cpp
|
||||
@@ -527,7 +527,7 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
|
||||
THR_TRACE = NO
|
||||
EEPROM_VARIANT += ${M128_VARIANT}
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM -DEEPROM_RLC -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
INCDIRS += targets/9x
|
||||
INCDIRS += targets/9x bitmaps bitmaps/9x
|
||||
BOARDSRC = main_avr.cpp targets/9x/board_stock.cpp
|
||||
EXTRABOARDSRC = targets/common_avr/adc_driver.cpp targets/9x/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
||||
EEPROMSRC = storage/storage_common.cpp storage/eeprom_common.cpp storage/eeprom_rlc.cpp
|
||||
@@ -602,7 +602,7 @@ ifeq ($(PCB), $(filter $(PCB), 9X2561))
|
||||
THR_TRACE = YES
|
||||
EEPROM_VARIANT += ${M2561_VARIANT}
|
||||
CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM2561 -DEEPROM -DEEPROM_RLC -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc)
|
||||
INCDIRS += targets/9x
|
||||
INCDIRS += targets/9x bitmaps bitmaps/9x
|
||||
BOARDSRC = main_avr.cpp targets/9x/board_stock.cpp
|
||||
EXTRABOARDSRC = targets/common_avr/adc_driver.cpp targets/9x/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
||||
EEPROMSRC = storage/storage_common.cpp storage/eeprom_common.cpp storage/eeprom_rlc.cpp
|
||||
@@ -675,7 +675,7 @@ ifeq ($(PCB), GRUVIN9X)
|
||||
SDCARD = NO
|
||||
BUZZER = NO
|
||||
THR_TRACE = YES
|
||||
INCDIRS += targets/gruvin9x targets/9x $(FATFSDIR) $(FATFSDIR)/option
|
||||
INCDIRS += targets/gruvin9x targets/9x bitmaps bitmaps/9x $(FATFSDIR) $(FATFSDIR)/option
|
||||
BOARDSRC = main_avr.cpp targets/gruvin9x/board_gruvin9x.cpp
|
||||
EXTRABOARDSRC = targets/common_avr/adc_driver.cpp targets/9x/lcd_driver.cpp targets/common_avr/telemetry_driver.cpp
|
||||
EEPROMSRC = storage/storage_common.cpp storage/eeprom_common.cpp storage/eeprom_rlc.cpp
|
||||
@@ -721,7 +721,7 @@ ifeq ($(PCB), MEGA2560)
|
||||
BUZZER = YES
|
||||
THR_TRACE = YES
|
||||
PWRMANAGE = NO
|
||||
INCDIRS += targets/mega2560 targets/9x $(FATFSDIR) $(FATFSDIR)/option
|
||||
INCDIRS += targets/mega2560 targets/9x bitmaps bitmaps/9x $(FATFSDIR) $(FATFSDIR)/option
|
||||
BOARDSRC = main_avr.cpp targets/mega2560/board_mega2560.cpp
|
||||
EEPROMSRC = storage/storage_common.cpp storage/eeprom_common.cpp storage/eeprom_rlc.cpp
|
||||
PULSESSRC = pulses/pulses_avr.cpp
|
||||
@@ -817,7 +817,7 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO AR9X))
|
||||
ifeq ($(SPORT_FILE_LOG), YES)
|
||||
CPPDEFS += -DSPORT_FILE_LOG
|
||||
endif
|
||||
INCDIRS += targets/sky9x $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
INCDIRS += targets/sky9x bitmaps bitmaps/9x $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
GUIGENERALSRC += gui/$(GUIDIRECTORY)/menu_general_hardware.cpp gui/$(GUIDIRECTORY)/menu_general_diagkeys.cpp gui/$(GUIDIRECTORY)/menu_general_diaganas.cpp
|
||||
BOARDSRC = main_arm.cpp targets/sky9x/board_sky9x.cpp
|
||||
EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp
|
||||
@@ -935,7 +935,7 @@ ifeq ($(PCB), TARANIS)
|
||||
PPM_CENTER_ADJUSTABLE = YES
|
||||
DSM2 = PPM
|
||||
CPPDEFS += -DPCBTARANIS -DCPUARM -DCPUSTM32 -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM -DEEPROM_RLC -DAUDIO -DPXX -DSBUS -DCROSSFIRE
|
||||
INCDIRS += targets/taranis $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
INCDIRS += targets/taranis bitmaps bitmaps/taranis $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
CPPDEFS += -DHSE_VALUE=12000000
|
||||
ifeq ($(PCBREV), REV9E)
|
||||
STM32LIBPATH = $(THIRDPARTY)/STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries
|
||||
@@ -1100,7 +1100,7 @@ ifeq ($(PCB), FLAMENCO)
|
||||
TIMERS = 2
|
||||
CPPDEFS += -DTIMERS=$(TIMERS)
|
||||
CPPDEFS += -DPCBFLAMENCO -DCPUARM -DCPUSTM32 -DEEPROM -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM_VARIANT=0 -DAUDIO -DPXX
|
||||
INCDIRS += targets/flamenco $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
INCDIRS += targets/flamenco bitmaps/flamenco $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
INCDIRS += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/inc $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Include $(STM32LIBPATH)/CMSIS/include
|
||||
STM32USBPATH = $(THIRDPARTY)/STM32_USB-Host-Device_Lib_V2.1.0/Libraries
|
||||
INCDIRS += $(STM32USBPATH)/STM32_USB_OTG_Driver/inc
|
||||
@@ -1223,7 +1223,7 @@ ifeq ($(PCB), HORUS)
|
||||
TIMERS = 2
|
||||
CPPDEFS += -DTIMERS=$(TIMERS)
|
||||
CPPDEFS += -DPCBHORUS -DCPUARM -DCPUSTM32 -DVIRTUALINPUTS -DLUAINPUTS -DXCURVES -DEEPROM_VARIANT=0 -DAUDIO -DPXX
|
||||
INCDIRS += targets/horus $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
INCDIRS += targets/horus bitmaps/horus fonts/horus $(THIRDPARTY) $(COOSDIR) $(COOSDIR)/kernel $(COOSDIR)/portable
|
||||
INCDIRS += $(STM32LIBPATH)/STM32F4xx_StdPeriph_Driver/inc $(STM32LIBPATH)/CMSIS/Device/ST/STM32F4xx/Include $(STM32LIBPATH)/CMSIS/include
|
||||
STM32USBPATH = $(THIRDPARTY)/STM32_USB-Host-Device_Lib_V2.1.0/Libraries
|
||||
INCDIRS += $(STM32USBPATH)/STM32_USB_OTG_Driver/inc
|
||||
@@ -2026,7 +2026,7 @@ ifeq ($(SIMU_DISKIO), YES)
|
||||
endif
|
||||
|
||||
simu: $(LUADEP) stamp.h allsimusrc.cpp Makefile simu.cpp targets/simu/simpgmspace.cpp *.h tra lbm eeprom.bin
|
||||
g++ $(CPPFLAGS) $(SIMUCPPFLAGS) $(INCFLAGS) simu.cpp allsimusrc.cpp $(LUASRC) targets/simu/simpgmspace.cpp -MD $(SIMUDEFS) -O0 -o simu $(FOXINC) $(FOXLIB) $(AUDIOINC) $(AUDIOLIB) -pthread -fexceptions
|
||||
gcc $(CPPFLAGS) $(SIMUCPPFLAGS) $(INCFLAGS) simu.cpp allsimusrc.cpp $(LUASRC) targets/simu/simpgmspace.cpp -MD $(SIMUDEFS) -O0 -o simu $(FOXINC) $(FOXLIB) $(AUDIOINC) $(AUDIOLIB) -pthread -fexceptions -lstdc++ -lm
|
||||
|
||||
eeprom.bin:
|
||||
dd if=/dev/zero of=$@ bs=1 count=2048
|
||||
@@ -2203,5 +2203,5 @@ gtest-all.o : $(GTEST_SRCS)
|
||||
GTEST_TESTS_SRCS = $(shell find tests/ -type f -name '*.cpp')
|
||||
|
||||
gtests: allsimusrc.cpp $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp *.h tests/gtests.h gtest-all.o
|
||||
g++ -std=gnu++0x $(CPPFLAGS) $(SIMUCPPFLAGS) allsimusrc.cpp $(LUASRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp ${INCFLAGS} -I$(GTEST_INCDIR) -I/usr/include/qt4 -o gtests -lpthread -MD -DSIMU -lQtCore -lQtGui gtest-all.o -fexceptions
|
||||
gcc -std=gnu++0x $(CPPFLAGS) $(SIMUCPPFLAGS) allsimusrc.cpp $(LUASRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp ${INCFLAGS} -I$(GTEST_INCDIR) -I/usr/include/qt4 -o gtests -lpthread -MD -DSIMU -lQtCore -lQtGui gtest-all.o -fexceptions -lstdc++ -lm
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ enum AutomaticPromptsEvents {
|
||||
};
|
||||
|
||||
void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
void playModelName();
|
||||
|
||||
#define I18N_PLAY_FUNCTION(lng, x, ...) void lng ## _ ## x(__VA_ARGS__, uint8_t id)
|
||||
#define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
add_bitmaps_target(9x_xbm_1bit ${RADIO_SRC_DIRECTORY}/bitmaps/*.xbm 128 1bit)
|
||||
add_bitmaps_target(9x_fonts_1bit ${RADIO_SRC_DIRECTORY}/fonts/std/*.png 128 "")
|
||||
add_bitmaps_target(9x_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/9x/*.png 128 1bit)
|
||||
add_dependencies(9x_bitmaps 9x_fonts_1bit 9x_xbm_1bit)
|
||||
@@ -0,0 +1,12 @@
|
||||
add_truetype_font_target(horus tinsize "DejaVu Sans" 9)
|
||||
add_truetype_font_target(horus smlsize "DejaVu Sans" 13)
|
||||
add_truetype_font_target(horus stdsize "DejaVu Sans" 16)
|
||||
add_truetype_font_target(horus midsize "DejaVu Sans" 24)
|
||||
add_truetype_font_target(horus dblsize "DejaVu Sans" 32)
|
||||
add_truetype_font_target(horus xxlsize "DejaVu Sans" 48)
|
||||
|
||||
add_bitmaps_target(horus_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/horus/????[^_]*.png" 480 5/6/5/8)
|
||||
add_bitmaps_target(horus_masks ${RADIO_SRC_DIRECTORY}/bitmaps/horus/mask_*.png 480 8bits)
|
||||
add_bitmaps_target(horus_fonts ${RADIO_SRC_DIRECTORY}/fonts/horus/*.png 480 8bits)
|
||||
add_dependencies(horus_fonts ttf_horus_tinsize ttf_horus_smlsize ttf_horus_stdsize ttf_horus_midsize ttf_horus_dblsize ttf_horus_xxlsize)
|
||||
add_dependencies(horus_bitmaps horus_masks horus_fonts)
|
||||
@@ -0,0 +1,4 @@
|
||||
add_bitmaps_target(taranis_xbm_1bit ${RADIO_SRC_DIRECTORY}/bitmaps/*.xbm 128 1bit)
|
||||
add_bitmaps_target(taranis_fonts_1bit ${RADIO_SRC_DIRECTORY}/fonts/std/*.png 128 "")
|
||||
add_bitmaps_target(taranis_bitmaps ${RADIO_SRC_DIRECTORY}/bitmaps/taranis/*.png 212 4bits)
|
||||
add_dependencies(taranis_bitmaps taranis_fonts_1bit taranis_xbm_1bit)
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/* CRC16 implementation according to CCITT standards */
|
||||
static const unsigned short crc16tab[256]= {
|
||||
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
|
||||
|
||||
@@ -49,10 +49,6 @@
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
uint8_t serial2TracesEnabled();
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
typedef void (*traceCallbackFunc)(const char * text);
|
||||
@@ -61,13 +57,19 @@ void debugPrintf(const char * format, ...);
|
||||
#elif defined(DEBUG) && defined(CLI) && defined(USB_SERIAL)
|
||||
#define debugPrintf(...) do { if (cliTracesEnabled) serialPrintf(__VA_ARGS__); } while(0)
|
||||
#elif defined(DEBUG) && defined(CLI)
|
||||
uint8_t serial2TracesEnabled();
|
||||
#define debugPrintf(...) do { if (serial2TracesEnabled() && cliTracesEnabled) serialPrintf(__VA_ARGS__); } while(0)
|
||||
#elif defined(DEBUG) && defined(CPUARM)
|
||||
uint8_t serial2TracesEnabled();
|
||||
#define debugPrintf(...) do { if (serial2TracesEnabled()) serialPrintf(__VA_ARGS__); } while(0)
|
||||
#else
|
||||
#define debugPrintf(...)
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define TRACE(...) do { debugPrintf(__VA_ARGS__); debugPrintf("\r\n"); } while(0)
|
||||
#define DUMP(data, size) dump(data, size)
|
||||
#define TRACE_DEBUG(...) debugPrintf("-D- " __VA_ARGS__)
|
||||
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@@ -1 +1 @@
|
||||
{ 0,4,14,28,54,76,110,139,146,160,173,193,217,228,242,251,266,289,310,331,352,375,397,420,441,464,487,497,508,532,556,580,598,613,641,665,689,715,736,757,783,808,818,832,859,880,910,935,963,987,1015,1040,1062,1087,1112,1140,1178,1206,1234,1258,1272,1287,1300,1324,1343,1356,1378,1401,1420,1443,1466,1484,1507,1529,1539,1553,1576,1586,1618,1640,1663,1686,1709,1726,1746,1764,1786,1810,1841,1865,1889,1909,1933,1936,1960,1988,2015,2033,2051,2074,2097,2120,2143,2171 }
|
||||
{ 0,4,11,23,49,68,99,124,130,141,152,171,195,204,216,223,237,257,275,294,313,334,353,373,392,412,432,440,449,473,497,521,537,550,575,595,618,641,660,677,702,723,730,742,764,782,807,828,854,873,899,921,941,965,987,1012,1045,1069,1093,1116,1127,1141,1151,1175,1196,1208,1227,1247,1265,1285,1305,1320,1340,1359,1365,1375,1395,1401,1431,1450,1470,1490,1510,1525,1543,1558,1577,1598,1625,1646,1667,1685,1709,1712,1736,1764,1791,1809,1827,1849,1871,1893,1915,1943 }
|
||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
@@ -36,36 +36,6 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
#if defined(CPUARM)
|
||||
extern LP_CONST LanguagePack czLanguagePack;
|
||||
extern LP_CONST LanguagePack enLanguagePack;
|
||||
extern LP_CONST LanguagePack esLanguagePack;
|
||||
extern LP_CONST LanguagePack frLanguagePack;
|
||||
extern LP_CONST LanguagePack deLanguagePack;
|
||||
extern LP_CONST LanguagePack itLanguagePack;
|
||||
extern LP_CONST LanguagePack plLanguagePack;
|
||||
extern LP_CONST LanguagePack ptLanguagePack;
|
||||
extern LP_CONST LanguagePack skLanguagePack;
|
||||
extern LP_CONST LanguagePack seLanguagePack;
|
||||
extern LP_CONST LanguagePack huLanguagePack;
|
||||
|
||||
const LanguagePack * LP_CONST languagePacks[] = {
|
||||
// alphabetical order
|
||||
&czLanguagePack,
|
||||
&deLanguagePack,
|
||||
&enLanguagePack,
|
||||
&esLanguagePack,
|
||||
&frLanguagePack,
|
||||
&huLanguagePack,
|
||||
&itLanguagePack,
|
||||
&plLanguagePack,
|
||||
&ptLanguagePack,
|
||||
&seLanguagePack,
|
||||
&skLanguagePack,
|
||||
NULL
|
||||
};
|
||||
#endif
|
||||
|
||||
void menuGeneralSetup(uint8_t event);
|
||||
void menuGeneralSdManager(uint8_t event);
|
||||
void menuGeneralCustomFunctions(uint8_t event);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "../../opentx.h"
|
||||
|
||||
const pm_uchar sticks[] PROGMEM = {
|
||||
#include "../../bitmaps/sticks.lbm"
|
||||
#include "sticks.lbm"
|
||||
};
|
||||
|
||||
#define RADIO_SETUP_2ND_COLUMN (LCD_W-6*FW-3-MENUS_SCROLLBAR_WIDTH)
|
||||
|
||||
@@ -69,6 +69,10 @@ void displayPopup(const pm_char * pstr)
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
const pm_uchar asterisk_lbm[] PROGMEM = {
|
||||
#include "asterisk.lbm"
|
||||
};
|
||||
|
||||
void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SOUND_ARG)
|
||||
{
|
||||
lcdClear();
|
||||
|
||||
@@ -41,23 +41,23 @@
|
||||
*/
|
||||
|
||||
const uint8_t LBM_TOPMENU_POLYGON[] = {
|
||||
#include "../../bitmaps/horus/mask_topmenu_polygon.lbm"
|
||||
#include "mask_topmenu_polygon.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_DOT[] = {
|
||||
#include "../../bitmaps/horus/mask_dot.lbm"
|
||||
#include "mask_dot.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_BG[] = {
|
||||
#include "../../bitmaps/horus/mask_current_bg.lbm"
|
||||
#include "mask_current_bg.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_SHADOW[] = {
|
||||
#include "../../bitmaps/horus/mask_current_shadow.lbm"
|
||||
#include "mask_current_shadow.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_DOT[] = {
|
||||
#include "../../bitmaps/horus/mask_current_dot.lbm"
|
||||
#include "mask_current_dot.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -65,35 +65,35 @@ const uint8_t LBM_CURRENT_DOT[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_MAINVIEW_BACKGROUND[] = {
|
||||
#include "../../bitmaps/horus/background.lbm"
|
||||
#include "background.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_OPENTX[] = {
|
||||
#include "../../bitmaps/horus/mask_topmenu_opentx.lbm"
|
||||
#include "mask_topmenu_opentx.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_USB[] = {
|
||||
#include "../../bitmaps/horus/mask_topmenu_usb.lbm"
|
||||
#include "mask_topmenu_usb.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_HTRIM_FRAME[] = {
|
||||
#include "../../bitmaps/horus/mask_htrim_frame.lbm"
|
||||
#include "mask_htrim_frame.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_VTRIM_FRAME[] = {
|
||||
#include "../../bitmaps/horus/mask_vtrim_frame.lbm"
|
||||
#include "mask_vtrim_frame.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TRIM_SHADOW[] = {
|
||||
#include "../../bitmaps/horus/mask_trim_shadow.lbm"
|
||||
#include "mask_trim_shadow.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TIMER_BACKGROUND[] = {
|
||||
#include "../../bitmaps/horus/mask_timer_bg.lbm"
|
||||
#include "mask_timer_bg.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_RSCALE[] = {
|
||||
#include "../../bitmaps/horus/mask_rscale.lbm"
|
||||
#include "mask_rscale.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -101,31 +101,31 @@ const uint8_t LBM_RSCALE[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_RADIO_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_menu_radio.lbm"
|
||||
#include "mask_menu_radio.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_RADIO_SETUP_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_radio_setup.lbm"
|
||||
#include "mask_radio_setup.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SD_BROWSER_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_sd_browser.lbm"
|
||||
#include "mask_sd_browser.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_GLOBAL_FUNCTIONS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_global_functions.lbm"
|
||||
#include "mask_global_functions.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TRAINER_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_trainer.lbm"
|
||||
#include "mask_trainer.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CALIBRATION_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_calibration.lbm"
|
||||
#include "mask_calibration.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_VERSION_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_version.lbm"
|
||||
#include "mask_version.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_RADIO_ICONS[] = {
|
||||
@@ -143,55 +143,55 @@ const uint8_t * const LBM_RADIO_ICONS[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_MODEL_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_menu_model.lbm"
|
||||
#include "mask_menu_model.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MODEL_SETUP_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_model_setup.lbm"
|
||||
#include "mask_model_setup.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_HELI_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_heli.lbm"
|
||||
#include "mask_heli.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_FLIGHT_MODES_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_flight_modes.lbm"
|
||||
#include "mask_flight_modes.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_INPUTS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_inputs.lbm"
|
||||
#include "mask_inputs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MIXER_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_mixer.lbm"
|
||||
#include "mask_mixer.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_OUTPUTS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_outputs.lbm"
|
||||
#include "mask_outputs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVES_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_curves.lbm"
|
||||
#include "mask_curves.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_GVARS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_gvars.lbm"
|
||||
#include "mask_gvars.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LOGICAL_SWITCHES_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_logical_switches.lbm"
|
||||
#include "mask_logical_switches.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SPECIAL_FUNCTIONS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_special_functions.lbm"
|
||||
#include "mask_special_functions.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LUA_SCRIPTS_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_lua_scripts.lbm"
|
||||
#include "mask_lua_scripts.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TELEMETRY_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_telemetry.lbm"
|
||||
#include "mask_telemetry.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_MODEL_ICONS[] = {
|
||||
@@ -217,31 +217,31 @@ const uint8_t * const LBM_MODEL_ICONS[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_LIBRARY_ICON[] = {
|
||||
#include "../../bitmaps/horus/mask_library.lbm"
|
||||
#include "mask_library.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LIBRARY_SLOT[] = {
|
||||
#include "../../bitmaps/horus/mask_library_slot.lbm"
|
||||
#include "mask_library_slot.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LIBRARY_CURSOR[] = {
|
||||
#include "../../bitmaps/horus/mask_library_category_index.lbm"
|
||||
#include "mask_library_category_index.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SCORE0[] = {
|
||||
#include "../../bitmaps/horus/mask_library_score_0.lbm"
|
||||
#include "mask_library_score_0.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SCORE1[] = {
|
||||
#include "../../bitmaps/horus/mask_library_score_1.lbm"
|
||||
#include "mask_library_score_1.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STAR0[] = {
|
||||
#include "../../bitmaps/horus/mask_library_star_0.lbm"
|
||||
#include "mask_library_star_0.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STAR1[] = {
|
||||
#include "../../bitmaps/horus/mask_library_star_1.lbm"
|
||||
#include "mask_library_star_1.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -249,21 +249,21 @@ const uint8_t LBM_STAR1[] = {
|
||||
*/
|
||||
|
||||
const uint8_t LBM_ASTERISK[] = {
|
||||
#include "../../bitmaps/horus/asterisk.lbm"
|
||||
#include "asterisk.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_POINT[] = {
|
||||
#include "../../bitmaps/horus/mask_point.lbm"
|
||||
#include "mask_point.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVE_POINT[] = {
|
||||
#include "../../bitmaps/horus/mask_cvpoint.lbm"
|
||||
#include "mask_cvpoint.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVE_POINT_CENTER[] = {
|
||||
#include "../../bitmaps/horus/mask_cvpoint_center.lbm"
|
||||
#include "mask_cvpoint_center.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVE_COORD_SHADOW[] = {
|
||||
#include "../../bitmaps/horus/mask_coord_shadow.lbm"
|
||||
#include "mask_coord_shadow.lbm"
|
||||
};
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
coord_t getCurveYCoord(FnFuncP fn, coord_t x)
|
||||
{
|
||||
return limit(0, CURVE_CENTER_Y - divRoundClosest(fn(divRoundClosest(x * RESX, CURVE_SIDE_WIDTH)) * CURVE_SIDE_WIDTH, RESX), LCD_H-1);
|
||||
|
||||
@@ -37,51 +37,51 @@
|
||||
#include "../../opentx.h"
|
||||
|
||||
const uint16_t font_tinsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_tinsize.specs"
|
||||
#include "font_tinsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_tinsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_tinsize.lbm"
|
||||
#include "font_tinsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_smlsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_smlsize.specs"
|
||||
#include "font_smlsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_smlsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_smlsize.lbm"
|
||||
#include "font_smlsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_stdsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_stdsize.specs"
|
||||
#include "font_stdsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_stdsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_stdsize.lbm"
|
||||
#include "font_stdsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_midsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_midsize.specs"
|
||||
#include "font_midsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_midsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_midsize.lbm"
|
||||
#include "font_midsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_dblsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_dblsize.specs"
|
||||
#include "font_dblsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_dblsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_dblsize.lbm"
|
||||
#include "font_dblsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t font_xxlsize_specs[] PROGMEM =
|
||||
#include "../../fonts/horus/font_xxlsize.specs"
|
||||
#include "font_xxlsize.specs"
|
||||
;
|
||||
|
||||
const pm_uchar font_xxlsize[] PROGMEM = {
|
||||
#include "fonts/horus/font_xxlsize.lbm"
|
||||
#include "font_xxlsize.lbm"
|
||||
};
|
||||
|
||||
const uint16_t *fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs };
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../horus/lcd.h"
|
||||
#include "../horus/menus.h"
|
||||
#include "lcd.h"
|
||||
#include "menus.h"
|
||||
|
||||
#define MENU_HEADER_HEIGHT 45
|
||||
#define MENU_TITLE_TOP 48
|
||||
@@ -84,11 +84,15 @@ void displayScreenIndex(uint8_t index, uint8_t count);
|
||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawHorizontalScrollbar(coord_t x, coord_t y, coord_t w, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawHeader(int index);
|
||||
void drawColumnHeader(const char * const * headers, uint8_t index);
|
||||
void drawFooter();
|
||||
#define drawStatusLine(...)
|
||||
void drawProgressBar(const char *label);
|
||||
void updateProgressBar(int num, int den);
|
||||
void drawTopmenuDatetime();
|
||||
void drawSubmenuTemplate(const char * name, uint16_t scrollbar_X);
|
||||
void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
||||
void drawSticks();
|
||||
|
||||
// Curve functions
|
||||
coord_t getCurveYCoord(FnFuncP fn, coord_t x);
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
#if defined(SIMU)
|
||||
@@ -608,7 +610,6 @@ void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx==0) {
|
||||
@@ -618,7 +619,6 @@ void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
putsStrIdx(x, y, STR_FP, abs(idx)-1, att);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
||||
{
|
||||
|
||||
@@ -36,59 +36,6 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
extern LP_CONST LanguagePack czLanguagePack;
|
||||
extern LP_CONST LanguagePack enLanguagePack;
|
||||
extern LP_CONST LanguagePack esLanguagePack;
|
||||
extern LP_CONST LanguagePack frLanguagePack;
|
||||
extern LP_CONST LanguagePack deLanguagePack;
|
||||
extern LP_CONST LanguagePack itLanguagePack;
|
||||
extern LP_CONST LanguagePack plLanguagePack;
|
||||
extern LP_CONST LanguagePack ptLanguagePack;
|
||||
extern LP_CONST LanguagePack skLanguagePack;
|
||||
extern LP_CONST LanguagePack seLanguagePack;
|
||||
extern LP_CONST LanguagePack huLanguagePack;
|
||||
|
||||
const LanguagePack * LP_CONST languagePacks[] = {
|
||||
// alphabetical order
|
||||
&czLanguagePack,
|
||||
&deLanguagePack,
|
||||
&enLanguagePack,
|
||||
&esLanguagePack,
|
||||
&frLanguagePack,
|
||||
&huLanguagePack,
|
||||
&itLanguagePack,
|
||||
&plLanguagePack,
|
||||
&ptLanguagePack,
|
||||
&seLanguagePack,
|
||||
&skLanguagePack,
|
||||
NULL
|
||||
};
|
||||
|
||||
bool menuGeneralSetup(evt_t event);
|
||||
bool menuGeneralSdManager(evt_t event);
|
||||
bool menuGeneralCustomFunctions(evt_t event);
|
||||
bool menuGeneralTrainer(evt_t event);
|
||||
bool menuGeneralVersion(evt_t event);
|
||||
bool menuGeneralCalib(evt_t event);
|
||||
|
||||
enum EnumTabDiag {
|
||||
e_Setup,
|
||||
e_Sd,
|
||||
e_GeneralCustomFunctions,
|
||||
e_Trainer,
|
||||
e_Calib,
|
||||
e_Vers,
|
||||
};
|
||||
|
||||
const MenuHandlerFunc menuTabGeneral[] PROGMEM = {
|
||||
menuGeneralSetup,
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralCalib,
|
||||
menuGeneralVersion,
|
||||
};
|
||||
|
||||
bool menuGeneralCustomFunctions(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUGLOBALFUNCS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, DEFAULT_SCROLLBAR_X, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
#define REFRESH_FILES() do { reusableBuffer.sdmanager.offset = 65535; lastBitmap = -1; } while (0)
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
#endif
|
||||
|
||||
enum menuGeneralSetupItems {
|
||||
CASE_RTCLOCK(ITEM_SETUP_DATE)
|
||||
CASE_RTCLOCK(ITEM_SETUP_TIME)
|
||||
ITEM_SETUP_DATE,
|
||||
ITEM_SETUP_TIME,
|
||||
// ITEM_SETUP_BATT_RANGE,
|
||||
ITEM_SETUP_SOUND_LABEL,
|
||||
ITEM_SETUP_BEEP_MODE,
|
||||
|
||||
@@ -35,48 +35,10 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
enum EnumTabModel {
|
||||
// e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
e_InputsAll,
|
||||
e_MixAll,
|
||||
e_Limits,
|
||||
CASE_CURVES(e_CurvesAll)
|
||||
CASE_GVARS(e_GVars)
|
||||
e_LogicalSwitches,
|
||||
e_CustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
e_CustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
};
|
||||
|
||||
bool menuModelSelect(evt_t event);
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelHeli(evt_t event);
|
||||
bool menuModelFlightModesAll(evt_t event);
|
||||
bool menuModelExposAll(evt_t event);
|
||||
bool menuModelMixAll(evt_t event);
|
||||
bool menuModelLimits(evt_t event);
|
||||
bool menuModelCurvesAll(evt_t event);
|
||||
bool menuModelCurveOne(evt_t event);
|
||||
bool menuModelGVars(evt_t event);
|
||||
bool menuModelLogicalSwitches(evt_t event);
|
||||
bool menuModelCustomFunctions(evt_t event);
|
||||
bool menuModelCustomScripts(evt_t event);
|
||||
bool menuModelTelemetry(evt_t event);
|
||||
bool menuModelExpoOne(evt_t event);
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
|
||||
#define FlightModesType uint16_t
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr);
|
||||
|
||||
#define MIXES_2ND_COLUMN 100
|
||||
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uint8_t attr, uint8_t delay)
|
||||
{
|
||||
lcdDrawNumber(x+MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||
@@ -84,35 +46,11 @@ uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uin
|
||||
return delay;
|
||||
}
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
// menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
CASE_CURVES(menuModelCurvesAll)
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelCustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetry)
|
||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
uint8_t s_copyMode = 0;
|
||||
int8_t s_copySrcRow;
|
||||
int8_t s_copyTgtOfs;
|
||||
|
||||
#define COPY_MODE 1
|
||||
#define MOVE_MODE 2
|
||||
static uint8_t s_copyMode = 0;
|
||||
static int8_t s_copySrcRow;
|
||||
static int8_t s_copyTgtOfs;
|
||||
|
||||
static uint8_t editNameCursorPos = 0;
|
||||
uint8_t editNameCursorPos = 0;
|
||||
|
||||
void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint8_t active, LcdFlags flags)
|
||||
{
|
||||
@@ -216,4 +154,12 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t s_currIdx;
|
||||
uint8_t s_currIdx;
|
||||
|
||||
void copySelection(char * dst, const char * src, uint8_t size)
|
||||
{
|
||||
if (memcmp(src, "---", 3) == 0)
|
||||
memset(dst, 0, size);
|
||||
else
|
||||
memcpy(dst, src, size);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
uint8_t s_curveChan;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
enum FlightModesItems {
|
||||
@@ -73,7 +74,7 @@ bool menuModelFlightModesAll(evt_t event)
|
||||
}
|
||||
|
||||
if (sub<MAX_FLIGHT_MODES && posHorz>=0) {
|
||||
displayColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
drawColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
#define EXPO_ONE_2ND_COLUMN 110
|
||||
|
||||
@@ -137,7 +137,7 @@ bool menuModelLimits(evt_t event)
|
||||
}
|
||||
|
||||
if (sub<NUM_CHNOUT && menuHorizontalPosition>=0) {
|
||||
displayColumnHeader(STR_LIMITS_HEADERS, menuHorizontalPosition);
|
||||
drawColumnHeader(STR_LIMITS_HEADERS, menuHorizontalPosition);
|
||||
}
|
||||
|
||||
if (warningResult) {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../../opentx.h"
|
||||
|
||||
enum LogicalSwitchFields {
|
||||
@@ -54,11 +55,6 @@ enum LogicalSwitchFields {
|
||||
#define CSW_5TH_COLUMN 245
|
||||
#define CSW_6TH_COLUMN 300
|
||||
|
||||
#define INCDEC_DECLARE_VARS(f) uint8_t incdecFlag = (f); IsValueAvailable isValueAvailable = NULL
|
||||
#define INCDEC_SET_FLAG(f) incdecFlag = (f)
|
||||
#define INCDEC_ENABLE_CHECK(fn) isValueAvailable = fn
|
||||
#define CHECK_INCDEC_PARAM(event, var, min, max) checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lattr, uint8_t rattr)
|
||||
{
|
||||
char s[32];
|
||||
@@ -106,7 +102,7 @@ bool menuModelLogicalSwitches(evt_t event)
|
||||
horzpos_t horz = menuHorizontalPosition;
|
||||
|
||||
if (sub>= 0 && horz>=0) {
|
||||
displayColumnHeader(STR_CSW_HEADERS, horz);
|
||||
drawColumnHeader(STR_CSW_HEADERS, horz);
|
||||
}
|
||||
|
||||
if (horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
|
||||
@@ -94,14 +94,6 @@ enum menuModelSetupItems {
|
||||
#define MODEL_SETUP_RANGE_OFS 40
|
||||
#define MODEL_SETUP_SET_FAILSAFE_OFS 60
|
||||
|
||||
void copySelection(char *dst, const char *src, uint8_t size)
|
||||
{
|
||||
if (memcmp(src, "---", 3) == 0)
|
||||
memset(dst, 0, size);
|
||||
else
|
||||
memcpy(dst, src, size);
|
||||
}
|
||||
|
||||
void onModelSetupBitmapMenu(const char *result)
|
||||
{
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
#endif
|
||||
|
||||
#define MENU_COLUMN2_X 280
|
||||
#define MIXES_2ND_COLUMN 100
|
||||
#define COLUMN_HEADER_X 150
|
||||
|
||||
typedef int16_t vertpos_t;
|
||||
|
||||
@@ -69,8 +71,6 @@ extern uint8_t noHighlightCounter;
|
||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||
|
||||
typedef bool (*MenuHandlerFunc)(evt_t event);
|
||||
extern const MenuHandlerFunc menuTabModel[];
|
||||
extern const MenuHandlerFunc menuTabGeneral[];
|
||||
|
||||
extern MenuHandlerFunc menuHandlers[5];
|
||||
extern uint8_t menuVerticalPositions[4];
|
||||
@@ -84,16 +84,90 @@ void pushMenu(MenuHandlerFunc newMenu);
|
||||
/// return to last menu in menustack
|
||||
void popMenu();
|
||||
|
||||
bool menuFirstCalib(evt_t event);
|
||||
enum EnumTabModel {
|
||||
// e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
e_InputsAll,
|
||||
e_MixAll,
|
||||
e_Limits,
|
||||
CASE_CURVES(e_CurvesAll)
|
||||
CASE_GVARS(e_GVars)
|
||||
e_LogicalSwitches,
|
||||
e_CustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
e_CustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
};
|
||||
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelHeli(evt_t event);
|
||||
bool menuModelFlightModesAll(evt_t event);
|
||||
bool menuModelExposAll(evt_t event);
|
||||
bool menuModelMixAll(evt_t event);
|
||||
bool menuModelLimits(evt_t event);
|
||||
bool menuModelCurvesAll(evt_t event);
|
||||
bool menuModelCurveOne(evt_t event);
|
||||
bool menuModelGVars(evt_t event);
|
||||
bool menuModelLogicalSwitches(evt_t event);
|
||||
bool menuModelCustomFunctions(evt_t event);
|
||||
bool menuModelCustomScripts(evt_t event);
|
||||
bool menuModelTelemetry(evt_t event);
|
||||
bool menuModelExpoOne(evt_t event);
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
// menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
CASE_CURVES(menuModelCurvesAll)
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelCustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetry)
|
||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
|
||||
enum EnumTabDiag {
|
||||
e_Setup,
|
||||
e_Sd,
|
||||
e_GeneralCustomFunctions,
|
||||
e_Trainer,
|
||||
e_Calib,
|
||||
e_Vers,
|
||||
};
|
||||
|
||||
bool menuMainView(evt_t event);
|
||||
bool menuGeneralDiagAna(evt_t event);
|
||||
bool menuGeneralSetup(evt_t event);
|
||||
bool menuGeneralSdManager(evt_t event);
|
||||
bool menuGeneralCustomFunctions(evt_t event);
|
||||
bool menuGeneralTrainer(evt_t event);
|
||||
bool menuGeneralVersion(evt_t event);
|
||||
bool menuGeneralCalib(evt_t event);
|
||||
|
||||
static const MenuHandlerFunc menuTabGeneral[] PROGMEM = {
|
||||
menuGeneralSetup,
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralCalib,
|
||||
menuGeneralVersion,
|
||||
};
|
||||
|
||||
bool menuFirstCalib(evt_t event);
|
||||
bool menuMainView(evt_t event);
|
||||
bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunctionsContext & functionsContext);
|
||||
bool menuModelSelect(evt_t event);
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelCustomFunctions(evt_t event);
|
||||
bool menuStatisticsView(evt_t event);
|
||||
bool menuStatisticsDebug(evt_t event);
|
||||
bool menuAboutView(evt_t event);
|
||||
@@ -106,6 +180,8 @@ bool menuTextView(evt_t event);
|
||||
void menuTraceBuffer(evt_t event);
|
||||
#endif
|
||||
|
||||
typedef uint16_t FlightModesType;
|
||||
|
||||
extern int8_t checkIncDec_Ret; // global helper vars
|
||||
|
||||
#define EDIT_SELECT_MENU -1
|
||||
@@ -190,10 +266,15 @@ int8_t checkIncDecMovedSwitch(int8_t val);
|
||||
#define CHECK_INCDEC_GENVAR(event, var, min, max) \
|
||||
var = checkIncDecGen(event, var, min, max)
|
||||
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#define CURSOR_ON_LINE() (menuHorizontalPosition<0)
|
||||
#define NAVIGATION_LINE_BY_LINE 0x40
|
||||
#define CURSOR_ON_LINE() (menuHorizontalPosition<0)
|
||||
|
||||
#define INCDEC_DECLARE_VARS(f) uint8_t incdecFlag = (f); IsValueAvailable isValueAvailable = NULL
|
||||
#define INCDEC_SET_FLAG(f) incdecFlag = (f)
|
||||
#define INCDEC_ENABLE_CHECK(fn) isValueAvailable = fn
|
||||
#define CHECK_INCDEC_PARAM(event, var, min, max) \
|
||||
checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
#define CHECK_FLAG_NO_SCREEN_INDEX 1
|
||||
bool navigate(evt_t event, int count, int rows, int columns=1);
|
||||
bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
|
||||
bool check_simple(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
@@ -249,8 +330,14 @@ int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, evt_t e
|
||||
#define displayGVar(x, y, v, min, max) lcdDrawNumber(x, y, v)
|
||||
#endif
|
||||
|
||||
extern uint8_t editNameCursorPos;
|
||||
void editName(coord_t x, coord_t y, char *name, uint8_t size, evt_t event, uint8_t active, LcdFlags flags=ZCHAR);
|
||||
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uint8_t attr, uint8_t delay);
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr);
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
|
||||
#define WARNING_TYPE_ASTERISK 0
|
||||
#define WARNING_TYPE_CONFIRM 1
|
||||
#define WARNING_TYPE_INPUT 2
|
||||
@@ -261,6 +348,14 @@ extern uint8_t warningInfoLength;
|
||||
extern uint8_t warningResult;
|
||||
extern uint8_t warningType;
|
||||
|
||||
#define COPY_MODE 1
|
||||
#define MOVE_MODE 2
|
||||
extern uint8_t s_copyMode;
|
||||
|
||||
extern int8_t s_copySrcRow;
|
||||
extern int8_t s_copyTgtOfs;
|
||||
extern uint8_t s_currIdx;
|
||||
|
||||
#define MENU_X 80
|
||||
#define MENU_W LCD_W-(2*MENU_X)
|
||||
#define POPUP_X 130
|
||||
@@ -272,11 +367,12 @@ extern uint8_t warningType;
|
||||
#define WARNING_LINE_Y (POPUP_Y+9)
|
||||
#define WARNING_INFOLINE_Y (WARNING_LINE_Y+68)
|
||||
|
||||
void displayBox();
|
||||
void displayPopup(const char *title);
|
||||
void copySelection(char * dst, const char * src, uint8_t size);
|
||||
|
||||
void displayPopup(const char * title);
|
||||
void displayWarning(evt_t event);
|
||||
|
||||
extern void (*popupFunc)(evt_t event);
|
||||
extern void (* popupFunc)(evt_t event);
|
||||
extern int16_t warningInputValue;
|
||||
extern int16_t warningInputValueMin;
|
||||
extern int16_t warningInputValueMax;
|
||||
@@ -322,4 +418,6 @@ void pushModelNotes();
|
||||
typedef int (*FnFuncP) (int x);
|
||||
void drawFunction(FnFuncP fn, int offset=0);
|
||||
|
||||
uint8_t switchToMix(uint8_t source);
|
||||
|
||||
#endif // _MENUS_H_
|
||||
|
||||
@@ -37,14 +37,12 @@
|
||||
#include "../../opentx.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define COLUMN_HEADER_X 150
|
||||
|
||||
void displayHeader(const char *header)
|
||||
void drawHeader(const char * header)
|
||||
{
|
||||
// TODO ? lcdDrawText(COLUMN_HEADER_X, MENU_FOOTER_TOP, header, HEADER_COLOR);
|
||||
}
|
||||
|
||||
void displayColumnHeader(const char * const *headers, uint8_t index)
|
||||
void drawColumnHeader(const char * const * headers, uint8_t index)
|
||||
{
|
||||
// TODO ? displayHeader(headers[index]);
|
||||
}
|
||||
|
||||
@@ -45,13 +45,28 @@
|
||||
#define BITMAP_BUFFER_SIZE(width, height) (2 + (width) * (((height)+7)/8)*4)
|
||||
#define MODEL_BITMAP_WIDTH 64
|
||||
#define MODEL_BITMAP_HEIGHT 32
|
||||
|
||||
#define WCHART (LCD_H/2)
|
||||
#define X0 (LCD_W-WCHART-2)
|
||||
#define Y0 (LCD_H/2)
|
||||
|
||||
#define MENUS_SCROLLBAR_WIDTH 2
|
||||
#define MENU_COLUMN2_X (8 + LCD_W / 2)
|
||||
|
||||
#if MENU_COLUMNS < 2
|
||||
#define MIXES_2ND_COLUMN (18*FW)
|
||||
#else
|
||||
#define MIXES_2ND_COLUMN (9*FW)
|
||||
#endif
|
||||
|
||||
#define MODEL_BITMAP_SIZE BITMAP_BUFFER_SIZE(MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)
|
||||
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||
bool loadModelBitmap(char * name, uint8_t * bitmap);
|
||||
#define LOAD_MODEL_BITMAP() loadModelBitmap(g_model.header.bitmap, modelBitmap)
|
||||
|
||||
extern uint8_t modelBitmap[MODEL_BITMAP_SIZE];
|
||||
bool loadModelBitmap(char * name, uint8_t * bitmap);
|
||||
|
||||
struct MenuItem {
|
||||
const char *name;
|
||||
const char * name;
|
||||
const MenuHandlerFunc action;
|
||||
};
|
||||
|
||||
@@ -63,7 +78,11 @@ void displayMenuBar(const MenuItem *menu, int index);
|
||||
void drawProgressBar(const char *label);
|
||||
void updateProgressBar(int num, int den);
|
||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
|
||||
void drawColumnHeader(const char * const * headers, uint8_t index);
|
||||
void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
||||
|
||||
extern coord_t scrollbar_X;
|
||||
#define SET_SCROLLBAR_X(x) scrollbar_X = (x);
|
||||
|
||||
extern const pm_uchar sticks[] PROGMEM;
|
||||
|
||||
|
||||
@@ -36,70 +36,6 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
extern LP_CONST LanguagePack czLanguagePack;
|
||||
extern LP_CONST LanguagePack enLanguagePack;
|
||||
extern LP_CONST LanguagePack esLanguagePack;
|
||||
extern LP_CONST LanguagePack frLanguagePack;
|
||||
extern LP_CONST LanguagePack deLanguagePack;
|
||||
extern LP_CONST LanguagePack itLanguagePack;
|
||||
extern LP_CONST LanguagePack nlLanguagePack;
|
||||
extern LP_CONST LanguagePack plLanguagePack;
|
||||
extern LP_CONST LanguagePack ptLanguagePack;
|
||||
extern LP_CONST LanguagePack skLanguagePack;
|
||||
extern LP_CONST LanguagePack seLanguagePack;
|
||||
extern LP_CONST LanguagePack huLanguagePack;
|
||||
|
||||
const LanguagePack * LP_CONST languagePacks[] = {
|
||||
// alphabetical order
|
||||
&czLanguagePack,
|
||||
&deLanguagePack,
|
||||
&enLanguagePack,
|
||||
&esLanguagePack,
|
||||
&frLanguagePack,
|
||||
&huLanguagePack,
|
||||
&itLanguagePack,
|
||||
&nlLanguagePack,
|
||||
&plLanguagePack,
|
||||
&ptLanguagePack,
|
||||
&seLanguagePack,
|
||||
&skLanguagePack,
|
||||
NULL
|
||||
};
|
||||
|
||||
void menuGeneralSetup(uint8_t event);
|
||||
void menuGeneralSdManager(uint8_t event);
|
||||
void menuGeneralCustomFunctions(uint8_t event);
|
||||
void menuGeneralTrainer(uint8_t event);
|
||||
void menuGeneralVersion(uint8_t event);
|
||||
void menuGeneralDiagKeys(uint8_t event);
|
||||
void menuGeneralDiagAna(uint8_t event);
|
||||
void menuGeneralHardware(uint8_t event);
|
||||
void menuGeneralCalib(uint8_t event);
|
||||
|
||||
enum EnumTabDiag {
|
||||
e_Setup,
|
||||
e_Sd,
|
||||
e_GeneralCustomFunctions,
|
||||
e_Trainer,
|
||||
e_Vers,
|
||||
e_Keys,
|
||||
e_Ana,
|
||||
e_Hardware,
|
||||
e_Calib
|
||||
};
|
||||
|
||||
const MenuHandlerFunc menuTabGeneral[] = {
|
||||
menuGeneralSetup,
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralVersion,
|
||||
menuGeneralDiagKeys,
|
||||
menuGeneralDiagAna,
|
||||
menuGeneralHardware,
|
||||
menuGeneralCalib
|
||||
};
|
||||
|
||||
void menuGeneralCustomFunctions(uint8_t event)
|
||||
{
|
||||
MENU(STR_MENUGLOBALFUNCS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
|
||||
@@ -77,7 +77,7 @@ inline bool isFilenameLower(bool isfile, const char * fn, const char * line)
|
||||
return (!isfile && IS_FILE(line)) || (isfile==IS_FILE(line) && strcasecmp(fn, line) < 0);
|
||||
}
|
||||
|
||||
bool isBootloader(const char *filename)
|
||||
bool isBootloader(const char * filename)
|
||||
{
|
||||
FIL file;
|
||||
f_open(&file, filename, FA_READ);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "../../opentx.h"
|
||||
|
||||
const pm_uchar sticks[] PROGMEM = {
|
||||
#include "../../bitmaps/sticks.lbm"
|
||||
#include "sticks.lbm"
|
||||
};
|
||||
|
||||
#define RADIO_SETUP_2ND_COLUMN (LCD_W-10*FW-MENUS_SCROLLBAR_WIDTH)
|
||||
|
||||
@@ -35,59 +35,6 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
// TODO elsewhere!
|
||||
#define WCHART (LCD_H/2)
|
||||
#define X0 (LCD_W-WCHART-2)
|
||||
#define Y0 (LCD_H/2)
|
||||
|
||||
enum EnumTabModel {
|
||||
e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
e_InputsAll,
|
||||
e_MixAll,
|
||||
e_Limits,
|
||||
CASE_CURVES(e_CurvesAll)
|
||||
CASE_GVARS(e_GVars)
|
||||
e_LogicalSwitches,
|
||||
e_CustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
e_CustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
CASE_MAVLINK(e_MavSetup)
|
||||
CASE_TEMPLATES(e_Templates)
|
||||
};
|
||||
|
||||
void menuModelSelect(uint8_t event);
|
||||
void menuModelSetup(uint8_t event);
|
||||
void menuModelHeli(uint8_t event);
|
||||
void menuModelFlightModesAll(uint8_t event);
|
||||
void menuModelExposAll(uint8_t event);
|
||||
void menuModelMixAll(uint8_t event);
|
||||
void menuModelLimits(uint8_t event);
|
||||
void menuModelCurvesAll(uint8_t event);
|
||||
void menuModelCurveOne(uint8_t event);
|
||||
void menuModelGVars(uint8_t event);
|
||||
void menuModelLogicalSwitches(uint8_t event);
|
||||
void menuModelCustomFunctions(uint8_t event);
|
||||
void menuModelCustomScripts(uint8_t event);
|
||||
void menuModelTelemetry(uint8_t event);
|
||||
void menuModelExpoOne(uint8_t event);
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
|
||||
#define FlightModesType uint16_t
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, uint8_t event, uint8_t attr);
|
||||
|
||||
#if MENU_COLUMNS < 2
|
||||
#define MIXES_2ND_COLUMN (18*FW)
|
||||
#else
|
||||
#define MIXES_2ND_COLUMN (9*FW)
|
||||
#endif
|
||||
|
||||
#if MENU_COLUMNS > 1
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
||||
{
|
||||
@@ -96,7 +43,6 @@ uint8_t editDelay(const coord_t x, const coord_t y, const uint8_t event, const u
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, delay, DELAY_MAX);
|
||||
return delay;
|
||||
}
|
||||
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(x, y, event, attr, str, delay)
|
||||
#else
|
||||
uint8_t editDelay(const coord_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
||||
{
|
||||
@@ -105,38 +51,15 @@ uint8_t editDelay(const coord_t y, const uint8_t event, const uint8_t attr, cons
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, delay, DELAY_MAX);
|
||||
return delay;
|
||||
}
|
||||
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
|
||||
#endif
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
CASE_CURVES(menuModelCurvesAll)
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelCustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetry)
|
||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
|
||||
#define COPY_MODE 1
|
||||
#define MOVE_MODE 2
|
||||
static uint8_t s_copyMode = 0;
|
||||
static int8_t s_copySrcRow;
|
||||
static int8_t s_copyTgtOfs;
|
||||
uint8_t s_copyMode = 0;
|
||||
int8_t s_copySrcRow;
|
||||
int8_t s_copyTgtOfs;
|
||||
|
||||
static uint8_t editNameCursorPos = 0;
|
||||
uint8_t editNameCursorPos = 0;
|
||||
|
||||
void editName(coord_t x, coord_t y, char *name, uint8_t size, uint8_t event, uint8_t active, uint8_t attr)
|
||||
{
|
||||
@@ -232,4 +155,4 @@ void editSingleName(coord_t x, coord_t y, const pm_char *label, char *name, uint
|
||||
editName(x, y, name, size, event, active);
|
||||
}
|
||||
|
||||
static uint8_t s_currIdx;
|
||||
uint8_t s_currIdx;
|
||||
|
||||
@@ -73,7 +73,7 @@ void menuModelFlightModesAll(uint8_t event)
|
||||
if (sub==0 && posHorz > 0) { posHorz += 1; }
|
||||
|
||||
if (sub<MAX_FLIGHT_MODES && posHorz>=0) {
|
||||
displayColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
drawColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
|
||||
@@ -129,7 +129,7 @@ void menuModelLimits(uint8_t event)
|
||||
MENU(STR_MENULIMITS, menuTabModel, e_Limits, NUM_CHNOUT+1, { NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, 0 });
|
||||
|
||||
if (sub<NUM_CHNOUT && menuHorizontalPosition>=0) {
|
||||
displayColumnHeader(STR_LIMITS_HEADERS, menuHorizontalPosition);
|
||||
drawColumnHeader(STR_LIMITS_HEADERS, menuHorizontalPosition);
|
||||
}
|
||||
|
||||
if (warningResult) {
|
||||
|
||||
@@ -54,11 +54,6 @@ enum LogicalSwitchFields {
|
||||
#define CSW_5TH_COLUMN (26*FW+3)
|
||||
#define CSW_6TH_COLUMN (31*FW+1)
|
||||
|
||||
#define INCDEC_DECLARE_VARS(f) uint8_t incdecFlag = (f); IsValueAvailable isValueAvailable = NULL
|
||||
#define INCDEC_SET_FLAG(f) incdecFlag = (f)
|
||||
#define INCDEC_ENABLE_CHECK(fn) isValueAvailable = fn
|
||||
#define CHECK_INCDEC_PARAM(event, var, min, max) checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lattr, uint8_t rattr)
|
||||
{
|
||||
lcdDrawChar(x-4, y, '[');
|
||||
@@ -103,7 +98,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||
horzpos_t horz = menuHorizontalPosition;
|
||||
|
||||
if (horz>=0) {
|
||||
displayColumnHeader(STR_CSW_HEADERS, horz);
|
||||
drawColumnHeader(STR_CSW_HEADERS, horz);
|
||||
}
|
||||
|
||||
if (horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
|
||||
@@ -43,8 +43,6 @@
|
||||
#define MENU_COLUMNS 2
|
||||
#endif
|
||||
|
||||
#define MENUS_SCROLLBAR_WIDTH 2
|
||||
#define MENU_COLUMN2_X (8 + LCD_W / 2)
|
||||
#define lcd_putsColumnLeft(x, y, str) lcdDrawText((x > (LCD_W-10*FW-MENUS_SCROLLBAR_WIDTH)) ? MENU_COLUMN2_X : 0, y, str)
|
||||
|
||||
// Menus related stuff ...
|
||||
@@ -68,8 +66,6 @@ extern uint8_t noHighlightCounter;
|
||||
void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||
|
||||
typedef void (*MenuHandlerFunc)(uint8_t event);
|
||||
extern const MenuHandlerFunc menuTabModel[];
|
||||
extern const MenuHandlerFunc menuTabGeneral[];
|
||||
|
||||
extern MenuHandlerFunc menuHandlers[5];
|
||||
extern uint8_t menuVerticalPositions[4];
|
||||
@@ -87,21 +83,41 @@ void doMainScreenGraphics();
|
||||
void menuFirstCalib(uint8_t event);
|
||||
|
||||
void onMainViewMenu(const char *result);
|
||||
void menuMainView(uint8_t event);
|
||||
|
||||
void menuModelSelect(uint8_t event);
|
||||
void menuModelSetup(uint8_t event);
|
||||
void menuModelHeli(uint8_t event);
|
||||
void menuModelFlightModesAll(uint8_t event);
|
||||
void menuModelExposAll(uint8_t event);
|
||||
void menuModelMixAll(uint8_t event);
|
||||
void menuModelLimits(uint8_t event);
|
||||
void menuModelCurvesAll(uint8_t event);
|
||||
void menuModelCurveOne(uint8_t event);
|
||||
void menuModelGVars(uint8_t event);
|
||||
void menuModelLogicalSwitches(uint8_t event);
|
||||
void menuModelCustomFunctions(uint8_t event);
|
||||
void menuModelCustomScripts(uint8_t event);
|
||||
void menuModelTelemetry(uint8_t event);
|
||||
void menuModelExpoOne(uint8_t event);
|
||||
|
||||
void menuGeneralSetup(uint8_t event);
|
||||
void menuGeneralSdManager(uint8_t event);
|
||||
void menuGeneralCustomFunctions(uint8_t event);
|
||||
void menuGeneralTrainer(uint8_t event);
|
||||
void menuGeneralVersion(uint8_t event);
|
||||
void menuGeneralDiagKeys(uint8_t event);
|
||||
void menuGeneralDiagAna(uint8_t event);
|
||||
void menuGeneralHardware(uint8_t event);
|
||||
void menuGeneralCalib(uint8_t event);
|
||||
|
||||
void menuMainViewChannelsMonitor(uint8_t event);
|
||||
void menuChannelsView(uint8_t event);
|
||||
void menuMainView(uint8_t event);
|
||||
#if defined(FRSKY)
|
||||
void menuTelemetryFrsky(uint8_t event);
|
||||
#endif
|
||||
void menuModelSetup(uint8_t event);
|
||||
void menuModelNotes(uint8_t event);
|
||||
void menuGeneralSetup(uint8_t event);
|
||||
void menuGeneralSdManager(uint8_t event);
|
||||
void menuGeneralCalib(uint8_t event);
|
||||
void menuGeneralVersion(uint8_t event);
|
||||
void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext);
|
||||
|
||||
void menuModelSelect(uint8_t event);
|
||||
void menuModelCustomFunctions(uint8_t event);
|
||||
void menuModelNotes(uint8_t event);
|
||||
void menuStatisticsView(uint8_t event);
|
||||
void menuStatisticsDebug(uint8_t event);
|
||||
void menuAboutView(uint8_t event);
|
||||
@@ -109,10 +125,75 @@ void menuAboutView(uint8_t event);
|
||||
void menuTraceBuffer(uint8_t event);
|
||||
#endif
|
||||
|
||||
enum EnumTabDiag {
|
||||
e_Setup,
|
||||
e_Sd,
|
||||
e_GeneralCustomFunctions,
|
||||
e_Trainer,
|
||||
e_Vers,
|
||||
e_Keys,
|
||||
e_Ana,
|
||||
e_Hardware,
|
||||
e_Calib
|
||||
};
|
||||
|
||||
const MenuHandlerFunc menuTabGeneral[] = {
|
||||
menuGeneralSetup,
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralVersion,
|
||||
menuGeneralDiagKeys,
|
||||
menuGeneralDiagAna,
|
||||
menuGeneralHardware,
|
||||
menuGeneralCalib
|
||||
};
|
||||
|
||||
enum EnumTabModel {
|
||||
e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
e_InputsAll,
|
||||
e_MixAll,
|
||||
e_Limits,
|
||||
CASE_CURVES(e_CurvesAll)
|
||||
CASE_GVARS(e_GVars)
|
||||
e_LogicalSwitches,
|
||||
e_CustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
e_CustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
CASE_MAVLINK(e_MavSetup)
|
||||
CASE_TEMPLATES(e_Templates)
|
||||
};
|
||||
|
||||
const MenuHandlerFunc menuTabModel[] = {
|
||||
menuModelSelect,
|
||||
menuModelSetup,
|
||||
CASE_HELI(menuModelHeli)
|
||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||
menuModelExposAll,
|
||||
menuModelMixAll,
|
||||
menuModelLimits,
|
||||
CASE_CURVES(menuModelCurvesAll)
|
||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||
CASE_GVARS(menuModelGVars)
|
||||
#endif
|
||||
menuModelLogicalSwitches,
|
||||
menuModelCustomFunctions,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
menuModelCustomScripts,
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetry)
|
||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
|
||||
void menuMainViewChannelsMonitor(uint8_t event);
|
||||
void menuChannelsView(uint8_t event);
|
||||
typedef uint16_t FlightModesType;
|
||||
|
||||
extern int8_t checkIncDec_Ret; // global helper vars
|
||||
|
||||
@@ -131,6 +212,11 @@ extern int8_t s_editMode; // global editmode
|
||||
#define INCDEC_REP10 0x40
|
||||
#define NO_DBLKEYS 0x80
|
||||
|
||||
#define INCDEC_DECLARE_VARS(f) uint8_t incdecFlag = (f); IsValueAvailable isValueAvailable = NULL
|
||||
#define INCDEC_SET_FLAG(f) incdecFlag = (f)
|
||||
#define INCDEC_ENABLE_CHECK(fn) isValueAvailable = fn
|
||||
#define CHECK_INCDEC_PARAM(event, var, min, max) checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
// mawrow special values
|
||||
#define TITLE_ROW ((uint8_t)-1)
|
||||
#define HIDDEN_ROW ((uint8_t)-2)
|
||||
@@ -265,18 +351,40 @@ swsrc_t switchMenuItem(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, uint8
|
||||
#define displayGVar(x, y, v, min, max) lcdDraw8bitsNumber(x, y, v)
|
||||
#endif
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, uint8_t event, uint8_t attr);
|
||||
|
||||
extern uint8_t editNameCursorPos;
|
||||
void editName(coord_t x, coord_t y, char *name, uint8_t size, uint8_t event, uint8_t active, uint8_t attr=ZCHAR);
|
||||
void editSingleName(coord_t x, coord_t y, const pm_char *label, char *name, uint8_t size, uint8_t event, uint8_t active);
|
||||
|
||||
#if MENU_COLUMNS > 1
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay);
|
||||
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(x, y, event, attr, str, delay)
|
||||
#else
|
||||
uint8_t editDelay(const coord_t y, const uint8_t event, const uint8_t attr, const pm_char *str, uint8_t delay);
|
||||
#define EDIT_DELAY(x, y, event, attr, str, delay) editDelay(y, event, attr, str, delay)
|
||||
#endif
|
||||
|
||||
#define WARNING_TYPE_ASTERISK 0
|
||||
#define WARNING_TYPE_CONFIRM 1
|
||||
#define WARNING_TYPE_INPUT 2
|
||||
|
||||
void copySelection(char * dst, const char * src, uint8_t size);
|
||||
|
||||
extern const pm_char * warningText;
|
||||
extern const pm_char * warningInfoText;
|
||||
extern uint8_t warningInfoLength;
|
||||
extern uint8_t warningResult;
|
||||
extern uint8_t warningType;
|
||||
|
||||
#define COPY_MODE 1
|
||||
#define MOVE_MODE 2
|
||||
extern uint8_t s_copyMode;
|
||||
extern int8_t s_copySrcRow;
|
||||
extern int8_t s_copyTgtOfs;
|
||||
extern uint8_t s_currIdx;
|
||||
|
||||
#define MENU_X 30
|
||||
#define MENU_Y 16
|
||||
#define MENU_W LCD_W-(2*MENU_X)
|
||||
@@ -360,4 +468,8 @@ void menuChannelsView(uint8_t event);
|
||||
typedef int16_t (*FnFuncP) (int16_t x);
|
||||
void drawFunction(FnFuncP fn, uint8_t offset=0);
|
||||
|
||||
void onSourceLongEnterPress(const char *result);
|
||||
|
||||
uint8_t switchToMix(uint8_t source);
|
||||
|
||||
#endif // _MENUS_H_
|
||||
|
||||
@@ -71,7 +71,7 @@ INIT_STOPS(stops100, 3, -100, 0, 100)
|
||||
INIT_STOPS(stops1000, 3, -1000, 0, 1000)
|
||||
INIT_STOPS(stopsSwitch, 15, SWSRC_FIRST, CATEGORY_END(-SWSRC_FIRST_LOGICAL_SWITCH), CATEGORY_END(-SWSRC_FIRST_TRIM), CATEGORY_END(-SWSRC_LAST_SWITCH+1), 0, CATEGORY_END(SWSRC_LAST_SWITCH), CATEGORY_END(SWSRC_FIRST_TRIM-1), CATEGORY_END(SWSRC_FIRST_LOGICAL_SWITCH-1), SWSRC_LAST)
|
||||
|
||||
void onSourceLongEnterPress(const char *result)
|
||||
void onSourceLongEnterPress(const char * result)
|
||||
{
|
||||
if (result == STR_MENU_INPUTS)
|
||||
checkIncDecSelection = getFirstAvailable(MIXSRC_FIRST_INPUT, MIXSRC_LAST_INPUT, isInputAvailable)+1;
|
||||
|
||||
@@ -67,6 +67,10 @@ void displayPopup(const char *title)
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
const pm_uchar asterisk_lbm[] PROGMEM = {
|
||||
#include "asterisk.lbm"
|
||||
};
|
||||
|
||||
void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SOUND_ARG)
|
||||
{
|
||||
lcdClear();
|
||||
|
||||
@@ -178,7 +178,7 @@ void menuStatisticsDebug(uint8_t event)
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
|
||||
|
||||
#if defined(USB_SERIAL)
|
||||
#if !defined(SIMU) && defined(USB_SERIAL)
|
||||
lcd_putsLeft(MENU_DEBUG_Y_USB, "Usb");
|
||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_USB, charsWritten, LEFT);
|
||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
|
||||
|
||||
@@ -59,7 +59,7 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
||||
#undef MARKER_WIDTH
|
||||
}
|
||||
|
||||
void displayColumnHeader(const char * const *headers, uint8_t index)
|
||||
void drawColumnHeader(const char * const *headers, uint8_t index)
|
||||
{
|
||||
lcdDrawText(17*FW, 0, headers[index], 0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
macro(add_lua_export_target target)
|
||||
add_custom_command(
|
||||
OUTPUT lua_exports_${target}.inc
|
||||
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${INTTYPES_INCLUDE_OPTION} ${RADIO_SRC_DIRECTORY}/myeeprom.h | grep LEXP > lua_exports_${target}.txt
|
||||
COMMAND python ${RADIO_DIRECTORY}/util/luaexport.py ${VERSION} lua_exports_${target}.txt lua_exports_${target}.inc lua_fields_${target}.txt
|
||||
)
|
||||
add_custom_target(lua_export_${target} DEPENDS lua_exports_${target}.inc)
|
||||
endmacro(add_lua_export_target)
|
||||
|
||||
add_lua_export_target(taranis -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(taranis_x9e -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(horus -DPCBHORUS -DLUA -DVIRTUALINPUTS)
|
||||
@@ -71,11 +71,6 @@
|
||||
|
||||
#define FIND_FIELD_DESC 0x01
|
||||
|
||||
struct LuaField {
|
||||
uint16_t id;
|
||||
char desc[50];
|
||||
};
|
||||
|
||||
/*luadoc
|
||||
@function getVersion()
|
||||
|
||||
@@ -255,7 +250,7 @@ void luaGetValueAndPush(int src)
|
||||
/**
|
||||
Return field data for a given field name
|
||||
*/
|
||||
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0)
|
||||
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
|
||||
{
|
||||
// TODO better search method (binary lookup)
|
||||
for (unsigned int n=0; n<DIM(luaSingleFields); ++n) {
|
||||
|
||||
@@ -39,16 +39,12 @@
|
||||
|
||||
#if defined(LUA)
|
||||
|
||||
#if !defined(SIMU)
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
#include <lrotable.h>
|
||||
#if !defined(SIMU)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern lua_State *L;
|
||||
extern bool luaLcdAllowed;
|
||||
@@ -149,10 +145,13 @@ extern "C" {
|
||||
#elif defined(PCBHORUS)
|
||||
#define IS_MASKABLE(key) ((key) != KEY_EXIT && (key) != KEY_ENTER)
|
||||
#endif
|
||||
struct LuaField {
|
||||
uint16_t id;
|
||||
char desc[50];
|
||||
};
|
||||
bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags=0);
|
||||
#else // #if defined(LUA)
|
||||
|
||||
#define LUA_LOAD_MODEL_SCRIPTS()
|
||||
|
||||
#endif // #if defined(LUA)
|
||||
|
||||
#endif // #ifndef lua_api_h
|
||||
|
||||
@@ -1383,7 +1383,8 @@ enum TelemetrySensorFormula
|
||||
TELEM_FORMULA_LAST = TELEM_FORMULA_DIST
|
||||
};
|
||||
|
||||
PACK(typedef struct {
|
||||
PACK(class TelemetrySensor {
|
||||
public:
|
||||
union {
|
||||
uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type.
|
||||
uint16_t persistentValue;
|
||||
@@ -1434,7 +1435,7 @@ PACK(typedef struct {
|
||||
bool isPrecConfigurable() const;
|
||||
int32_t getPrecMultiplier() const;
|
||||
int32_t getPrecDivisor() const;
|
||||
}) TelemetrySensor;
|
||||
}) ;
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
|
||||
@@ -37,17 +37,6 @@
|
||||
#include "opentx.h"
|
||||
#include "timers.h"
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#elif defined(PCBTARANIS)
|
||||
const pm_uchar asterisk_lbm[] PROGMEM = {
|
||||
#include "bitmaps/taranis/asterisk.lbm"
|
||||
};
|
||||
#else
|
||||
const pm_uchar asterisk_lbm[] PROGMEM = {
|
||||
#include "bitmaps/9x/asterisk.lbm"
|
||||
};
|
||||
#endif
|
||||
|
||||
EEGeneral g_eeGeneral;
|
||||
ModelData g_model;
|
||||
|
||||
@@ -1600,7 +1589,7 @@ uint16_t s_cnt_samples_thr_10s;
|
||||
uint16_t s_sum_samples_thr_10s;
|
||||
#endif
|
||||
|
||||
FORCEINLINE void evalTrims()
|
||||
void evalTrims()
|
||||
{
|
||||
uint8_t phase = mixerCurrentFlightMode;
|
||||
for (uint8_t i=0; i<NUM_STICKS; i++) {
|
||||
|
||||
@@ -1262,7 +1262,7 @@ void applyDefaultTemplate();
|
||||
|
||||
void incSubtrim(uint8_t idx, int16_t inc);
|
||||
void instantTrim();
|
||||
FORCEINLINE void evalTrims();
|
||||
void evalTrims();
|
||||
void copyTrimsToOffset(uint8_t ch);
|
||||
void copySticksToOffset(uint8_t ch);
|
||||
void moveTrimsToOffsets();
|
||||
@@ -1613,6 +1613,7 @@ void convertUnit(getvalue_t & val, uint8_t & unit); // TODO check FORCEINLINE on
|
||||
#if defined(CPUARM)
|
||||
uint8_t zlen(const char *str, uint8_t size);
|
||||
bool zexist(const char *str, uint8_t size);
|
||||
unsigned int effectiveLen(const char * str, unsigned int size);
|
||||
char * strcat_zchar(char *dest, const char *name, uint8_t size, const char *defaultName=NULL, uint8_t defaultNameSize=0, uint8_t defaultIdx=0);
|
||||
#define strcat_phasename(dest, idx) strcat_zchar(dest, g_model.flightModeData[idx].name, LEN_FLIGHT_MODE_NAME, STR_FP, PSIZE(TR_FP), idx+1)
|
||||
#if defined(EEPROM)
|
||||
|
||||
@@ -36,9 +36,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "diskio.h"
|
||||
#include "ff.h"
|
||||
|
||||
#define LIST_NONE_SD_FILE 1
|
||||
#include "opentx.h"
|
||||
|
||||
const char * sdCheckAndCreateDirectory(const char * path)
|
||||
{
|
||||
@@ -72,8 +70,7 @@ bool isFileAvailable(const char * filename, const char * directory)
|
||||
return isFileAvailable(path);
|
||||
}
|
||||
|
||||
#define LEN_FILE_EXTENSION 4
|
||||
char * getFileExtension(char * filename, int size=0)
|
||||
char * getFileExtension(char * filename, int size)
|
||||
{
|
||||
int len = strlen(filename);
|
||||
if (size != 0 && size < len) {
|
||||
@@ -122,11 +119,11 @@ int findNextFileIndex(char * filename, const char * directory)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool sdListFiles(const char *path, const char *extension, const uint8_t maxlen, const char *selection, uint8_t flags=0)
|
||||
bool sdListFiles(const char * path, const char * extension, const uint8_t maxlen, const char * selection, uint8_t flags)
|
||||
{
|
||||
FILINFO fno;
|
||||
DIR dir;
|
||||
char *fn; /* This function is assuming non-Unicode cfg. */
|
||||
char * fn; /* This function is assuming non-Unicode cfg. */
|
||||
#if _USE_LFN
|
||||
TCHAR lfn[_MAX_LFN + 1];
|
||||
fno.lfname = lfn;
|
||||
|
||||
@@ -92,6 +92,9 @@ inline const pm_char * SDCARD_ERROR(FRESULT result)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define LEN_FILE_EXTENSION 4
|
||||
char * getFileExtension(char * filename, int size=0);
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define O9X_FOURCC 0x3378396F // o9x for Taranis
|
||||
#elif defined(PCBSKY9X)
|
||||
@@ -104,7 +107,10 @@ bool isFileAvailable(const char * filename);
|
||||
int findNextFileIndex(char * filename, const char * directory);
|
||||
|
||||
const char * sdCopyFile(const char * src, const char * dest);
|
||||
const char * sdCopyFile(const char * filename, const char * srcDir, const char * destDir);
|
||||
const char * sdCopyFile(const char * srcFilename, const char * srcDir, const char * destFilename, const char * destDir);
|
||||
|
||||
#define LIST_NONE_SD_FILE 1
|
||||
bool sdListFiles(const char * path, const char * extension, const uint8_t maxlen, const char * selection, uint8_t flags=0);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -109,20 +109,17 @@ Open9xSim::Open9xSim(FXApp* a):
|
||||
for (int i=0; i<4; i++) {
|
||||
switch (i) {
|
||||
#define L LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT|LAYOUT_FIX_X|LAYOUT_FIX_Y
|
||||
#undef X0
|
||||
#define X0 10
|
||||
#define Y0 10
|
||||
case 0:
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_HORIZONTAL,X0+0,Y0+100,100,20);
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_HORIZONTAL,10,110,100,20);
|
||||
break;
|
||||
case 1:
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_VERTICAL,X0+100,Y0+0,20,100);
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_VERTICAL,110,10,20,100);
|
||||
break;
|
||||
case 2:
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_VERTICAL,X0+120,Y0+0,20,100);
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_VERTICAL,130,10,20,100);
|
||||
break;
|
||||
case 3:
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_HORIZONTAL,X0+140,Y0+100,100,20);
|
||||
sliders[i]=new FXSlider(hf1,NULL,0,L|SLIDER_HORIZONTAL,150,110,100,20);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
||||
@@ -228,10 +228,6 @@ void storageFormat()
|
||||
storageCreateModelsList();
|
||||
}
|
||||
|
||||
struct StorageModelsList {
|
||||
FIL file;
|
||||
};
|
||||
|
||||
const char * storageOpenModelsList(StorageModelsList * storage)
|
||||
{
|
||||
FRESULT result = f_open(&storage->file, RADIO_MODELSLIST_PATH, FA_OPEN_EXISTING | FA_READ);
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SDCARD_RAW_H_
|
||||
#define _SDCARD_RAW_H_
|
||||
|
||||
#include "ff.h"
|
||||
|
||||
#define DEFAULT_CATEGORY "Models"
|
||||
#define DEFAULT_MODEL_FILENAME "model01.bin"
|
||||
|
||||
@@ -42,3 +47,22 @@ const char * loadModel(const char * filename);
|
||||
const char * createModel(int category);
|
||||
|
||||
|
||||
struct StorageModelsList {
|
||||
FIL file;
|
||||
};
|
||||
|
||||
const char * storageOpenModelsList(StorageModelsList * storage);
|
||||
bool storageReadNextModel(StorageModelsList * storage, char * line, int maxlen);
|
||||
const char * storageInsertModel(const char * name, int category, int position);
|
||||
const char * storageRemoveModel(int category, int position);
|
||||
const char * storageRenameModel(const char * name, int category, int position);
|
||||
|
||||
const char * storageInsertCategory(const char * name, int position);
|
||||
const char * storageRenameCategory(int category, const char * name);
|
||||
const char * storageRemoveCategory(int category);
|
||||
bool storageReadNextCategory(StorageModelsList * storage, char * line, int maxlen);
|
||||
bool storageSeekCategory(StorageModelsList * storage, int category);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -180,6 +180,8 @@ void init_pxx( uint32_t module_index );
|
||||
void disable_pxx( uint32_t module_index );
|
||||
void init_dsm2( uint32_t module_index );
|
||||
void disable_dsm2( uint32_t module_index );
|
||||
void init_crossfire( uint32_t module_index );
|
||||
void disable_crossfire( uint32_t module_index );
|
||||
|
||||
// Trainer driver
|
||||
void init_trainer_ppm(void);
|
||||
@@ -217,7 +219,7 @@ void watchdogInit(unsigned int duration);
|
||||
// ADC driver
|
||||
void adcInit(void);
|
||||
void adcRead(void);
|
||||
inline uint16_t getAnalogValue(uint32_t value);
|
||||
uint16_t getAnalogValue(uint32_t value);
|
||||
|
||||
#if defined(REV3)
|
||||
#define BATT_SCALE 120
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
|
||||
#include "diskio.h"
|
||||
#include <string.h> // memcpy
|
||||
|
||||
#include "../horus/sdio_sd.h"
|
||||
#include "stm32f4xx.h"
|
||||
#include "../../opentx.h"
|
||||
#include "sdio_sd.h"
|
||||
|
||||
#define BLOCK_SIZE 512 /* Block Size in Bytes */
|
||||
|
||||
|
||||
@@ -92,6 +92,14 @@ void disable_no_pulses(uint32_t port)
|
||||
TIM1->CR1 &= ~TIM_CR1_CEN ;
|
||||
}
|
||||
|
||||
void init_crossfire(uint32_t port)
|
||||
{
|
||||
}
|
||||
|
||||
void disable_crossfire(uint32_t port)
|
||||
{
|
||||
}
|
||||
|
||||
void init_pxx(uint32_t port)
|
||||
{
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
|
||||
#include "../../opentx.h"
|
||||
|
||||
extern Fifo<512> telemetryFifo;
|
||||
|
||||
void telemetryPortInit(uint32_t baudrate)
|
||||
{
|
||||
if (baudrate == 0) {
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
#pragma data_alignment = 4
|
||||
#endif /* USB_OTG_HS_INTERNAL_DMA_ENABLED */
|
||||
|
||||
#include "opentx.h"
|
||||
#include "../../opentx.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../horus/usb_conf.h"
|
||||
#include "usb_conf.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../horus/usbd_desc.h"
|
||||
#include "usbd_desc.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "../horus/board_horus.h"
|
||||
#include "../horus/usbd_conf.h"
|
||||
#include "board_horus.h"
|
||||
#include "usbd_conf.h"
|
||||
#include "usbd_core.h"
|
||||
#include "usbd_req.h"
|
||||
#include "usb_regs.h"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
set(SRC ${SRC} simu.cpp targets/simu/simpgmspace.cpp)
|
||||
foreach(FILE ${SRC})
|
||||
set(SIMU_SRC ${SIMU_SRC} ../../${FILE})
|
||||
endforeach()
|
||||
|
||||
add_definitions(-DSIMU)
|
||||
add_executable(simu WIN32 ${SIMU_SRC} )
|
||||
add_dependencies(simu ${FIRMWARE_DEPENDENCIES})
|
||||
|
||||
target_include_directories(simu PUBLIC /usr/local/include/fox-1.6 PUBLIC /usr/include/fox-1.6 /opt/local/include/fox-1.6)
|
||||
target_link_libraries(simu FOX-1.6 pthread)
|
||||
@@ -34,7 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "../../opentx.h"
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -242,8 +242,8 @@ void checkRotaryEncoder(void);
|
||||
#if !defined(SIMU)
|
||||
#define wdt_disable()
|
||||
void watchdogInit(unsigned int duration);
|
||||
#define wdt_enable(x) watchdogInit(1500)
|
||||
#define wdt_reset() IWDG->KR = 0xAAAA
|
||||
#define wdt_enable(x) watchdogInit(1500)
|
||||
#define wdt_reset() IWDG->KR = 0xAAAA
|
||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
||||
@@ -252,7 +252,7 @@ void watchdogInit(unsigned int duration);
|
||||
// ADC driver
|
||||
void adcInit(void);
|
||||
void adcRead(void);
|
||||
inline uint16_t getAnalogValue(uint32_t value);
|
||||
uint16_t getAnalogValue(uint32_t value);
|
||||
|
||||
#define BATT_SCALE 150
|
||||
|
||||
@@ -372,6 +372,7 @@ void setTopBatteryValue(uint32_t volts);
|
||||
void usbJoystickUpdate(void);
|
||||
#endif
|
||||
|
||||
extern uint8_t currentTrainerMode;
|
||||
void checkTrainerSettings(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,13 +34,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "../../opentx.h"
|
||||
#include "../../thirdparty/FatFs/diskio.h"
|
||||
#include "../../thirdparty/FatFs/ff.h"
|
||||
#include "../../thirdparty/CoOS/kernel/CoOS.h"
|
||||
#include "../../debug.h"
|
||||
#include "board_taranis.h"
|
||||
#include "hal.h"
|
||||
|
||||
/* Definitions for MMC/SDC command */
|
||||
#define CMD0 (0x40+0) /* GO_IDLE_STATE */
|
||||
|
||||
@@ -36,17 +36,6 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
#define MENUS_STACK_SIZE 2000
|
||||
#define MIXER_STACK_SIZE 500
|
||||
#define AUDIO_STACK_SIZE 500
|
||||
#define BLUETOOTH_STACK_SIZE 500
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define _ALIGNED(x) __declspec(align(x))
|
||||
#elif defined(__GNUC__)
|
||||
#define _ALIGNED(x) __attribute__ ((aligned(x)))
|
||||
#endif
|
||||
|
||||
OS_TID menusTaskId;
|
||||
// menus stack must be aligned to 8 bytes otherwise printf for %f does not work!
|
||||
TaskStack<MENUS_STACK_SIZE> _ALIGNED(8) menusStack;
|
||||
@@ -102,12 +91,6 @@ uint16_t getStackAvailable(void * address, uint16_t size)
|
||||
#endif
|
||||
}
|
||||
|
||||
template<int SIZE>
|
||||
uint16_t TaskStack<SIZE>::available()
|
||||
{
|
||||
return getStackAvailable(stack, SIZE);
|
||||
}
|
||||
|
||||
void stackPaint()
|
||||
{
|
||||
menusStack.paint();
|
||||
|
||||
@@ -43,6 +43,19 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MENUS_STACK_SIZE 2000
|
||||
#define MIXER_STACK_SIZE 500
|
||||
#define AUDIO_STACK_SIZE 500
|
||||
#define BLUETOOTH_STACK_SIZE 500
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define _ALIGNED(x) __declspec(align(x))
|
||||
#elif defined(__GNUC__)
|
||||
#define _ALIGNED(x) __attribute__ ((aligned(x)))
|
||||
#endif
|
||||
|
||||
uint16_t getStackAvailable(void * address, uint16_t size);
|
||||
|
||||
template<int SIZE>
|
||||
class TaskStack
|
||||
{
|
||||
@@ -50,7 +63,10 @@ class TaskStack
|
||||
TaskStack() { }
|
||||
void paint();
|
||||
uint16_t size();
|
||||
uint16_t available();
|
||||
uint16_t available()
|
||||
{
|
||||
return getStackAvailable(stack, SIZE);
|
||||
}
|
||||
OS_STK stack[SIZE];
|
||||
};
|
||||
|
||||
@@ -58,4 +74,16 @@ void stackPaint();
|
||||
uint16_t stackSize();
|
||||
uint16_t stackAvailable();
|
||||
|
||||
extern OS_TID menusTaskId;
|
||||
// menus stack must be aligned to 8 bytes otherwise printf for %f does not work!
|
||||
extern TaskStack<MENUS_STACK_SIZE> _ALIGNED(8) menusStack;
|
||||
|
||||
extern OS_TID mixerTaskId;
|
||||
extern TaskStack<MIXER_STACK_SIZE> mixerStack;
|
||||
|
||||
extern OS_TID audioTaskId;
|
||||
extern TaskStack<AUDIO_STACK_SIZE> audioStack;
|
||||
|
||||
void tasksStart();
|
||||
|
||||
#endif // _TASKS_ARM_H_
|
||||
|
||||
@@ -491,7 +491,7 @@ enum FrSkyDataState {
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(CPUARM) || defined(PCBFLAMENCO)
|
||||
#if defined(CPUARM)
|
||||
#define frskySendAlarms()
|
||||
#else
|
||||
#define SEND_RSSI_ALARMS 6
|
||||
@@ -550,6 +550,8 @@ void frskySetCellVoltage(uint8_t battnumber, frskyCellVoltage_t cellVolts);
|
||||
void frskyUpdateCells(void);
|
||||
#endif
|
||||
|
||||
void processSerialData(uint8_t data);
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
inline uint8_t modelTelemetryProtocol()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#ifndef TELEMETRY_H
|
||||
#define TELEMETRY_H
|
||||
|
||||
extern Fifo<512> telemetryFifo;
|
||||
|
||||
enum TelemetryProtocol
|
||||
{
|
||||
TELEM_PROTO_FRSKY_D,
|
||||
@@ -167,6 +169,8 @@ class TelemetryItem
|
||||
extern TelemetryItem telemetryItems[MAX_SENSORS];
|
||||
extern uint8_t allowNewSensors;
|
||||
|
||||
bool isGPSSensor(int sensor);
|
||||
|
||||
inline bool isTelemetryFieldAvailable(int index)
|
||||
{
|
||||
TelemetrySensor & sensor = g_model.telemetrySensors[index];
|
||||
|
||||
@@ -145,7 +145,6 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
|
||||
/* else will try the tag method */
|
||||
}
|
||||
else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) {
|
||||
TRACE("ERREUR ICI");
|
||||
luaG_typeerror(L, t, "index");
|
||||
}
|
||||
if (ttisfunction(tm) || ttislightfunction(tm)) {
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef trainer_input_h
|
||||
#define trainer_input_h
|
||||
#ifndef _TRAINER_INPUT_H_
|
||||
#define _TRAINER_INPUT_H_
|
||||
|
||||
#include "myeeprom.h"
|
||||
#include "opentx.h"
|
||||
|
||||
// Trainer input channels
|
||||
extern int16_t ppmInput[NUM_TRAINER];
|
||||
@@ -86,4 +86,4 @@ inline void captureTrainerPulses(uint16_t capture)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // _TRAINER_INPUT_H_
|
||||
|
||||
@@ -597,11 +597,11 @@ extern const pm_char STR_CURRENT[];
|
||||
|
||||
#if defined(NAVIGATION_MENUS)
|
||||
extern const pm_char STR_SELECT_MODEL[];
|
||||
extern const pm_char STR_CREATE_CATEGORY[];
|
||||
extern const pm_char STR_RENAME_CATEGORY[];
|
||||
extern const pm_char STR_DELETE_CATEGORY[];
|
||||
extern const pm_char STR_CREATE_CATEGORY[];
|
||||
extern const pm_char STR_RENAME_CATEGORY[];
|
||||
extern const pm_char STR_DELETE_CATEGORY[];
|
||||
extern const pm_char STR_CREATE_MODEL[];
|
||||
extern const pm_char STR_DUPLICATE_MODEL[];
|
||||
extern const pm_char STR_DUPLICATE_MODEL[];
|
||||
extern const pm_char STR_COPY_MODEL[];
|
||||
extern const pm_char STR_MOVE_MODEL[];
|
||||
extern const pm_char STR_DELETE_MODEL[];
|
||||
@@ -669,10 +669,10 @@ extern const pm_char STR_NO_SOUNDS_ON_SD[];
|
||||
extern const pm_char STR_NO_MODELS_ON_SD[];
|
||||
extern const pm_char STR_NO_BITMAPS_ON_SD[];
|
||||
extern const pm_char STR_NO_SCRIPTS_ON_SD[];
|
||||
extern const pm_char STR_SCRIPT_SYNTAX_ERROR[];
|
||||
extern const pm_char STR_SCRIPT_PANIC[];
|
||||
extern const pm_char STR_SCRIPT_KILLED[];
|
||||
extern const pm_char STR_SCRIPT_ERROR[];
|
||||
extern const pm_char STR_SCRIPT_SYNTAX_ERROR[];
|
||||
extern const pm_char STR_SCRIPT_PANIC[];
|
||||
extern const pm_char STR_SCRIPT_KILLED[];
|
||||
extern const pm_char STR_SCRIPT_ERROR[];
|
||||
extern const pm_char STR_PLAY_FILE[];
|
||||
extern const pm_char STR_ASSIGN_BITMAP[];
|
||||
extern const pm_char STR_EXECUTE_FILE[];
|
||||
@@ -724,15 +724,48 @@ extern const pm_char STR_BLCOLOR[];
|
||||
#endif
|
||||
|
||||
struct LanguagePack {
|
||||
const char *id;
|
||||
const char *name;
|
||||
const char * id;
|
||||
const char * name;
|
||||
void (*playNumber)(getvalue_t number, uint8_t unit, uint8_t flags, uint8_t id);
|
||||
void (*playDuration)(int seconds, uint8_t flags, uint8_t id);
|
||||
};
|
||||
extern const LanguagePack * LP_CONST languagePacks[];
|
||||
|
||||
extern const LanguagePack * currentLanguagePack;
|
||||
extern uint8_t currentLanguagePackIdx;
|
||||
|
||||
extern LP_CONST LanguagePack czLanguagePack;
|
||||
extern LP_CONST LanguagePack enLanguagePack;
|
||||
extern LP_CONST LanguagePack esLanguagePack;
|
||||
extern LP_CONST LanguagePack frLanguagePack;
|
||||
extern LP_CONST LanguagePack deLanguagePack;
|
||||
extern LP_CONST LanguagePack itLanguagePack;
|
||||
extern LP_CONST LanguagePack plLanguagePack;
|
||||
extern LP_CONST LanguagePack ptLanguagePack;
|
||||
extern LP_CONST LanguagePack skLanguagePack;
|
||||
extern LP_CONST LanguagePack seLanguagePack;
|
||||
extern LP_CONST LanguagePack huLanguagePack;
|
||||
|
||||
static const LanguagePack * LP_CONST languagePacks[] = {
|
||||
// alphabetical order
|
||||
&czLanguagePack,
|
||||
&deLanguagePack,
|
||||
&enLanguagePack,
|
||||
&esLanguagePack,
|
||||
&frLanguagePack,
|
||||
&huLanguagePack,
|
||||
&itLanguagePack,
|
||||
&plLanguagePack,
|
||||
&ptLanguagePack,
|
||||
&seLanguagePack,
|
||||
&skLanguagePack,
|
||||
NULL
|
||||
};
|
||||
|
||||
#if defined(SIMU)
|
||||
#define LANGUAGE_PACK_DECLARE(lng, name) LP_CONST LanguagePack lng ## LanguagePack = { #lng, name, lng ## _ ## playNumber, lng ## _ ## playDuration }
|
||||
#else
|
||||
#define LANGUAGE_PACK_DECLARE(lng, name) extern LP_CONST LanguagePack lng ## LanguagePack = { #lng, name, lng ## _ ## playNumber, lng ## _ ## playDuration }
|
||||
#endif
|
||||
#define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) LANGUAGE_PACK_DECLARE(lng, name); const LanguagePack * currentLanguagePack = & lng ## LanguagePack; uint8_t currentLanguagePackIdx
|
||||
inline PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t flags) { currentLanguagePack->playNumber(number, unit, flags, id); }
|
||||
inline PLAY_FUNCTION(playDuration, int seconds, uint8_t flags) { currentLanguagePack->playDuration(seconds, flags, id); }
|
||||
@@ -773,7 +806,7 @@ extern const pm_char STR_BLCOLOR[];
|
||||
extern const pm_char STR_PREFLIGHT[];
|
||||
extern const pm_char STR_CHECKLIST[];
|
||||
extern const pm_char STR_VIEW_NOTES[];
|
||||
extern const pm_char STR_MODEL_SELECT[];
|
||||
extern const pm_char STR_MODEL_SELECT[];
|
||||
extern const pm_char STR_RESET_SUBMENU[];
|
||||
extern const pm_char STR_LOWALARM[];
|
||||
extern const pm_char STR_CRITICALALARM[];
|
||||
@@ -800,10 +833,10 @@ extern const pm_char STR_MODEL_SELECT[];
|
||||
extern const pm_char STR_TELEMETRYFULL[];
|
||||
extern const pm_char STR_INVERTED_SERIAL[];
|
||||
extern const pm_char STR_IGNORE_INSTANCE[];
|
||||
extern const pm_char STR_DISCOVER_SENSORS[];
|
||||
extern const pm_char STR_DISCOVER_SENSORS[];
|
||||
extern const pm_char STR_STOP_DISCOVER_SENSORS[];
|
||||
extern const pm_char STR_DELETE_ALL_SENSORS[];
|
||||
extern const pm_char STR_CONFIRMDELETE[];
|
||||
extern const pm_char STR_CONFIRMDELETE[];
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS)
|
||||
@@ -823,10 +856,10 @@ extern const pm_char STR_MODEL_SELECT[];
|
||||
extern const pm_char STR_SMOOTH[];
|
||||
extern const pm_char STR_COPY_STICKS_TO_OFS[];
|
||||
extern const pm_char STR_COPY_TRIMS_TO_OFS[];
|
||||
extern const pm_char STR_INCDEC[];
|
||||
extern const pm_char STR_GLOBALVAR[];
|
||||
extern const pm_char STR_MIXSOURCE[];
|
||||
extern const pm_char STR_CONSTANT[];
|
||||
extern const pm_char STR_INCDEC[];
|
||||
extern const pm_char STR_GLOBALVAR[];
|
||||
extern const pm_char STR_MIXSOURCE[];
|
||||
extern const pm_char STR_CONSTANT[];
|
||||
extern const pm_char STR_TOP_BAR[];
|
||||
extern const pm_char STR_ALTITUDE[];
|
||||
extern const pm_char STR_SCALE[];
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
file(GLOB translations *.h.txt)
|
||||
foreach(translation ${translations})
|
||||
get_filename_component(language ${translation} NAME_WE)
|
||||
get_filename_component(path ${translation} DIRECTORY)
|
||||
set(target ${language}.h)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}
|
||||
COMMAND python ${RADIO_DIRECTORY}/util/translate.py ${translation} ${target} ${language}
|
||||
DEPENDS ${translation}
|
||||
)
|
||||
list(APPEND translations_files ${target})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(firmware_translations DEPENDS ${translations_files})
|
||||