1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 17:55:19 +03:00

Merge branch 'next' into kilrah/antennaselection

# Conflicts:
#	radio/src/translations/de.h.txt
#	radio/src/translations/es.h.txt
#	radio/src/translations/it.h.txt
#	radio/src/translations/pt.h.txt
#	radio/src/translations/se.h.txt
This commit is contained in:
Andre Bernet 2016-03-31 15:11:12 +04:00
commit 3d4f3611b0
163 changed files with 4167 additions and 5373 deletions

View file

@ -9,12 +9,16 @@ before_install:
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes - sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
- sudo apt-get update -qq - sudo apt-get update -qq
- rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
install: install:
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev python-qt4 - sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.9 libclang-3.9-dev python-qt4
- sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
- export CXX="g++-5" CC="gcc-5" - export CXX="g++-5" CC="gcc-5"
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/gcc-avr_1%253a4.8-2.1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/libmpfr4_3.1.2-1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/avr-libc_1%253a1.8.0-4.1_all.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/binutils-avr_2.23.1-2.1_amd64.deb
- wget --quiet http://firmware.ardupilot.org/Tools/Travis/libmpc3_1.0.1-1ubuntu1_amd64.deb
- sudo dpkg --install gcc-avr_1%3a4.8-2.1_amd64.deb avr-libc_1%3a1.8.0-4.1_all.deb libmpfr4_3.1.2-1_amd64.deb binutils-avr_2.23.1-2.1_amd64.deb libmpc3_1.0.1-1ubuntu1_amd64.deb
script: script:
- ./radio/util/commit-tests.sh . - ./radio/util/commit-tests.sh .

View file

@ -11,6 +11,9 @@ message(STATUS "OpenTX ${VERSION}")
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0020 NEW) cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0023 OLD) cmake_policy(SET CMP0023 OLD)
if(POLICY CMP0043)
cmake_policy(SET CMP0043 NEW)
endif()
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
@ -28,6 +31,14 @@ find_package(Qt5LinguistTools)
find_package(Qt5PrintSupport) find_package(Qt5PrintSupport)
find_package(Qt5Multimedia) find_package(Qt5Multimedia)
message(STATUS "Looking for SDL ")
find_package(Sdl)
if(SDL_FOUND)
message("SDL Include Path: " ${SDL_INCLUDE_DIR})
else()
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
endif()
include(Macros) include(Macros)
today(DATE) today(DATE)
now(TIME) now(TIME)

View file

@ -1,4 +1,5 @@
macro(add_bitmaps_target targetname filter width format) macro(add_bitmaps_target targetname filter width format)
set(bitmaps_files)
file(GLOB bitmaps ${filter}) file(GLOB bitmaps ${filter})
foreach(bitmap ${bitmaps}) foreach(bitmap ${bitmaps})
get_filename_component(target ${bitmap} NAME_WE) get_filename_component(target ${bitmap} NAME_WE)
@ -19,4 +20,5 @@ macro(add_truetype_font_target radio name font size bold)
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target} COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY} WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
) )
set(ttf_horus_fonts_targets ${ttf_horus_fonts_targets} ttf_${radio}_${name})
endmacro(add_truetype_font_target) endmacro(add_truetype_font_target)

View file

@ -25,15 +25,10 @@ if(TABLE_LAYOUT)
message(STATUS "Using QTableWidget") message(STATUS "Using QTableWidget")
endif(TABLE_LAYOUT) endif(TABLE_LAYOUT)
message(STATUS "Looking for SDL ")
find_package(Sdl)
if(SDL_FOUND) if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR}) include_directories(${SDL_INCLUDE_DIR})
message("SDL Include Path: " ${SDL_INCLUDE_DIR})
add_definitions(-DJOYSTICKS)
add_definitions(-DSIMU_AUDIO) add_definitions(-DSIMU_AUDIO)
else() add_definitions(-DJOYSTICKS)
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
endif() endif()
message(STATUS "Looking for QT lupdate ") message(STATUS "Looking for QT lupdate ")
@ -283,7 +278,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules) install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
# Linux specific code # Linux specific code
set(OperatingSystem "Linux") set(OperatingSystem "Linux")
else() elseif(WIN32)
get_target_property(QtCore_LOCATION Qt5::Core LOCATION) get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH) get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH) get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)

View file

@ -1627,6 +1627,8 @@ class Firmware {
virtual int getCapability(const Capability) = 0; virtual int getCapability(const Capability) = 0;
virtual QTime getMaxTimerStart() = 0;
virtual bool isTelemetrySourceAvailable(int source) = 0; virtual bool isTelemetrySourceAvailable(int source) = 0;
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0; virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;

View file

@ -813,6 +813,16 @@ int OpenTxFirmware::getCapability(const Capability capability)
} }
} }
QTime OpenTxFirmware::getMaxTimerStart()
{
if (IS_TARANIS(board) || IS_HORUS(board))
return QTime(23, 59, 59);
else if (IS_ARM(board))
return QTime(8, 59, 59);
else
return QTime(0, 59, 59);
}
bool OpenTxFirmware::isTelemetrySourceAvailable(int source) bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
{ {
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX)) if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
@ -1161,8 +1171,117 @@ void registerOpenTxFirmwares()
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } }; Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } }; Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
/* Taranis Plus board */
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis board */
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Horus board */
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board with M128 chip */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("Turnigy 9XR with m128 chip"), BOARD_M128);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("Turnigy 9XR"), BOARD_STOCK);
firmware->addOptions(extr_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9x board */ /* 9x board */
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X board"), BOARD_STOCK); firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X with stock board"), BOARD_STOCK);
firmware->addOptions(ext_options); firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@ -1198,7 +1317,7 @@ void registerOpenTxFirmwares()
firmwares.push_back(firmware); firmwares.push_back(firmware);
/* 9x board with M128 chip */ /* 9x board with M128 chip */
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("M128 / 9X board"), BOARD_M128); firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("9X with stock board and m128 chip"), BOARD_M128);
firmware->addOptions(ext_options); firmware->addOptions(ext_options);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
@ -1227,69 +1346,52 @@ void registerOpenTxFirmwares()
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware); firmwares.push_back(firmware);
/* 9XR board */ /* ar9x board */
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("9XR"), BOARD_STOCK); firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("9X with AR9X board"), BOARD_AR9X);
firmware->addOptions(extr_options); firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar")); // firmware->addOption("rtc", QObject::tr("Optional RTC added"));
firmware->addOption("imperial", QObject::tr("Imperial units")); // firmware->addOption("volume", QObject::tr("i2c volume control added"));
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
firmware->addOption("novario", QObject::tr("No vario support"));
firmware->addOption("nogps", QObject::tr("No GPS support"));
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware); firmwares.push_back(firmware);
/* 9XR board with M128 chip */ /* Sky9x board */
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("9XR with M128 chip"), BOARD_M128); firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("9X with Sky9x board"), BOARD_SKY9X);
firmware->addOptions(extr_options); firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nosplash", QObject::tr("No splash screen"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus")); firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits")); firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT); firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits")); firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation")); firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control")); firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control")); firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders")); firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph")); firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items")); firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics")); firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
firmware->addOption("imperial", QObject::tr("Imperial units"));
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware); firmwares.push_back(firmware);
/* Gruvin9x board */ /* Gruvin9x board */
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("Gruvin9x board / 9X"), BOARD_GRUVIN9X); firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X);
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support")); firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu")); firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes")); firmware->addOption("nofp", QObject::tr("No flight modes"));
@ -1314,7 +1416,7 @@ void registerOpenTxFirmwares()
firmwares.push_back(firmware); firmwares.push_back(firmware);
/* MEGA2560 board */ /* MEGA2560 board */
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("MEGA2560 board"), BOARD_MEGA2560); firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("DIY MEGA2560 radio"), BOARD_MEGA2560);
addOpenTxLcdOptions(firmware); addOpenTxLcdOptions(firmware);
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry")); firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
firmware->addOptions(ext_options); firmware->addOptions(ext_options);
@ -1343,99 +1445,6 @@ void registerOpenTxFirmwares()
addOpenTxCommonOptions(firmware); addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware); firmwares.push_back(firmware);
/* Sky9x board */
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("Sky9x board / 9X"), BOARD_SKY9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* ar9x board */
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("ar9x board / 9X"), BOARD_AR9X);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("9XR-PRO"), BOARD_9XRPRO);
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
firmware->addOption("nofp", QObject::tr("No flight modes"));
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
firmware->addOption("battgraph", QObject::tr("Battery graph"));
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis board */
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis Plus board */
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Taranis X9E board */
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
firmware->addOption("horussticks", QObject::tr("Horus magnetic sticks"));
addOpenTxTaranisOptions(firmware);
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
/* Horus board */
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
addOpenTxCommonOptions(firmware);
firmwares.push_back(firmware);
default_firmware_variant = GetFirmware("opentx-taranisplus-en"); default_firmware_variant = GetFirmware("opentx-taranisplus-en");
current_firmware_variant = default_firmware_variant; current_firmware_variant = default_firmware_variant;
} }

View file

@ -119,6 +119,8 @@ class OpenTxFirmware: public Firmware {
virtual int getCapability(const Capability); virtual int getCapability(const Capability);
virtual QTime getMaxTimerStart();
virtual bool isTelemetrySourceAvailable(int source); virtual bool isTelemetrySourceAvailable(int source);
virtual int isAvailable(PulsesProtocol proto, int port=0); virtual int isAvailable(PulsesProtocol proto, int port=0);

View file

@ -124,7 +124,7 @@ void FlashFirmwareDialog::on_firmwareLoad_clicked()
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER); QString fileName = QFileDialog::getOpenFileName(this, tr("Open Firmware File"), g.flashDir(), FLASH_FILES_FILTER);
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
fwName = fileName; fwName = fileName;
if (!fwName.isEmpty() && !FirmwareInterface(fwName).isValid()) { if (!fwName.isEmpty() && !fwName.endsWith(".dfu") && !FirmwareInterface(fwName).isValid()) {
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fwName)); QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fwName));
} }
updateUI(); updateUI();

View file

@ -8,9 +8,10 @@
#define HEX_FILES_FILTER "HEX files (*.hex);;" #define HEX_FILES_FILTER "HEX files (*.hex);;"
#define BIN_FILES_FILTER "BIN files (*.bin);;" #define BIN_FILES_FILTER "BIN files (*.bin);;"
#define DFU_FILES_FILTER "DFU files (*.dfu);;"
#define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;" #define EEPE_FILES_FILTER "EEPE EEPROM files (*.eepe);;"
#define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER #define EEPROM_FILES_FILTER "EEPE files (*.eepe *.bin *.hex);;" EEPE_FILES_FILTER BIN_FILES_FILTER HEX_FILES_FILTER
#define FLASH_FILES_FILTER "FLASH files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER #define FLASH_FILES_FILTER "FLASH files (*.bin *.hex *.dfu);;" BIN_FILES_FILTER HEX_FILES_FILTER DFU_FILES_FILTER
#define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER #define EXTERNAL_EEPROM_FILES_FILTER "EEPROM files (*.bin *.hex);;" BIN_FILES_FILTER HEX_FILES_FILTER
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE" #define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE" #define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"

View file

@ -360,16 +360,25 @@ void MainWindow::firmwareDownloadAccepted()
int errnum = hline.mid(6).toInt(); int errnum = hline.mid(6).toInt();
switch(errnum) { switch(errnum) {
case 1: case 1:
errormsg = tr("Not enough memory for all the selected firmware options"); errormsg = tr("Not enough flash available on this board for all the selected options");
break; break;
case 2: case 2:
errormsg = tr("Compilation server termporary failure, try later"); errormsg = tr("Compilation server temporary failure, try later");
break; break;
case 3: case 3:
errormsg = tr("Compilation server too busy, try later"); errormsg = tr("Compilation server too busy, try later");
break; break;
case 4: case 4:
errormsg = tr("Compilation server requires registration, please check OpenTX web site"); errormsg = tr("Compilation error");
break;
case 5:
errormsg = tr("Invalid firmware");
break;
case 6:
errormsg = tr("Invalid board");
break;
case 7:
errormsg = tr("Invalid language");
break; break;
default: default:
errormsg = tr("Unknown server failure, try later"); errormsg = tr("Unknown server failure, try later");

View file

@ -397,7 +397,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
else if (func>=FuncSetTimer1 && func<=FuncSetTimer3) { else if (func>=FuncSetTimer1 && func<=FuncSetTimer3) {
if (modified) cfn.param = QTimeS(fswtchParamTime[i]->time()).seconds(); if (modified) cfn.param = QTimeS(fswtchParamTime[i]->time()).seconds();
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0)); fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59)); fswtchParamTime[i]->setMaximumTime(firmware->getMaxTimerStart());
fswtchParamTime[i]->setTime(QTimeS(cfn.param)); fswtchParamTime[i]->setTime(QTimeS(cfn.param));
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE; widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
} }

View file

@ -43,6 +43,8 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC); ui->countdownBeep->addItem(tr("Haptic"), TimerData::COUNTDOWN_HAPTIC);
} }
ui->value->setMaximumTime(firmware->getMaxTimerStart());
ui->persistent->setField(timer.persistent, this); ui->persistent->setField(timer.persistent, this);
ui->persistent->addItem(tr("Not persistent"), 0); ui->persistent->addItem(tr("Not persistent"), 0);
ui->persistent->addItem(tr("Persistent (flight)"), 1); ui->persistent->addItem(tr("Persistent (flight)"), 1);
@ -66,9 +68,11 @@ TimerPanel::~TimerPanel()
void TimerPanel::update() void TimerPanel::update()
{ {
int min = timer.val / 60; int hour = timer.val / 3600;
int sec = timer.val % 60; int min = (timer.val - (hour * 3600)) / 60;
ui->value->setTime(QTime(0, min, sec)); int sec = (timer.val - (hour * 3600)) % 60;
ui->value->setTime(QTime(hour, min, sec));
if (firmware->getCapability(PermTimers)) { if (firmware->getCapability(PermTimers)) {
int sign = 1; int sign = 1;
@ -94,7 +98,7 @@ QWidget * TimerPanel::getLastFocus()
void TimerPanel::on_value_editingFinished() void TimerPanel::on_value_editingFinished()
{ {
timer.val = ui->value->time().minute()*60 + ui->value->time().second(); timer.val = ui->value->time().hour()*3600 + ui->value->time().minute()*60 + ui->value->time().second();
emit modified(); emit modified();
} }
@ -327,8 +331,8 @@ void ModulePanel::update()
ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES); ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
if (mask & MASK_CHANNELS_RANGE) { if (mask & MASK_CHANNELS_RANGE) {
ui->channelsStart->setMaximum(32 - ui->channelsCount->value()); ui->channelsStart->setMaximum(33 - ui->channelsCount->value());
ui->channelsCount->setMaximum(qMin(16, 32-ui->channelsStart->value())); ui->channelsCount->setMaximum(qMin(16, 33-ui->channelsStart->value()));
} }
} }

View file

@ -18,7 +18,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing"> <property name="spacing">
<number>-1</number> <number>6</number>
</property> </property>
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
@ -39,10 +39,10 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="currentSection"> <property name="currentSection">
<enum>QDateTimeEdit::MinuteSection</enum> <enum>QDateTimeEdit::HourSection</enum>
</property> </property>
<property name="displayFormat"> <property name="displayFormat">
<string notr="true">mm:ss</string> <string notr="true">hh:mm:ss</string>
</property> </property>
</widget> </widget>
</item> </item>

View file

@ -62,18 +62,20 @@ QStringList getAvrdudeArgs(const QString &cmd, const QString &filename)
QStringList getDfuArgs(const QString & cmd, const QString & filename) QStringList getDfuArgs(const QString & cmd, const QString & filename)
{ {
QStringList arguments; QStringList args;
burnConfigDialog bcd; burnConfigDialog bcd;
QString memory = "0x08000000"; QString memory = "0x08000000";
if (cmd == "-U") { if (cmd == "-U") {
memory.append(QString(":%1").arg(MAX_FSIZE)); memory.append(QString(":%1").arg(MAX_FSIZE));
} }
arguments << bcd.getDFUArgs() << "--dfuse-address" << memory; // removed for Horus, is it really needed? << "-d" << "0483:df11"; args << bcd.getDFUArgs();
if (!filename.endsWith(".dfu")) {
args << "--dfuse-address" << memory;
}
args << "-d" << "0483:df11";
QString fullcmd = cmd + filename; QString fullcmd = cmd + filename;
args << "" << fullcmd;
arguments << "" << fullcmd; return args;
return arguments;
} }
QStringList getSambaArgs(const QString &tcl) QStringList getSambaArgs(const QString &tcl)
@ -191,7 +193,7 @@ void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress)
QStringList str; QStringList str;
if (bcd.getMCU() == "m2560") { if (bcd.getMCU() == "m2560") {
args << "-B8"; args << "-B8";
QString erStr = eepromProtect ? "hfuse:w:0x11:m" : "hfuse:w:0x19:m"; QString erStr = eepromProtect ? "hfuse:w:0x51:m" : "hfuse:w:0x59:m";
str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m"; str << "-U" << "lfuse:w:0xD7:m" << "-U" << erStr << "-U" << "efuse:w:0xFC:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing //use hfuse = 0x81 to prevent eeprom being erased with every flashing
} }
@ -220,7 +222,7 @@ void resetAvrdudeFuses(bool eepromProtect, ProgressWidget *progress)
lfuses = "lfuse:w:0x3F:m"; lfuses = "lfuse:w:0x3F:m";
} }
QString erStr = eepromProtect ? "hfuse:w:0x81:m" : "hfuse:w:0x89:m"; QString erStr = eepromProtect ? "hfuse:w:0xC1:m" : "hfuse:w:0xC9:m";
str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m"; str << "-U" << lfuses << "-U" << erStr << "-U" << "efuse:w:0xFF:m";
//use hfuse = 0x81 to prevent eeprom being erased with every flashing //use hfuse = 0x81 to prevent eeprom being erased with every flashing
} }

View file

@ -23,7 +23,7 @@
#ifdef INIT_IMPORT #ifdef INIT_IMPORT
#undef INIT_IMPORT #undef INIT_IMPORT
#ifdef FRSKY #ifdef FRSKY
frskyStreaming = 20; telemetryStreaming = 20;
#endif #endif
#endif #endif

View file

@ -85,6 +85,8 @@ SimulatorFactory *getSimulatorFactory(const QString &name)
if (pos <= 0) if (pos <= 0)
break; break;
simuName = simuName.mid(0, pos); simuName = simuName.mid(0, pos);
if (simuName.count('-') == 0)
break;
} }
return NULL; return NULL;
} }

View file

@ -13,29 +13,29 @@ cd build
SET COMMON_OPTIONS=-DCMAKE_PREFIX_PATH=C:\Qt\5.6\msvc2015 -DALLOW_NIGHTLY_BUILDS=YES -DVERSION_SUFFIX=%1 SET COMMON_OPTIONS=-DCMAKE_PREFIX_PATH=C:\Qt\5.6\msvc2015 -DALLOW_NIGHTLY_BUILDS=YES -DVERSION_SUFFIX=%1
cmake %COMMON_OPTIONS% -DPCB=9X %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=9X %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=GRUVIN9X %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=GRUVIN9X %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=MEGA2560 %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=MEGA2560 %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=SKY9X %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=SKY9X %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=9XRPRO %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=9XRPRO %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=TARANIS %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=TARANIS %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=TARANIS -DPCBREV=REVPLUS %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=TARANIS -DPCBREV=REVPLUS %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=TARANIS -DPCBREV=REV9E %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=TARANIS -DPCBREV=REV9E %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
cmake %COMMON_OPTIONS% -DPCB=HORUS %CODE_DIR% cmake %COMMON_OPTIONS% -DPCB=HORUS %CODE_DIR%
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\opentx-simulator.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" radio\src\targets\simu\libsimulator.vcxproj /t:Rebuild /p:Configuration=Release
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" companion\src\installer.vcxproj /t:Rebuild /p:Configuration=Release "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" companion\src\installer.vcxproj /t:Rebuild /p:Configuration=Release

View file

@ -9,10 +9,10 @@ option(CURVES "Curves" ON)
option(GVARS "Global variables") option(GVARS "Global variables")
option(GUI "GUI enabled" ON) option(GUI "GUI enabled" ON)
option(SPLASH "Splash enabled" ON) option(SPLASH "Splash enabled" ON)
option(PPM_UNIT "PPM display unit (US/PERCENT_PREC1/PERCENT_PREC0)" PERCENT_PREC0) set(PPM_UNIT "PERCENT_PREC1" CACHE STRING "PPM display unit (US/PERCENT_PREC1/PERCENT_PREC0)")
option(PPM_CENTER_ADJUSTABLE "PPM center adjustable" OFF) option(PPM_CENTER_ADJUSTABLE "PPM center adjustable" OFF)
option(PPM_LIMITS_SYMETRICAL "PPM limits symetrical" OFF) option(PPM_LIMITS_SYMETRICAL "PPM limits symetrical" OFF)
option(OVERRIDE_CHANNEL_FUNCTION "OverrideChannel function available" OFF) option(OVERRIDE_CHANNEL_FUNCTION "OverrideChannel function available" ON)
option(DANGEROUS_MODULE_FUNCTIONS "Dangerous module functions (RangeCheck / Bind / Module OFF, etc.) available" OFF) option(DANGEROUS_MODULE_FUNCTIONS "Dangerous module functions (RangeCheck / Bind / Module OFF, etc.) available" OFF)
option(FAI "Competition mode (no telemetry)" OFF) option(FAI "Competition mode (no telemetry)" OFF)
option(AUTOSOURCE "Automatic source detection in menus" ON) option(AUTOSOURCE "Automatic source detection in menus" ON)
@ -407,11 +407,22 @@ if(CPU_FAMILY STREQUAL STM32)
STM32_USB_Device_Library/Core/src/usbd_ioreq.c STM32_USB_Device_Library/Core/src/usbd_ioreq.c
STM32_USB_Device_Library/Core/src/usbd_req.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) set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
usb_bsp.c
usbd_desc.c
usbd_usr.cpp
)
if(USB STREQUAL SERIAL) if(USB STREQUAL SERIAL)
add_definitions(-DUSB_SERIAL) add_definitions(-DUSB_SERIAL)
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} usbd_cdc.cpp) set(FIRMWARE_TARGET_SRC
set(STM32USB_SRC ${STM32USB_SRC} STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c) ${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) elseif(USB STREQUAL MASSSTORAGE)
add_definitions(-DUSB_MASS_STORAGE) add_definitions(-DUSB_MASS_STORAGE)
set(STM32USB_SRC set(STM32USB_SRC
@ -421,13 +432,22 @@ if(CPU_FAMILY STREQUAL STM32)
STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
) )
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} usbd_storage_msd.cpp) set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
usbd_storage_msd.cpp
)
else() else()
add_definitions(-DUSB_JOYSTICK) add_definitions(-DUSB_JOYSTICK)
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} usbd_hid_joystick.c) set(FIRMWARE_TARGET_SRC
${FIRMWARE_TARGET_SRC}
usbd_hid_joystick.c
)
endif() endif()
if(GVARS) if(GVARS)
set(GUI_SRC ${GUI_SRC} menu_model_gvars.cpp) set(GUI_SRC
${GUI_SRC}
menu_model_gvars.cpp
)
endif() endif()
set(FIRMWARE_SRC set(FIRMWARE_SRC
${FIRMWARE_SRC} ${FIRMWARE_SRC}
@ -436,12 +456,22 @@ if(CPU_FAMILY STREQUAL STM32)
targets/taranis/configure_pins.cpp targets/taranis/configure_pins.cpp
) )
foreach(FILE ${STM32LIB_SRC}) foreach(FILE ${STM32LIB_SRC})
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${STM32LIB_DIR}/${FILE}) set(FIRMWARE_SRC
${FIRMWARE_SRC}
${STM32LIB_DIR}/${FILE}
)
endforeach() endforeach()
foreach(FILE ${STM32USB_SRC}) foreach(FILE ${STM32USB_SRC})
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${STM32USB_DIR}/${FILE}) set(FIRMWARE_SRC
${FIRMWARE_SRC}
${STM32USB_DIR}/${FILE}
)
endforeach() endforeach()
set(SRC ${SRC} sbus.cpp) set(SRC
${SRC}
sbus.cpp
telemetry/crossfire.cpp
)
endif() endif()
if(ARCH STREQUAL ARM) if(ARCH STREQUAL ARM)
@ -512,6 +542,8 @@ if(ARCH STREQUAL ARM)
tasks_arm.cpp tasks_arm.cpp
audio_arm.cpp audio_arm.cpp
telemetry/telemetry.cpp telemetry/telemetry.cpp
telemetry/telemetry_holders.cpp
telemetry/telemetry_sensors.cpp
telemetry/frsky.cpp telemetry/frsky.cpp
telemetry/frsky_d_arm.cpp telemetry/frsky_d_arm.cpp
telemetry/frsky_sport.cpp telemetry/frsky_sport.cpp
@ -561,6 +593,7 @@ else()
option(BOLD "Bold font" ON) option(BOLD "Bold font" ON)
option(BATTGRAPH "Battery graph" OFF) option(BATTGRAPH "Battery graph" OFF)
option(HAPTIC "Haptic support" OFF) option(HAPTIC "Haptic support" OFF)
set(TTS "EN" CACHE STRING "TTS language")
set(LCD "DEFAULT" CACHE STRING "LCD type (DEFAULT/ST7565P/ST7565R/ERC12864FSF/ST7920)") set(LCD "DEFAULT" CACHE STRING "LCD type (DEFAULT/ST7565P/ST7565R/ERC12864FSF/ST7920)")
set(LUA NO) set(LUA NO)
set(PULSES_SRC pulses_avr.cpp) set(PULSES_SRC pulses_avr.cpp)
@ -584,6 +617,13 @@ else()
if(VOICE) if(VOICE)
add_definitions(-DVOICE) add_definitions(-DVOICE)
set(TARGET_SRC ${TARGET_SRC} voice.cpp) set(TARGET_SRC ${TARGET_SRC} voice.cpp)
foreach(LANGUAGE ${TTS_LANGUAGES})
string(TOUPPER ${LANGUAGE} LANGUAGE_CAPITALIZED)
if(TTS STREQUAL ${LANGUAGE_CAPITALIZED})
add_definitions(-DTTS_${LANGUAGE_CAPITALIZED})
set(SRC ${SRC} translations/tts_${LANGUAGE}.cpp)
endif()
endforeach()
endif() endif()
if(GRAPHICS) if(GRAPHICS)
add_definitions(-DGRAPHICS) add_definitions(-DGRAPHICS)
@ -629,7 +669,7 @@ else()
option(GPS "GPS support" ON) option(GPS "GPS support" ON)
option(VARIO "Vario support" ON) option(VARIO "Vario support" ON)
add_definitions(-DFRSKY) add_definitions(-DFRSKY)
set(SRC ${SRC} telemetry/frsky.cpp telemetry/frsky_d.cpp) set(SRC ${SRC} telemetry/telemetry.cpp telemetry/telemetry_holders.cpp telemetry/frsky.cpp telemetry/frsky_d.cpp)
set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/common_avr/telemetry_driver.cpp) set(FIRMWARE_SRC ${FIRMWARE_SRC} targets/common_avr/telemetry_driver.cpp)
set(GUI_SRC ${GUI_SRC} view_telemetry.cpp) set(GUI_SRC ${GUI_SRC} view_telemetry.cpp)
if(FRSKY_HUB) if(FRSKY_HUB)

File diff suppressed because it is too large Load diff

View file

@ -319,7 +319,7 @@ void getLogicalSwitchAudioFile(char * filename, int index, unsigned int event)
{ {
char * str = getModelAudioPath(filename); char * str = getModelAudioPath(filename);
#if defined(PCBTARANIS) #if defined(PCBTARANIS) || defined(PCBHORUS)
*str++ = 'L'; *str++ = 'L';
if (index >= 9) { if (index >= 9) {
div_t qr = div(index+1, 10); div_t qr = div(index+1, 10);

View file

@ -1,10 +1,11 @@
add_truetype_font_target(horus tinsize "DejaVu Sans" 9 False) add_truetype_font_target(horus tinsize "DejaVu Sans" 9 False)
add_truetype_font_target(horus smlsize "DejaVu Sans" 13 False) add_truetype_font_target(horus smlsize "DejaVu Sans" 13 False)
add_truetype_font_target(horus stdsize "DejaVu Sans" 16 False) add_truetype_font_target(horus stdsize "DejaVu Sans" 16 False)
add_truetype_font_target(horus stdsizebold "DejaVu Sans" 16 True)
add_truetype_font_target(horus midsize "DejaVu Sans" 24 False) add_truetype_font_target(horus midsize "DejaVu Sans" 24 False)
add_truetype_font_target(horus dblsize "DejaVu Sans" 32 True) add_truetype_font_target(horus dblsize "DejaVu Sans" 32 True)
add_truetype_font_target(horus xxlsize "DejaVu Sans" 48 False) add_truetype_font_target(horus xxlsize "DejaVu Sans" 48 False)
add_custom_target(ttf_horus_fonts DEPENDS ttf_horus_tinsize ttf_horus_smlsize ttf_horus_stdsize ttf_horus_midsize ttf_horus_dblsize ttf_horus_xxlsize) add_custom_target(ttf_horus_fonts DEPENDS ${ttf_horus_fonts_targets})
add_bitmaps_target(horus_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/horus/bmp_*.png" 480 5/6/5) add_bitmaps_target(horus_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/horus/bmp_*.png" 480 5/6/5)
add_bitmaps_target(horus_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/horus/calibration/bmp_*.png" 480 5/6/5) add_bitmaps_target(horus_calibration_bitmaps "${RADIO_SRC_DIRECTORY}/bitmaps/horus/calibration/bmp_*.png" 480 5/6/5)
@ -16,4 +17,5 @@ add_bitmaps_target(horus_slider_masks "${RADIO_SRC_DIRECTORY}/bitmaps/horus/slid
add_bitmaps_target(horus_layouts_masks "${RADIO_SRC_DIRECTORY}/gui/horus/layouts/*.png" 480 8bits) add_bitmaps_target(horus_layouts_masks "${RADIO_SRC_DIRECTORY}/gui/horus/layouts/*.png" 480 8bits)
add_bitmaps_target(horus_themes_bitmaps "${RADIO_SRC_DIRECTORY}/gui/horus/themes/*.png" 480 5/6/5) add_bitmaps_target(horus_themes_bitmaps "${RADIO_SRC_DIRECTORY}/gui/horus/themes/*.png" 480 5/6/5)
add_bitmaps_target(horus_fonts ${RADIO_SRC_DIRECTORY}/fonts/horus/*.png 480 8bits) add_bitmaps_target(horus_fonts ${RADIO_SRC_DIRECTORY}/fonts/horus/*.png 480 8bits)
add_dependencies(horus_bitmaps horus_calibration_bitmaps horus_alpha_bitmaps horus_alpha_calibration_bitmaps horus_masks horus_slider_masks horus_themes_bitmaps horus_layouts_masks horus_fonts) add_bitmaps_target(horus_volume_masks ${RADIO_SRC_DIRECTORY}/bitmaps/horus/volume/*.png 480 8bits)
add_dependencies(horus_bitmaps horus_calibration_bitmaps horus_button_bitmaps horus_alpha_bitmaps horus_alpha_calibration_bitmaps horus_masks horus_slider_masks horus_layouts_masks horus_themes_bitmaps horus_fonts horus_volume_masks)

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

View file

@ -20,7 +20,7 @@
#include <inttypes.h> #include <inttypes.h>
/* CRC16 implementation according to CCITT standards */ // CRC16 implementation according to CCITT standards
static const unsigned short crc16tab[256] = { static const unsigned short crc16tab[256] = {
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7, 0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef, 0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,
@ -56,11 +56,56 @@ static const unsigned short crc16tab[256]= {
0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0 0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0
}; };
uint16_t crc16(uint8_t * buf, uint32_t len) uint16_t crc16(const uint8_t * buf, uint32_t len)
{ {
uint16_t crc = 0; uint16_t crc = 0;
for (uint32_t counter=0; counter<len; counter++) { for (uint32_t i=0; i<len; i++) {
crc = (crc<<8) ^ crc16tab[((crc>>8) ^ *buf++) & 0x00FF]; crc = (crc<<8) ^ crc16tab[((crc>>8) ^ *buf++) & 0x00FF];
} }
return crc; return crc;
} }
// CRC8 implementation with polynom = x^8+x^7+x^6+x^4+x^2+1 (0xD5)
unsigned char crc8tab[256] = {
0x00, 0xD5, 0x7F, 0xAA, 0xFE, 0x2B, 0x81, 0x54,
0x29, 0xFC, 0x56, 0x83, 0xD7, 0x02, 0xA8, 0x7D,
0x52, 0x87, 0x2D, 0xF8, 0xAC, 0x79, 0xD3, 0x06,
0x7B, 0xAE, 0x04, 0xD1, 0x85, 0x50, 0xFA, 0x2F,
0xA4, 0x71, 0xDB, 0x0E, 0x5A, 0x8F, 0x25, 0xF0,
0x8D, 0x58, 0xF2, 0x27, 0x73, 0xA6, 0x0C, 0xD9,
0xF6, 0x23, 0x89, 0x5C, 0x08, 0xDD, 0x77, 0xA2,
0xDF, 0x0A, 0xA0, 0x75, 0x21, 0xF4, 0x5E, 0x8B,
0x9D, 0x48, 0xE2, 0x37, 0x63, 0xB6, 0x1C, 0xC9,
0xB4, 0x61, 0xCB, 0x1E, 0x4A, 0x9F, 0x35, 0xE0,
0xCF, 0x1A, 0xB0, 0x65, 0x31, 0xE4, 0x4E, 0x9B,
0xE6, 0x33, 0x99, 0x4C, 0x18, 0xCD, 0x67, 0xB2,
0x39, 0xEC, 0x46, 0x93, 0xC7, 0x12, 0xB8, 0x6D,
0x10, 0xC5, 0x6F, 0xBA, 0xEE, 0x3B, 0x91, 0x44,
0x6B, 0xBE, 0x14, 0xC1, 0x95, 0x40, 0xEA, 0x3F,
0x42, 0x97, 0x3D, 0xE8, 0xBC, 0x69, 0xC3, 0x16,
0xEF, 0x3A, 0x90, 0x45, 0x11, 0xC4, 0x6E, 0xBB,
0xC6, 0x13, 0xB9, 0x6C, 0x38, 0xED, 0x47, 0x92,
0xBD, 0x68, 0xC2, 0x17, 0x43, 0x96, 0x3C, 0xE9,
0x94, 0x41, 0xEB, 0x3E, 0x6A, 0xBF, 0x15, 0xC0,
0x4B, 0x9E, 0x34, 0xE1, 0xB5, 0x60, 0xCA, 0x1F,
0x62, 0xB7, 0x1D, 0xC8, 0x9C, 0x49, 0xE3, 0x36,
0x19, 0xCC, 0x66, 0xB3, 0xE7, 0x32, 0x98, 0x4D,
0x30, 0xE5, 0x4F, 0x9A, 0xCE, 0x1B, 0xB1, 0x64,
0x72, 0xA7, 0x0D, 0xD8, 0x8C, 0x59, 0xF3, 0x26,
0x5B, 0x8E, 0x24, 0xF1, 0xA5, 0x70, 0xDA, 0x0F,
0x20, 0xF5, 0x5F, 0x8A, 0xDE, 0x0B, 0xA1, 0x74,
0x09, 0xDC, 0x76, 0xA3, 0xF7, 0x22, 0x88, 0x5D,
0xD6, 0x03, 0xA9, 0x7C, 0x28, 0xFD, 0x57, 0x82,
0xFF, 0x2A, 0x80, 0x55, 0x01, 0xD4, 0x7E, 0xAB,
0x84, 0x51, 0xFB, 0x2E, 0x7A, 0xAF, 0x05, 0xD0,
0xAD, 0x78, 0xD2, 0x07, 0x53, 0x86, 0x2C, 0xF9
};
uint8_t crc8(const uint8_t * ptr, uint32_t len)
{
uint8_t crc = 0;
for (uint32_t i=0; i<len; i++) {
crc = crc8tab[crc ^ *ptr++];
}
return crc;
}

View file

@ -158,7 +158,7 @@ enum CurveType {
#define LEN_CHANNEL_NAME 6 #define LEN_CHANNEL_NAME 6
#define LEN_INPUT_NAME 4 #define LEN_INPUT_NAME 4
#define LEN_CURVE_NAME 3 #define LEN_CURVE_NAME 3
#define LEN_CFN_NAME 10 #define LEN_CFN_NAME 6
#define MAX_CURVES 32 #define MAX_CURVES 32
#define NUM_POINTS 512 #define NUM_POINTS 512
#elif defined(PCBFLAMENCO) #elif defined(PCBFLAMENCO)
@ -346,6 +346,7 @@ enum TelemetryUnit {
UNIT_PERCENT, UNIT_PERCENT,
UNIT_MAH, UNIT_MAH,
UNIT_WATTS, UNIT_WATTS,
UNIT_MILLIWATTS,
UNIT_DB, UNIT_DB,
UNIT_RPMS, UNIT_RPMS,
UNIT_G, UNIT_G,
@ -473,7 +474,7 @@ enum TelemetryUnit {
UNIT_SECONDS, UNIT_SECONDS,
UNIT_RPMS, UNIT_RPMS,
UNIT_G, UNIT_G,
UNIT_HDG, UNIT_HDG
}; };
#endif #endif

View file

@ -622,9 +622,7 @@ PACK(struct MavlinkTelemetryData {
*/ */
#if defined(CPUARM) #if defined(CPUARM)
// TODO struct as others PACK(struct TelemetrySensor {
PACK(class TelemetrySensor {
public:
union { union {
uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type. uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type.
uint16_t persistentValue; uint16_t persistentValue;

View file

@ -24,7 +24,7 @@
#if defined(COLORLCD) #if defined(COLORLCD)
extern const uint16_t * const fontspecsTable[16]; extern const uint16_t * const fontspecsTable[16];
extern const pm_uchar * const fontsTable[16]; extern const uint8_t * const fontsTable[16];
#else #else

View file

@ -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, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171 } 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, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171, 2171

View file

@ -1 +1 @@
{ 0,4,10,20,41,56,80,100,106,115,125,140,159,167,177,184,196,212,227,242,258,274,290,306,322,338,354,361,369,388,407,426,440,451,471,487,505,524,539,553,572,589,595,605,623,638,658,675,695,710,730,747,763,782,799,819,845,864,883,901,910,922,931,950,967,976,991,1006,1020,1036,1052,1064,1080,1095,1101,1110,1125,1131,1154,1169,1185,1200,1216,1227,1241,1253,1268,1285,1306,1323,1340,1354,1373,1376,1395,1416,1437,1452,1467,1484,1501,1518,1535,1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557 } 0,4,10,20,41,56,80,100,106,115,125,140,159,167,177,184,196,212,227,242,258,274,290,306,322,338,354,361,369,388,407,426,440,451,471,487,505,524,539,553,572,589,595,605,623,638,658,675,695,710,730,747,763,782,799,819,845,864,883,901,910,922,931,950,967,976,991,1006,1020,1036,1052,1064,1080,1095,1101,1110,1125,1131,1154,1169,1185,1200,1216,1227,1241,1253,1268,1285,1306,1323,1340,1354,1373,1376,1395,1416,1437,1452,1467,1484,1501,1518,1535,1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557

View file

@ -1 +1 @@
{ 0,4,8,13,23,31,44,55,58,63,67,75,85,88,94,97,103,112,120,128,137,146,154,163,171,180,189,192,195,205,215,225,232,238,248,256,266,276,284,291,301,310,313,318,327,335,345,354,365,373,384,393,402,412,421,431,445,455,465,475,479,485,489,499,508,513,521,529,537,546,555,561,570,578,581,586,594,597,609,617,626,634,643,649,657,663,671,680,692,701,710,718,728,729,739,751,763,771,779,789,799,809,819,830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830 } 0,4,8,13,23,31,44,55,58,63,67,75,85,88,94,97,103,112,120,128,137,146,154,163,171,180,189,192,195,205,215,225,232,238,248,256,266,276,284,291,301,310,313,318,327,335,345,354,365,373,384,393,402,412,421,431,445,455,465,475,479,485,489,499,508,513,521,529,537,546,555,561,570,578,581,586,594,597,609,617,626,634,643,649,657,663,671,680,692,701,710,718,728,729,739,751,763,771,779,789,799,809,819,830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830, 830

View file

@ -1 +1 @@
{ 0,4,7,13,26,35,51,63,66,71,76,85,97,101,107,111,118,128,137,146,155,166,175,185,194,204,214,218,222,234,246,258,266,273,285,295,307,319,329,338,351,362,366,372,383,392,405,416,429,439,452,463,473,485,496,508,525,537,549,561,566,573,578,590,601,607,617,627,636,646,656,663,673,682,685,690,700,703,718,727,737,747,757,764,773,780,789,799,813,823,833,842,854,855,867,881,895,904,913,924,935,946,957,971, 986, 1001, 1016, 1031, 1046, 1061, 1076, 1091, 1106, 1121, 1136, 1151, 1166 } 0,4,7,13,26,35,51,63,66,71,76,85,97,101,107,111,118,128,137,146,155,166,175,185,194,204,214,218,222,234,246,258,266,273,285,295,307,319,329,338,351,362,366,372,383,392,405,416,429,439,452,463,473,485,496,508,525,537,549,561,566,573,578,590,601,607,617,627,636,646,656,663,673,682,685,690,700,703,718,727,737,747,757,764,773,780,789,799,813,823,833,842,854,855,867,881,895,904,913,924,935,946,957,971, 986, 1001, 1016, 1031, 1046, 1061, 1076, 1091, 1106, 1121, 1136, 1151, 1166

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -0,0 +1 @@
0,4,9,16,29,40,57,72,76,83,89,99,111,117,124,129,136,148,159,169,179,191,202,213,223,235,247,252,257,269,281,293,302,309,323,335,347,360,370,380,393,405,410,417,430,440,455,467,481,493,507,519,530,542,554,568,587,601,615,627,634,641,647,659,668,675,686,697,707,719,731,740,752,763,768,775,786,791,807,818,830,841,853,861,871,880,891,903,919,931,943,953,965,966,978,992,1006,1015,1024,1035,1046,1057,1068,1082, 1097, 1112, 1127, 1142, 1157, 1172, 1187, 1202, 1217, 1232, 1247, 1262, 1277

View file

@ -1 +1 @@
{ 0,4,7,12,20,26,36,44,47,51,55,61,69,72,76,79,84,91,97,103,109,116,122,129,135,142,149,151,154,162,170,178,184,189,197,204,211,219,226,232,240,247,250,254,262,268,276,283,291,298,306,313,320,328,335,343,353,360,368,375,379,384,388,396,403,407,413,420,426,432,439,444,450,456,459,463,470,473,482,488,495,502,508,513,519,524,530,537,545,552,559,565,573,574,582,591,600,606,612,619,626,633,640,648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648 } 0,4,7,12,20,26,36,44,47,51,55,61,69,72,76,79,84,91,97,103,109,116,122,129,135,142,149,151,154,162,170,178,184,189,197,204,211,219,226,232,240,247,250,254,262,268,276,283,291,298,306,313,320,328,335,343,353,360,368,375,379,384,388,396,403,407,413,420,426,432,439,444,450,456,459,463,470,473,482,488,495,502,508,513,519,524,530,537,545,552,559,565,573,574,582,591,600,606,612,619,626,633,640,648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648

View file

@ -1 +1 @@
{ 0,4,12,29,66,93,137,173,181,195,210,235,269,280,296,305,325,353,378,404,431,460,487,515,542,570,598,607,618,652,686,720,743,762,798,827,859,893,920,944,979,1010,1019,1035,1067,1093,1129,1160,1197,1224,1261,1292,1320,1354,1384,1420,1468,1502,1536,1568,1582,1602,1616,1650,1679,1695,1722,1749,1774,1802,1830,1850,1878,1904,1912,1925,1952,1960,2002,2028,2056,2083,2111,2130,2154,2174,2200,2229,2268,2297,2326,2351,2385,2388,2422,2461,2500,2525,2550,2581,2612,2643,2674,2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714 } 0,4,12,29,66,93,137,173,181,195,210,235,269,280,296,305,325,353,378,404,431,460,487,515,542,570,598,607,618,652,686,720,743,762,798,827,859,893,920,944,979,1010,1019,1035,1067,1093,1129,1160,1197,1224,1261,1292,1320,1354,1384,1420,1468,1502,1536,1568,1582,1602,1616,1650,1679,1695,1722,1749,1774,1802,1830,1850,1878,1904,1912,1925,1952,1960,2002,2028,2056,2083,2111,2130,2154,2174,2200,2229,2268,2297,2326,2351,2385,2388,2422,2461,2500,2525,2550,2581,2612,2643,2674,2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714, 2714

View file

@ -609,7 +609,7 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
#if defined(CPUARM) #if defined(CPUARM)
char separator = ':'; char separator = ':';
if (tme >= 3600 && (~att & DBLSIZE)) { if (tme >= 3600) {
qr = div(qr.quot, 60); qr = div(qr.quot, 60);
separator = CHR_HOUR; separator = CHR_HOUR;
} }
@ -617,6 +617,10 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
#define separator ':' #define separator ':'
#endif #endif
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2); lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
#if defined(CPUARM)
if (separator == CHR_HOUR)
att &= ~DBLSIZE;
#endif
#if defined(CPUARM) && defined(RTCLOCK) #if defined(CPUARM) && defined(RTCLOCK)
if (att&TIMEBLINK) if (att&TIMEBLINK)
lcdDrawChar(lcdLastPos, y, separator, BLINK); lcdDrawChar(lcdLastPos, y, separator, BLINK);

View file

@ -196,7 +196,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
#endif #endif
#if defined(CPUARM) #if defined(CPUARM)
else if (func == FUNC_SET_TIMER) { else if (func == FUNC_SET_TIMER) {
val_max = 59*60+59; val_max = 539*60+59;
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr); putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr);
} }
#endif #endif

View file

@ -18,7 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "../../opentx.h" #include "opentx.h"
#if defined(CPUARM) #if defined(CPUARM)
uint8_t g_moduleIdx; uint8_t g_moduleIdx;
@ -205,13 +205,14 @@ void menuModelSetup(uint8_t event)
break; break;
} }
case 1: case 1:
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59); CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 539); // 8:59
timer->start = qr.rem + qr.quot*60; timer->start = qr.rem + qr.quot*60;
break; break;
case 2: case 2:
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2; qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
timer->start -= qr.rem ; timer->start -= qr.rem ;
if ((int16_t)timer->start < 0) timer->start=0; if ((int16_t)timer->start < 0) timer->start=0;
if ((int16_t)timer->start > 5999) timer->start=32399; // 8:59:59
break; break;
} }
} }
@ -284,7 +285,10 @@ void menuModelSetup(uint8_t event)
break; break;
case 2: case 2:
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2; qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
if (timer->start >= qr.rem) {
timer->start -= qr.rem ; timer->start -= qr.rem ;
}
if ((int32_t)timer->start > 3599) timer->start=3599; // 59:59
break; break;
} }
} }

View file

@ -609,7 +609,7 @@ void menuModelTelemetry(uint8_t event)
case ITEM_TELEMETRY_A2_LABEL: case ITEM_TELEMETRY_A2_LABEL:
lcd_putsLeft(y, STR_ACHANNEL); lcd_putsLeft(y, STR_ACHANNEL);
lcdDrawNumber(2*FW, y, ch+1, 0); lcdDrawNumber(2*FW, y, ch+1, 0);
putsTelemetryChannelValue(TELEM_COL2+6*FW, y, dest, frskyData.analog[ch].value, LEFT); putsTelemetryChannelValue(TELEM_COL2+6*FW, y, dest, telemetryData.analog[ch].value, LEFT);
break; break;
case ITEM_TELEMETRY_A1_RANGE: case ITEM_TELEMETRY_A1_RANGE:
@ -739,7 +739,7 @@ void menuModelTelemetry(uint8_t event)
case ITEM_TELEMETRY_FAS_OFFSET: case ITEM_TELEMETRY_FAS_OFFSET:
lcd_putsLeft(y, STR_FAS_OFFSET); lcd_putsLeft(y, STR_FAS_OFFSET);
lcdDrawNumber(TELEM_COL2, y, g_model.frsky.fasOffset, attr|LEFT|PREC1); lcdDrawNumber(TELEM_COL2, y, g_model.frsky.fasOffset, attr|LEFT|PREC1);
lcdDrawNumber(TELEM_COL2+6*FW, y, frskyData.hub.current, LEFT|PREC1); lcdDrawNumber(TELEM_COL2+6*FW, y, telemetryData.hub.current, LEFT|PREC1);
lcdDrawChar(TELEM_COL2+8*FW, y, 'A'); lcdDrawChar(TELEM_COL2+8*FW, y, 'A');
if (attr) g_model.frsky.fasOffset = checkIncDec(event, g_model.frsky.fasOffset, -120, 120, EE_MODEL); if (attr) g_model.frsky.fasOffset = checkIncDec(event, g_model.frsky.fasOffset, -120, 120, EE_MODEL);
break; break;

View file

@ -38,7 +38,7 @@ void displayRssiLine()
lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator lcdDrawSolidHorizontalLine(0, 55, 128, 0); // separator
uint8_t rssi; uint8_t rssi;
#if !defined(CPUARM) #if !defined(CPUARM)
rssi = min((uint8_t)99, frskyData.rssi[1].value); rssi = min((uint8_t)99, telemetryData.rssi[1].value);
lcd_putsLeft(STATUS_BAR_Y, STR_TX); lcdDrawNumber(4*FW+1, STATUS_BAR_Y, rssi, LEADING0, 2); lcd_putsLeft(STATUS_BAR_Y, STR_TX); lcdDrawNumber(4*FW+1, STATUS_BAR_Y, rssi, LEADING0, 2);
lcdDrawRect(BAR_LEFT+1, 57, 38, 7); lcdDrawRect(BAR_LEFT+1, 57, 38, 7);
lcdDrawFilledRect(BAR_LEFT+1, 58, 4*rssi/11, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID); lcdDrawFilledRect(BAR_LEFT+1, 58, 4*rssi/11, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID);
@ -59,17 +59,17 @@ void displayRssiLine()
void displayGpsTime() void displayGpsTime()
{ {
uint8_t att = (TELEMETRY_STREAMING() ? LEFT|LEADING0 : LEFT|LEADING0|BLINK); uint8_t att = (TELEMETRY_STREAMING() ? LEFT|LEADING0 : LEFT|LEADING0|BLINK);
lcdDrawNumber(CENTER_OFS+6*FW+7, STATUS_BAR_Y, frskyData.hub.hour, att, 2); lcdDrawNumber(CENTER_OFS+6*FW+7, STATUS_BAR_Y, telemetryData.hub.hour, att, 2);
lcdDrawChar(CENTER_OFS+8*FW+4, STATUS_BAR_Y, ':', att); lcdDrawChar(CENTER_OFS+8*FW+4, STATUS_BAR_Y, ':', att);
lcdDrawNumber(CENTER_OFS+9*FW+2, STATUS_BAR_Y, frskyData.hub.min, att, 2); lcdDrawNumber(CENTER_OFS+9*FW+2, STATUS_BAR_Y, telemetryData.hub.min, att, 2);
lcdDrawChar(CENTER_OFS+11*FW-1, STATUS_BAR_Y, ':', att); lcdDrawChar(CENTER_OFS+11*FW-1, STATUS_BAR_Y, ':', att);
lcdDrawNumber(CENTER_OFS+12*FW-3, STATUS_BAR_Y, frskyData.hub.sec, att, 2); lcdDrawNumber(CENTER_OFS+12*FW-3, STATUS_BAR_Y, telemetryData.hub.sec, att, 2);
lcdInvertLastLine(); lcdInvertLastLine();
} }
void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap) void displayGpsCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
{ {
if (frskyData.hub.gpsFix >= 0) { if (telemetryData.hub.gpsFix >= 0) {
if (!direction) direction = '-'; if (!direction) direction = '-';
lcdDrawNumber(TELEM_2ND_COLUMN, y, bp / 100, LEFT); // ddd before '.' lcdDrawNumber(TELEM_2ND_COLUMN, y, bp / 100, LEFT); // ddd before '.'
lcdDrawChar(lcdLastPos, y, '@'); lcdDrawChar(lcdLastPos, y, '@');
@ -107,9 +107,9 @@ void displayVoltageScreenLine(uint8_t y, uint8_t index)
{ {
drawStringWithIndex(0, y, STR_A, index+1, 0); drawStringWithIndex(0, y, STR_A, index+1, 0);
if (TELEMETRY_STREAMING()) { if (TELEMETRY_STREAMING()) {
putsTelemetryChannelValue(3*FW+6*FW+4, y-FH, index+TELEM_A1-1, frskyData.analog[index].value, DBLSIZE); putsTelemetryChannelValue(3*FW+6*FW+4, y-FH, index+TELEM_A1-1, telemetryData.analog[index].value, DBLSIZE);
lcdDrawChar(12*FW-1, y-FH, '<'); putsTelemetryChannelValue(17*FW, y-FH, index+TELEM_A1-1, frskyData.analog[index].min, NO_UNIT); lcdDrawChar(12*FW-1, y-FH, '<'); putsTelemetryChannelValue(17*FW, y-FH, index+TELEM_A1-1, telemetryData.analog[index].min, NO_UNIT);
lcdDrawChar(12*FW, y, '>'); putsTelemetryChannelValue(17*FW, y, index+TELEM_A1-1, frskyData.analog[index].max, NO_UNIT); lcdDrawChar(12*FW, y, '>'); putsTelemetryChannelValue(17*FW, y, index+TELEM_A1-1, telemetryData.analog[index].max, NO_UNIT);
} }
} }
#endif #endif
@ -142,10 +142,10 @@ void displayVoltagesScreen()
break; break;
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
case FRSKY_VOLTS_SOURCE_FAS: case FRSKY_VOLTS_SOURCE_FAS:
putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_VFAS-1, frskyData.hub.vfas, DBLSIZE); putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_VFAS-1, telemetryData.hub.vfas, DBLSIZE);
break; break;
case FRSKY_VOLTS_SOURCE_CELLS: case FRSKY_VOLTS_SOURCE_CELLS:
putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_CELLS_SUM-1, frskyData.hub.cellsSum, DBLSIZE); putsTelemetryChannelValue(3*FW+6*FW+4, FH, TELEM_CELLS_SUM-1, telemetryData.hub.cellsSum, DBLSIZE);
break; break;
#endif #endif
} }
@ -159,13 +159,13 @@ void displayVoltagesScreen()
break; break;
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
case FRSKY_CURRENT_SOURCE_FAS: case FRSKY_CURRENT_SOURCE_FAS:
putsTelemetryChannelValue(3*FW+6*FW+4, 3*FH, TELEM_CURRENT-1, frskyData.hub.current, DBLSIZE); putsTelemetryChannelValue(3*FW+6*FW+4, 3*FH, TELEM_CURRENT-1, telemetryData.hub.current, DBLSIZE);
break; break;
#endif #endif
} }
putsTelemetryChannelValue(4, 5*FH, TELEM_POWER-1, frskyData.hub.power, LEFT|DBLSIZE); putsTelemetryChannelValue(4, 5*FH, TELEM_POWER-1, telemetryData.hub.power, LEFT|DBLSIZE);
putsTelemetryChannelValue(3*FW+4+4*FW+6*FW+FW, 5*FH, TELEM_CONSUMPTION-1, frskyData.hub.currentConsumption, DBLSIZE); putsTelemetryChannelValue(3*FW+4+4*FW+6*FW+FW, 5*FH, TELEM_CONSUMPTION-1, telemetryData.hub.currentConsumption, DBLSIZE);
} }
else { else {
displayVoltageScreenLine(analog > 0 ? 5*FH : 4*FH, analog ? 2-analog : 0); displayVoltageScreenLine(analog > 0 ? 5*FH : 4*FH, analog ? 2-analog : 0);
@ -174,11 +174,11 @@ void displayVoltagesScreen()
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
// Cells voltage // Cells voltage
if (frskyData.hub.cellsCount > 0) { if (telemetryData.hub.cellsCount > 0) {
uint8_t y = 1*FH; uint8_t y = 1*FH;
for (uint8_t k=0; k<frskyData.hub.cellsCount && k<6; k++) { for (uint8_t k=0; k<telemetryData.hub.cellsCount && k<6; k++) {
#if defined(GAUGES) #if defined(GAUGES)
uint8_t attr = (barsThresholds[THLD_CELL] && frskyData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2; uint8_t attr = (barsThresholds[THLD_CELL] && telemetryData.hub.cellVolts[k] < barsThresholds[THLD_CELL]) ? BLINK|PREC2 : PREC2;
#else #else
uint8_t attr = PREC2; uint8_t attr = PREC2;
#endif #endif
@ -198,20 +198,20 @@ void displayAfterFlightScreen()
if (IS_GPS_AVAILABLE()) { if (IS_GPS_AVAILABLE()) {
// Latitude // Latitude
lcd_putsLeft(line, STR_LATITUDE); lcd_putsLeft(line, STR_LATITUDE);
displayGpsCoord(line, frskyData.hub.gpsLatitudeNS, frskyData.hub.gpsLatitude_bp, frskyData.hub.gpsLatitude_ap); displayGpsCoord(line, telemetryData.hub.gpsLatitudeNS, telemetryData.hub.gpsLatitude_bp, telemetryData.hub.gpsLatitude_ap);
// Longitude // Longitude
line+=1*FH+1; line+=1*FH+1;
lcd_putsLeft(line, STR_LONGITUDE); lcd_putsLeft(line, STR_LONGITUDE);
displayGpsCoord(line, frskyData.hub.gpsLongitudeEW, frskyData.hub.gpsLongitude_bp, frskyData.hub.gpsLongitude_ap); displayGpsCoord(line, telemetryData.hub.gpsLongitudeEW, telemetryData.hub.gpsLongitude_bp, telemetryData.hub.gpsLongitude_ap);
displayGpsTime(); displayGpsTime();
line+=1*FH+1; line+=1*FH+1;
} }
// Rssi // Rssi
lcd_putsLeft(line, STR_MINRSSI); lcd_putsLeft(line, STR_MINRSSI);
lcdDrawText(TELEM_2ND_COLUMN, line, STR_TX); lcdDrawText(TELEM_2ND_COLUMN, line, STR_TX);
lcdDrawNumber(TELEM_2ND_COLUMN+3*FW, line, frskyData.rssi[1].min, LEFT|LEADING0, 2); lcdDrawNumber(TELEM_2ND_COLUMN+3*FW, line, telemetryData.rssi[1].min, LEFT|LEADING0, 2);
lcdDrawText(TELEM_2ND_COLUMN+6*FW, line, STR_RX); lcdDrawText(TELEM_2ND_COLUMN+6*FW, line, STR_RX);
lcdDrawNumber(TELEM_2ND_COLUMN+9*FW, line, frskyData.rssi[0].min, LEFT|LEADING0, 2); lcdDrawNumber(TELEM_2ND_COLUMN+9*FW, line, telemetryData.rssi[0].min, LEFT|LEADING0, 2);
} }
#endif #endif
@ -372,9 +372,9 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
if (field == TELEM_ACC) { if (field == TELEM_ACC) {
lcd_putsLeft(STATUS_BAR_Y, STR_ACCEL); lcd_putsLeft(STATUS_BAR_Y, STR_ACCEL);
lcdDrawNumber(4*FW, STATUS_BAR_Y, frskyData.hub.accelX, LEFT|PREC2); lcdDrawNumber(4*FW, STATUS_BAR_Y, telemetryData.hub.accelX, LEFT|PREC2);
lcdDrawNumber(10*FW, STATUS_BAR_Y, frskyData.hub.accelY, LEFT|PREC2); lcdDrawNumber(10*FW, STATUS_BAR_Y, telemetryData.hub.accelY, LEFT|PREC2);
lcdDrawNumber(16*FW, STATUS_BAR_Y, frskyData.hub.accelZ, LEFT|PREC2); lcdDrawNumber(16*FW, STATUS_BAR_Y, telemetryData.hub.accelZ, LEFT|PREC2);
break; break;
} }
#endif #endif

View file

@ -457,11 +457,21 @@ bool isSourceAvailableInResetSpecialFunction(int index)
bool isModuleAvailable(int module) bool isModuleAvailable(int module)
{ {
#if defined(CROSSFIRE)
if (module == MODULE_TYPE_CROSSFIRE && g_model.moduleData[INTERNAL_MODULE].rfProtocol != RF_PROTO_OFF) {
return false;
}
#endif
return true; return true;
} }
bool isRfProtocolAvailable(int protocol) bool isRfProtocolAvailable(int protocol)
{ {
#if defined(CROSSFIRE)
if (protocol != RF_PROTO_OFF && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_CROSSFIRE) {
return false;
}
#endif
#if defined(MODULE_D16_EU_ONLY_SUPPORT) #if defined(MODULE_D16_EU_ONLY_SUPPORT)
if (protocol == RF_PROTO_D8) { if (protocol == RF_PROTO_D8) {
return false; return false;

View file

@ -256,7 +256,7 @@ void BitmapBuffer::drawFontPattern(coord_t x, coord_t y, const uint8_t * font, c
lcdNextPos = x + width; lcdNextPos = x + width;
} }
void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags) void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags flags)
{ {
int width = getTextWidth(s, len, flags); int width = getTextWidth(s, len, flags);
int height = getFontHeight(flags); int height = getFontHeight(flags);
@ -279,12 +279,6 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_
drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
} }
char str[256];
if (flags & ZCHAR)
strcat_zchar(str, s, len);
else
strAppend(str, s, len);
const coord_t orig_x = x; const coord_t orig_x = x;
bool setx = false; bool setx = false;
while (len--) { while (len--) {

View file

@ -52,6 +52,34 @@ const uint8_t LBM_TOPMENU_USB[] = {
#include "mask_topmenu_usb.lbm" #include "mask_topmenu_usb.lbm"
}; };
const uint8_t LBM_TOPMENU_VOLUME_0[] = {
#include "mask_volume_0.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_1[] = {
#include "mask_volume_1.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_2[] = {
#include "mask_volume_2.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_3[] = {
#include "mask_volume_3.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_4[] = {
#include "mask_volume_4.lbm"
};
const uint8_t LBM_TOPMENU_VOLUME_SCALE[] = {
#include "mask_volume_scale.lbm"
};
const uint8_t LBM_TOPMENU_TXBATT[] = {
#include "mask_txbat.lbm"
};
const uint8_t LBM_HTRIM_FRAME[] = { const uint8_t LBM_HTRIM_FRAME[] = {
#include "mask_htrim_frame.lbm" #include "mask_htrim_frame.lbm"
}; };

View file

@ -30,6 +30,13 @@ extern const uint8_t LBM_CURRENT_DOT[];
// Main view icons // Main view icons
extern const uint8_t LBM_TOPMENU_USB[]; extern const uint8_t LBM_TOPMENU_USB[];
extern const uint8_t LBM_TOPMENU_VOLUME_0[];
extern const uint8_t LBM_TOPMENU_VOLUME_1[];
extern const uint8_t LBM_TOPMENU_VOLUME_2[];
extern const uint8_t LBM_TOPMENU_VOLUME_3[];
extern const uint8_t LBM_TOPMENU_VOLUME_4[];
extern const uint8_t LBM_TOPMENU_VOLUME_SCALE[];
extern const uint8_t LBM_TOPMENU_TXBATT[];
extern const uint8_t LBM_HTRIM_FRAME[]; extern const uint8_t LBM_HTRIM_FRAME[];
extern const uint8_t LBM_VTRIM_FRAME[]; extern const uint8_t LBM_VTRIM_FRAME[];
extern const uint8_t LBM_TRIM_SHADOW[]; extern const uint8_t LBM_TRIM_SHADOW[];

View file

@ -18,55 +18,63 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "../../opentx.h" #include "opentx.h"
const uint16_t font_tinsize_specs[] PROGMEM = uint16_t font_tinsize_specs[] = {
#include "font_tinsize.specs" #include "font_tinsize.specs"
; };
const pm_uchar font_tinsize[] PROGMEM = { pm_uchar font_tinsize[] = {
#include "font_tinsize.lbm" #include "font_tinsize.lbm"
}; };
const uint16_t font_smlsize_specs[] PROGMEM = uint16_t font_smlsize_specs[] = {
#include "font_smlsize.specs" #include "font_smlsize.specs"
; };
const pm_uchar font_smlsize[] PROGMEM = { pm_uchar font_smlsize[] = {
#include "font_smlsize.lbm" #include "font_smlsize.lbm"
}; };
const uint16_t font_stdsize_specs[] PROGMEM = uint16_t font_stdsize_specs[] = {
#include "font_stdsize.specs" #include "font_stdsize.specs"
; };
const pm_uchar font_stdsize[] PROGMEM = { pm_uchar font_stdsize[] = {
#include "font_stdsize.lbm" #include "font_stdsize.lbm"
}; };
const uint16_t font_midsize_specs[] PROGMEM = uint16_t font_midsize_specs[] = {
#include "font_midsize.specs" #include "font_midsize.specs"
; };
const pm_uchar font_midsize[] PROGMEM = { pm_uchar font_midsize[] = {
#include "font_midsize.lbm" #include "font_midsize.lbm"
}; };
const uint16_t font_dblsize_specs[] PROGMEM = uint16_t font_dblsize_specs[] = {
#include "font_dblsize.specs" #include "font_dblsize.specs"
; };
const pm_uchar font_dblsize[] PROGMEM = { pm_uchar font_dblsize[] = {
#include "font_dblsize.lbm" #include "font_dblsize.lbm"
}; };
const uint16_t font_xxlsize_specs[] PROGMEM = uint16_t font_xxlsize_specs[] = {
#include "font_xxlsize.specs" #include "font_xxlsize.specs"
; };
const pm_uchar font_xxlsize[] PROGMEM = { pm_uchar font_xxlsize[] = {
#include "font_xxlsize.lbm" #include "font_xxlsize.lbm"
}; };
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs }; uint16_t font_stdsizebold_specs[] = {
const pm_uchar * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize }; #include "font_stdsizebold.specs"
};
pm_uchar font_stdsizebold[] = {
#include "font_stdsizebold.lbm"
};
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsizebold_specs };
const uint8_t * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsizebold };

View file

@ -51,10 +51,10 @@
#define CURVE_COORD_WIDTH 36 #define CURVE_COORD_WIDTH 36
#define CURVE_COORD_HEIGHT 17 #define CURVE_COORD_HEIGHT 17
#define DATETIME_SEPARATOR_X (LCD_W-55) #define DATETIME_SEPARATOR_X (LCD_W-53)
#define DATETIME_LINE1 9 #define DATETIME_LINE1 9
#define DATETIME_LINE2 23 #define DATETIME_LINE2 23
#define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+8)/2 #define DATETIME_MIDDLE (LCD_W+DATETIME_SEPARATOR_X+6)/2
#define MENU_TITLE_NEXT_POS (lcdNextPos + 10) #define MENU_TITLE_NEXT_POS (lcdNextPos + 10)
#define MENU_INIT_VPOS -1 #define MENU_INIT_VPOS -1

View file

@ -38,7 +38,6 @@
#define lcdint_t int32_t #define lcdint_t int32_t
#define BSS 0x00 #define BSS 0x00
#define BOLD 0x00
/* lcd common flags */ /* lcd common flags */
#define BLINK 0x01 #define BLINK 0x01
@ -69,6 +68,7 @@
#define MIDSIZE 0x0300 #define MIDSIZE 0x0300
#define DBLSIZE 0x0400 #define DBLSIZE 0x0400
#define XXLSIZE 0x0500 #define XXLSIZE 0x0500
#define BOLD 0x0600
#define VERTICAL 0x0800 #define VERTICAL 0x0800
#define TIMEBLINK 0x1000 #define TIMEBLINK 0x1000

View file

@ -124,14 +124,14 @@ bool menuCommonCalib(evt_t event)
// START CALIBRATION // START CALIBRATION
if (!READ_ONLY()) { if (!READ_ONLY()) {
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR); lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, "Press [Enter] to start", MENU_TITLE_COLOR); lcdDrawText(50, 3+FH, STR_MENUTOSTART, MENU_TITLE_COLOR);
} }
break; break;
case CALIB_SET_MIDPOINT: case CALIB_SET_MIDPOINT:
// SET MIDPOINT // SET MIDPOINT
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR); lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, "Please center sticks and press [Enter]", MENU_TITLE_COLOR); lcdDrawText(50, 3+FH, STR_SETMIDPOINT, MENU_TITLE_COLOR);
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) { for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
reusableBuffer.calib.loVals[i] = 15000; reusableBuffer.calib.loVals[i] = 15000;
reusableBuffer.calib.hiVals[i] = -15000; reusableBuffer.calib.hiVals[i] = -15000;
@ -146,7 +146,7 @@ bool menuCommonCalib(evt_t event)
case CALIB_MOVE_STICKS: case CALIB_MOVE_STICKS:
// MOVE STICKS/POTS // MOVE STICKS/POTS
lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR); lcdDrawText(50, 3, STR_MENUCALIBRATION, MENU_TITLE_COLOR);
lcdDrawText(50, 3+FH, "Move sticks, pots and sliders and press [Enter]", MENU_TITLE_COLOR); lcdDrawText(50, 3+FH, STR_MOVESTICKSPOTS, MENU_TITLE_COLOR);
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) { for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) { if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i]; g_eeGeneral.calib[i].mid = reusableBuffer.calib.midVals[i];

View file

@ -178,7 +178,7 @@ bool menuGeneralHardware(evt_t event)
#endif #endif
case ITEM_SETUP_HW_BAT_CAL: case ITEM_SETUP_HW_BAT_CAL:
lcdDrawText(MENUS_MARGIN_LEFT, y, "Battery cal."); lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BATT_CALIB);
lcdDrawNumber(HW_SETTINGS_COLUMN, y, getBatteryVoltage(), attr|LEFT|PREC2, 0, NULL, "V"); lcdDrawNumber(HW_SETTINGS_COLUMN, y, getBatteryVoltage(), attr|LEFT|PREC2, 0, NULL, "V");
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127); if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.txVoltageCalibration, -127, 127);
break; break;

View file

@ -18,7 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "../../opentx.h" #include "opentx.h"
bool menuGeneralVersion(evt_t event) bool menuGeneralVersion(evt_t event)
{ {

View file

@ -250,7 +250,7 @@ bool menuModelCurveOne(evt_t event)
lcdDrawSolidFilledRect(point.x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, 2, 2*CURVE_SIDE_WIDTH+2, CURVE_CURSOR_COLOR); lcdDrawSolidFilledRect(point.x, CURVE_CENTER_Y-CURVE_SIDE_WIDTH, 2, 2*CURVE_SIDE_WIDTH+2, CURVE_CURSOR_COLOR);
char text[5]; char text[5];
strAppendUnsigned(text, points[i]); strAppendSigned(text, points[i]);
if (point.x >= CURVE_CENTER_X) { if (point.x >= CURVE_CENTER_X) {
drawCurveVerticalScale(point.x-15); drawCurveVerticalScale(point.x-15);
@ -273,7 +273,7 @@ bool menuModelCurveOne(evt_t event)
drawCurvePoint(point.x-3, point.y-4, CURVE_CURSOR_COLOR); drawCurvePoint(point.x-3, point.y-4, CURVE_CURSOR_COLOR);
strAppendUnsigned(text, x); strAppendSigned(text, x);
drawCurveCoord(limit(CURVE_CENTER_X-CURVE_SIDE_WIDTH-1, point.x-CURVE_COORD_WIDTH/2, CURVE_CENTER_X+CURVE_SIDE_WIDTH-CURVE_COORD_WIDTH+1), CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, text, selectionMode==1); drawCurveCoord(limit(CURVE_CENTER_X-CURVE_SIDE_WIDTH-1, point.x-CURVE_COORD_WIDTH/2, CURVE_CENTER_X+CURVE_SIDE_WIDTH-CURVE_COORD_WIDTH+1), CURVE_CENTER_Y+CURVE_SIDE_WIDTH+2, text, selectionMode==1);
if (s_editMode > 0) { if (s_editMode > 0) {

View file

@ -127,7 +127,7 @@ bool menuModelFlightModesAll(evt_t event)
FlightModeData *p = flightModeAddress(k); FlightModeData *p = flightModeAddress(k);
putsFlightMode(MENUS_MARGIN_LEFT, y, k+1, (getFlightMode()==k ? 0/*BOLD*/ : 0) | ((sub==k && menuHorizontalPosition<0) ? INVERS : 0)); putsFlightMode(MENUS_MARGIN_LEFT, y, k+1, (getFlightMode()==k ? BOLD : 0) | ((sub==k && menuHorizontalPosition<0) ? INVERS : 0));
for (int j=0; j<ITEM_FLIGHT_MODES_COUNT; j++) { for (int j=0; j<ITEM_FLIGHT_MODES_COUNT; j++) {
LcdFlags attr = ((sub==k && posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0); LcdFlags attr = ((sub==k && posHorz==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);

View file

@ -109,7 +109,7 @@ bool menuModelLogicalSwitches(evt_t event)
// CSW name // CSW name
unsigned int sw = SWSRC_SW1+k; unsigned int sw = SWSRC_SW1+k;
putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? 0/*BOLD*/ : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0)); putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
// CSW func // CSW func
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0); lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);

View file

@ -162,7 +162,7 @@ enum MixFields {
MIX_FIELD_COUNT MIX_FIELD_COUNT
}; };
void gvarWeightItem(coord_t x, coord_t y, MixData *md, uint8_t attr, evt_t event) void gvarWeightItem(coord_t x, coord_t y, MixData *md, LcdFlags attr, evt_t event)
{ {
u_int8int16_t weight; u_int8int16_t weight;
MD_WEIGHT_TO_UNION(md, weight); MD_WEIGHT_TO_UNION(md, weight);

View file

@ -101,11 +101,11 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, evt_t event)
{ {
TimerData * timer = &g_model.timers[timerIdx]; TimerData * timer = &g_model.timers[timerIdx];
if (attr && menuHorizontalPosition < 0) { if (attr && menuHorizontalPosition < 0) {
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN+1, 90+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR); lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN+1, 115+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
} }
drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_TIMER, timerIdx+1); drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_TIMER, timerIdx+1);
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, (menuHorizontalPosition<=0 ? attr : 0)); putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, (menuHorizontalPosition<=0 ? attr : 0));
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition!=0 ? attr : 0)); putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR));
if (attr && s_editMode>0) { if (attr && s_editMode>0) {
switch (menuHorizontalPosition) { switch (menuHorizontalPosition) {
case 0: case 0:

View file

@ -487,18 +487,21 @@ bool menuScreenSetup(int index, evt_t event)
currentContainer = currentScreen; currentContainer = currentScreen;
bool needsOffsetCheck = (menuVerticalPosition != 0 || menuHorizontalPosition < 0); bool needsOffsetCheck = (menuVerticalPosition != 0 || menuHorizontalPosition < 0);
const ZoneOption * options = currentScreen->getFactory()->getOptions();
int optionsCount = getOptionsCount(options);
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1 + optionsCount;
char title[] = "Main view X"; char title[] = "Main view X";
title[sizeof(title)-2] = '1' + index; title[sizeof(title)-2] = '1' + index;
menuPageCount = updateMainviewsMenu(); menuPageCount = updateMainviewsMenu();
uint8_t mstate_tab[2 + MAX_LAYOUT_OPTIONS] = { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW }; const ZoneOption * options = currentScreen->getFactory()->getOptions();
int optionsCount = getOptionsCount(options);
linesCount = ITEM_SCREEN_SETUP_LAYOUT_OPTION1 + optionsCount;
if (menuPageCount > 3)
++linesCount;
uint8_t mstate_tab[2 + MAX_LAYOUT_OPTIONS + 1] = { uint8_t(NAVIGATION_LINE_BY_LINE|uint8_t(countRegisteredLayouts-1)), ORPHAN_ROW };
for (int i=0; i<optionsCount; i++) { for (int i=0; i<optionsCount; i++) {
mstate_tab[3+i] = getZoneOptionColumns(&options[i]); mstate_tab[3+i] = getZoneOptionColumns(&options[i]);
} }
mstate_tab[3+optionsCount] = 0; // The remove button
CUSTOM_MENU_WITH_OPTIONS(title, LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount); CUSTOM_MENU_WITH_OPTIONS(title, LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount);
@ -533,26 +536,33 @@ bool menuScreenSetup(int index, evt_t event)
default: default:
{ {
uint8_t index = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1; uint8_t o = k - ITEM_SCREEN_SETUP_LAYOUT_OPTION1;
if (index < optionsCount) { if (o < optionsCount) {
const ZoneOption * option = &options[index]; const ZoneOption * option = &options[o];
ZoneOptionValue * value = currentScreen->getOptionValue(index); ZoneOptionValue * value = currentScreen->getOptionValue(o);
if (editZoneOption(y, option, value, attr, EE_MODEL, event)) { if (editZoneOption(y, option, value, attr, EE_MODEL, event)) {
currentScreen->update(); currentScreen->update();
} }
} }
else if (menuPageCount > 3 && o == optionsCount) {
drawButton(SCREENS_SETUP_2ND_COLUMN, y, STR_REMOVE_SCREEN, attr);
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
delete currentScreen;
if (index != MAX_CUSTOM_SCREENS-1) {
memmove(&g_model.screenData[index], &g_model.screenData[index + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - index - 1));
memmove(&customScreens[index], &customScreens[index + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - index - 1));
}
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
chainMenu(menuTabScreensSetup[index > 0 ? index : 1]);
return false;
}
}
break; break;
} }
} }
} }
if (menuVerticalPosition == -1 && index > 0 && event == EVT_KEY_LONG(KEY_ENTER)) {
killEvents(KEY_ENTER);
menuHorizontalPosition = index;
POPUP_MENU_ADD_ITEM(STR_REMOVE_SCREEN);
popupMenuHandler = onScreenSetupMenu;
}
return true; return true;
} }
@ -592,23 +602,10 @@ bool menuScreenAdd(evt_t event)
if (event == EVT_KEY_BREAK(KEY_ENTER)) { if (event == EVT_KEY_BREAK(KEY_ENTER)) {
customScreens[menuPageCount-2] = registeredLayouts[0]->create(&g_model.screenData[menuPageCount-2].layoutData); customScreens[menuPageCount-2] = registeredLayouts[0]->create(&g_model.screenData[menuPageCount-2].layoutData);
s_editMode = 0; s_editMode = 0;
menuHorizontalPosition = -1;
return false; return false;
} }
SIMPLE_MENU_WITH_OPTIONS("Add main view", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0); SIMPLE_MENU_WITH_OPTIONS("Add main view", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0);
return true; return true;
} }
void onScreenSetupMenu(const char * result)
{
if (result == STR_REMOVE_SCREEN) {
delete customScreens[menuHorizontalPosition];
if (menuHorizontalPosition != MAX_CUSTOM_SCREENS-1) {
memmove(&g_model.screenData[menuHorizontalPosition], &g_model.screenData[menuHorizontalPosition + 1], sizeof(CustomScreenData) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1));
memmove(&customScreens[menuHorizontalPosition], &customScreens[menuHorizontalPosition + 1], sizeof(Layout *) * (MAX_CUSTOM_SCREENS - menuHorizontalPosition - 1));
}
memset(&g_model.screenData[MAX_CUSTOM_SCREENS-1], 0, sizeof(CustomScreenData));
customScreens[MAX_CUSTOM_SCREENS-1] = NULL;
// chainMenu(menuMainviews[menuHorizontalPosition > 0 ? menuHorizontalPosition-1 : 0]);
}
}

View file

@ -28,7 +28,7 @@ unsigned int Topbar::getZonesCount() const
Zone Topbar::getZone(unsigned int index) const Zone Topbar::getZone(unsigned int index) const
{ {
Zone zone; Zone zone;
zone.x = 50 + (TOPBAR_ZONE_WIDTH + 2*TOPBAR_ZONE_MARGIN) * index; zone.x = 49 + (TOPBAR_ZONE_WIDTH + 2*TOPBAR_ZONE_MARGIN) * index;
zone.y = TOPBAR_ZONE_MARGIN; zone.y = TOPBAR_ZONE_MARGIN;
zone.w = TOPBAR_ZONE_WIDTH; zone.w = TOPBAR_ZONE_WIDTH;
zone.h = MENU_HEADER_HEIGHT - 2*TOPBAR_ZONE_MARGIN; zone.h = MENU_HEADER_HEIGHT - 2*TOPBAR_ZONE_MARGIN;
@ -57,7 +57,7 @@ void drawTopBar()
// USB icon // USB icon
if (usbPlugged()) { if (usbPlugged()) {
lcdDrawBitmapPattern(LCD_W-102, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR); lcdDrawBitmapPattern(LCD_W-98, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR);
} }
// RSSI // RSSI
@ -68,6 +68,26 @@ void drawTopBar()
lcdDrawSolidFilledRect(LCD_W-90 + i * 6, 38 - height, 4, height, TELEMETRY_RSSI() >= rssiBarsValue[i] ? MENU_TITLE_COLOR : MENU_TITLE_DISABLE_COLOR); lcdDrawSolidFilledRect(LCD_W-90 + i * 6, 38 - height, 4, height, TELEMETRY_RSSI() >= rssiBarsValue[i] ? MENU_TITLE_COLOR : MENU_TITLE_DISABLE_COLOR);
} }
/* Audio volume */
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_SCALE, MENU_TITLE_DISABLE_COLOR);
if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_0, MENU_TITLE_COLOR);
else if (requiredSpeakerVolume < 7)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_1, MENU_TITLE_COLOR);
else if (requiredSpeakerVolume < 13)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_2, MENU_TITLE_COLOR);
else if (requiredSpeakerVolume < 19)
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_3, MENU_TITLE_COLOR);
else
lcdDrawBitmapPattern(LCD_W-130, 4, LBM_TOPMENU_VOLUME_4, MENU_TITLE_COLOR);
/* Tx battery */
uint8_t bars = limit<int8_t>(0, 6 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin), 5);
lcdDrawBitmapPattern(LCD_W-130, 24, LBM_TOPMENU_TXBATT, MENU_TITLE_COLOR);
for (unsigned int i = 0; i < 5; i++) {
lcdDrawSolidFilledRect(LCD_W-122+4*i, 30, 2, 8, i >= bars ? MENU_TITLE_DISABLE_COLOR : MENU_TITLE_COLOR);
}
topbar->refresh(); topbar->refresh();
#if 0 #if 0

View file

@ -25,7 +25,7 @@
#define MAX_TOPBAR_ZONES 5 #define MAX_TOPBAR_ZONES 5
#define MAX_TOPBAR_OPTIONS 0 #define MAX_TOPBAR_OPTIONS 0
#define TOPBAR_ZONE_WIDTH 60 #define TOPBAR_ZONE_WIDTH 70
#define TOPBAR_ZONE_MARGIN 3 #define TOPBAR_ZONE_MARGIN 3
class Topbar: public WidgetsContainer<MAX_TOPBAR_ZONES, MAX_TOPBAR_OPTIONS> class Topbar: public WidgetsContainer<MAX_TOPBAR_ZONES, MAX_TOPBAR_OPTIONS>

View file

@ -137,10 +137,6 @@ bool menuMainView(evt_t event)
killEvents(KEY_DOWN); killEvents(KEY_DOWN);
break; break;
case EVT_ENTRY_UP:
LOAD_MODEL_BITMAP();
break;
case EVT_KEY_LONG(KEY_ENTER): case EVT_KEY_LONG(KEY_ENTER):
killEvents(event); killEvents(event);
POPUP_MENU_ADD_ITEM(STR_MODEL_SELECT); POPUP_MENU_ADD_ITEM(STR_MODEL_SELECT);
@ -157,17 +153,17 @@ bool menuMainView(evt_t event)
case EVT_KEY_LONG(KEY_MODEL): case EVT_KEY_LONG(KEY_MODEL):
killEvents(event); killEvents(event);
pushMenu(menuTabModel[0]); pushMenu(menuTabModel[0]);
break; return false;
case EVT_KEY_LONG(KEY_RADIO): case EVT_KEY_LONG(KEY_RADIO):
killEvents(event); killEvents(event);
pushMenu(menuTabGeneral[0]); pushMenu(menuTabGeneral[0]);
break; return false;
case EVT_KEY_LONG(KEY_TELEM): case EVT_KEY_LONG(KEY_TELEM):
killEvents(event); killEvents(event);
pushMenu(menuTabScreensSetup[1]); pushMenu(menuTabScreensSetup[1]);
break; return false;
case EVT_KEY_BREAK(KEY_PGDN): case EVT_KEY_BREAK(KEY_PGDN):
storageDirty(EE_GENERAL); storageDirty(EE_GENERAL);

View file

@ -45,8 +45,13 @@ void TimerWidget::refresh()
TimerState & timerState = timersStates[index]; TimerState & timerState = timersStates[index];
if (zone.w >= 180 && zone.h >= 70) { if (zone.w >= 180 && zone.h >= 70) {
if (timerState.val >= 0 || !(timerState.val % 2)) {
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, MAINVIEW_PANES_COLOR); lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, MAINVIEW_PANES_COLOR);
if (timerData.start) { }
else {
lcdDrawBitmapPattern(zone.x, zone.y, LBM_TIMER_BACKGROUND, HEADER_BGCOLOR);
}
if (timerData.start && timerState.val >= 0) {
lcdDrawBitmapPatternPie( lcdDrawBitmapPatternPie(
zone.x + 2, zone.x + 2,
zone.y + 3, LBM_RSCALE, MAINVIEW_GRAPHICS_COLOR, 0, zone.y + 3, LBM_RSCALE, MAINVIEW_GRAPHICS_COLOR, 0,
@ -67,21 +72,24 @@ void TimerWidget::refresh()
drawStringWithIndex(zone.x + 137, zone.y + 17, "TMR", index + 1, SMLSIZE | TEXT_COLOR); drawStringWithIndex(zone.x + 137, zone.y + 17, "TMR", index + 1, SMLSIZE | TEXT_COLOR);
} }
else { else {
drawStringWithIndex(zone.x, zone.y, "TMR", index + 1, SMLSIZE | TEXT_INVERTED_COLOR); if (timerState.val < 0 && timerState.val % 2) {
lcdDrawSolidFilledRect(zone.x, zone.y, zone.w, zone.h, HEADER_ICON_BGCOLOR);
}
drawStringWithIndex(zone.x + 2, zone.y, "TMR", index + 1, SMLSIZE | TEXT_INVERTED_COLOR);
if (zone.w > 100 && zone.h > 40) { if (zone.w > 100 && zone.h > 40) {
if (abs(timerState.val) >= 3600) { if (abs(timerState.val) >= 3600) {
putsTimer(zone.x, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | TIMEHOUR); putsTimer(zone.x + 3, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | TIMEHOUR);
} }
else { else {
putsTimer(zone.x, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | MIDSIZE); putsTimer(zone.x + 3, zone.y + 16, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | MIDSIZE);
} }
} }
else { else {
if (abs(timerState.val) >= 3600) { if (abs(timerState.val) >= 3600) {
putsTimer(zone.x, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | SMLSIZE | TIMEHOUR); putsTimer(zone.x + 3, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT | SMLSIZE | TIMEHOUR);
} }
else { else {
putsTimer(zone.x, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT); putsTimer(zone.x + 3, zone.y + 14, abs(timerState.val), TEXT_INVERTED_COLOR | LEFT);
} }
} }
} }

View file

@ -267,8 +267,8 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr); lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
} }
else if (func == FUNC_SET_TIMER) { else if (func == FUNC_SET_TIMER) {
val_max = 59*60+59; val_max = 539*60+59; //8:59:59
putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr); putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT|TIMEHOUR, attr);
} }
else if (func == FUNC_PLAY_SOUND) { else if (func == FUNC_PLAY_SOUND) {
val_max = AU_SPECIAL_SOUND_LAST-AU_SPECIAL_SOUND_FIRST-1; val_max = AU_SPECIAL_SOUND_LAST-AU_SPECIAL_SOUND_FIRST-1;

View file

@ -122,9 +122,8 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
TimerData * timer = &g_model.timers[timerIdx]; TimerData * timer = &g_model.timers[timerIdx];
drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1); drawStringWithIndex(0*FW, y, STR_TIMER, timerIdx+1);
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0); putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, menuHorizontalPosition==0 ? attr : 0);
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR, menuHorizontalPosition==2 ? attr|TIMEHOUR : TIMEHOUR);
putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, menuHorizontalPosition==1 ? attr : 0, menuHorizontalPosition==2 ? attr : 0); if (attr && menuHorizontalPosition < 0) lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, 11*FW, FH+1);
if (attr && menuHorizontalPosition < 0) lcdDrawFilledRect(MODEL_SETUP_2ND_COLUMN-1, y-1, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH+1, FH+1);
if (attr && s_editMode>0) { if (attr && s_editMode>0) {
div_t qr = div(timer->start, 60); div_t qr = div(timer->start, 60);
switch (menuHorizontalPosition) { switch (menuHorizontalPosition) {
@ -148,13 +147,14 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, uint8_t event)
break; break;
} }
case 1: case 1:
CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59); qr.quot = checkIncDec(event, qr.quot, 0, 1439, EE_MODEL | NO_INCDEC_MARKS); // 23h59
timer->start = qr.rem + qr.quot*60; timer->start = qr.rem + qr.quot*60;
break; break;
case 2: case 2:
qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2; qr.rem -= checkIncDecModel(event, qr.rem+2, 1, 62)-2;
timer->start -= qr.rem ; timer->start -= qr.rem ;
if ((int16_t)timer->start < 0) timer->start=0; if ((int16_t)timer->start < 0) timer->start=0;
if ((int32_t)timer->start > 86399) timer->start=86399; // 23h59:59
break; break;
} }
} }

View file

@ -18,7 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "../../opentx.h" #include "opentx.h"
enum menuModelTelemetryItems { enum menuModelTelemetryItems {
ITEM_TELEMETRY_PROTOCOL_TYPE, ITEM_TELEMETRY_PROTOCOL_TYPE,

View file

@ -275,9 +275,11 @@ void displayTopBar()
/* Audio volume */ /* Audio volume */
if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet) if (requiredSpeakerVolume == 0 || g_eeGeneral.beepMode == e_mode_quiet)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER0); LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER0);
else if (requiredSpeakerVolume < 10) else if (requiredSpeakerVolume <= 6)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER1); LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER1);
else if (requiredSpeakerVolume < 20) else if (requiredSpeakerVolume <= 12)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER2);
else if (requiredSpeakerVolume <= 18)
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER2); LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER2);
else else
LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER3); LCD_ICON(BAR_VOLUME_X, BAR_Y, ICON_SPEAKER3);

View file

@ -234,9 +234,9 @@ void writeLogs()
#if defined(FRSKY) #if defined(FRSKY)
#if !defined(CPUARM) #if !defined(CPUARM)
f_printf(&g_oLogFile, "%d,%d,%d,", frskyStreaming, RAW_FRSKY_MINMAX(frskyData.rssi[0]), RAW_FRSKY_MINMAX(frskyData.rssi[1])); f_printf(&g_oLogFile, "%d,%d,%d,", telemetryStreaming, RAW_FRSKY_MINMAX(telemetryData.rssi[0]), RAW_FRSKY_MINMAX(telemetryData.rssi[1]));
for (uint8_t i=0; i<MAX_FRSKY_A_CHANNELS; i++) { for (uint8_t i=0; i<MAX_FRSKY_A_CHANNELS; i++) {
int16_t converted_value = applyChannelRatio(i, RAW_FRSKY_MINMAX(frskyData.analog[i])); int16_t converted_value = applyChannelRatio(i, RAW_FRSKY_MINMAX(telemetryData.analog[i]));
f_printf(&g_oLogFile, "%d.%02d,", converted_value/100, converted_value%100); f_printf(&g_oLogFile, "%d.%02d,", converted_value/100, converted_value%100);
} }
@ -245,36 +245,36 @@ void writeLogs()
if (IS_USR_PROTO_FRSKY_HUB()) { if (IS_USR_PROTO_FRSKY_HUB()) {
f_printf(&g_oLogFile, "%4d-%02d-%02d,%02d:%02d:%02d,%03d.%04d%c,%03d.%04d%c,%03d.%02d," TELEMETRY_GPS_SPEED_FORMAT TELEMETRY_GPS_ALT_FORMAT TELEMETRY_BARO_ALT_FORMAT TELEMETRY_VSPEED_FORMAT TELEMETRY_ASPEED_FORMAT "%d,%d,%d,%d," TELEMETRY_CELLS_FORMAT TELEMETRY_CURRENT_FORMAT "%d," TELEMETRY_VFAS_FORMAT "%d,%d,%d,", f_printf(&g_oLogFile, "%4d-%02d-%02d,%02d:%02d:%02d,%03d.%04d%c,%03d.%04d%c,%03d.%02d," TELEMETRY_GPS_SPEED_FORMAT TELEMETRY_GPS_ALT_FORMAT TELEMETRY_BARO_ALT_FORMAT TELEMETRY_VSPEED_FORMAT TELEMETRY_ASPEED_FORMAT "%d,%d,%d,%d," TELEMETRY_CELLS_FORMAT TELEMETRY_CURRENT_FORMAT "%d," TELEMETRY_VFAS_FORMAT "%d,%d,%d,",
frskyData.hub.year+2000, telemetryData.hub.year+2000,
frskyData.hub.month, telemetryData.hub.month,
frskyData.hub.day, telemetryData.hub.day,
frskyData.hub.hour, telemetryData.hub.hour,
frskyData.hub.min, telemetryData.hub.min,
frskyData.hub.sec, telemetryData.hub.sec,
frskyData.hub.gpsLongitude_bp, telemetryData.hub.gpsLongitude_bp,
frskyData.hub.gpsLongitude_ap, telemetryData.hub.gpsLongitude_ap,
frskyData.hub.gpsLongitudeEW ? frskyData.hub.gpsLongitudeEW : '-', telemetryData.hub.gpsLongitudeEW ? telemetryData.hub.gpsLongitudeEW : '-',
frskyData.hub.gpsLatitude_bp, telemetryData.hub.gpsLatitude_bp,
frskyData.hub.gpsLatitude_ap, telemetryData.hub.gpsLatitude_ap,
frskyData.hub.gpsLatitudeNS ? frskyData.hub.gpsLatitudeNS : '-', telemetryData.hub.gpsLatitudeNS ? telemetryData.hub.gpsLatitudeNS : '-',
frskyData.hub.gpsCourse_bp, telemetryData.hub.gpsCourse_bp,
frskyData.hub.gpsCourse_ap, telemetryData.hub.gpsCourse_ap,
TELEMETRY_GPS_SPEED_ARGS TELEMETRY_GPS_SPEED_ARGS
TELEMETRY_GPS_ALT_ARGS TELEMETRY_GPS_ALT_ARGS
TELEMETRY_BARO_ALT_ARGS TELEMETRY_BARO_ALT_ARGS
TELEMETRY_VSPEED_ARGS TELEMETRY_VSPEED_ARGS
TELEMETRY_ASPEED_ARGS TELEMETRY_ASPEED_ARGS
frskyData.hub.temperature1, telemetryData.hub.temperature1,
frskyData.hub.temperature2, telemetryData.hub.temperature2,
frskyData.hub.rpm, telemetryData.hub.rpm,
frskyData.hub.fuelLevel, telemetryData.hub.fuelLevel,
TELEMETRY_CELLS_ARGS TELEMETRY_CELLS_ARGS
TELEMETRY_CURRENT_ARGS TELEMETRY_CURRENT_ARGS
frskyData.hub.currentConsumption, telemetryData.hub.currentConsumption,
TELEMETRY_VFAS_ARGS TELEMETRY_VFAS_ARGS
frskyData.hub.accelX, telemetryData.hub.accelX,
frskyData.hub.accelY, telemetryData.hub.accelY,
frskyData.hub.accelZ); telemetryData.hub.accelZ);
} }
#endif #endif

View file

@ -1,27 +1,12 @@
/* /*
* Authors (alphabetical order) * Copyright (C) OpenTX
* - Andre Bernet <bernet.andre@gmail.com>
* - Andreas Weitl
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Gabriel Birkus
* - Jean-Pierre Parisy
* - Karl Szmutny
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
* *
* opentx is based on code named * Based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * th9x - http://code.google.com/p/th9x
* er9x by Erez Raviv: http://code.google.com/p/er9x/, * er9x - http://code.google.com/p/er9x
* and the original (and ongoing) project by * gruvin9x - http://code.google.com/p/gruvin9x
* Thomas Husterer, th9x: http://code.google.com/p/th9x/ *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -31,7 +16,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include <ctype.h> #include <ctype.h>

View file

@ -1,27 +1,12 @@
/* /*
* Authors (alphabetical order) * Copyright (C) OpenTX
* - Andre Bernet <bernet.andre@gmail.com>
* - Andreas Weitl
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Gabriel Birkus
* - Jean-Pierre Parisy
* - Karl Szmutny
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
* *
* opentx is based on code named * Based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * th9x - http://code.google.com/p/th9x
* er9x by Erez Raviv: http://code.google.com/p/er9x/, * er9x - http://code.google.com/p/er9x
* and the original (and ongoing) project by * gruvin9x - http://code.google.com/p/gruvin9x
* Thomas Husterer, th9x: http://code.google.com/p/th9x/ *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -31,7 +16,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include <ctype.h> #include <ctype.h>

View file

@ -1,27 +1,12 @@
/* /*
* Authors (alphabetical order) * Copyright (C) OpenTX
* - Andre Bernet <bernet.andre@gmail.com>
* - Andreas Weitl
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Gabriel Birkus
* - Jean-Pierre Parisy
* - Karl Szmutny
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
* *
* opentx is based on code named * Based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * th9x - http://code.google.com/p/th9x
* er9x by Erez Raviv: http://code.google.com/p/er9x/, * er9x - http://code.google.com/p/er9x
* and the original (and ongoing) project by * gruvin9x - http://code.google.com/p/gruvin9x
* Thomas Husterer, th9x: http://code.google.com/p/th9x/ *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -31,7 +16,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include <ctype.h> #include <ctype.h>

View file

@ -1,27 +1,12 @@
/* /*
* Authors (alphabetical order) * Copyright (C) OpenTX
* - Andre Bernet <bernet.andre@gmail.com>
* - Andreas Weitl
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Gabriel Birkus
* - Jean-Pierre Parisy
* - Karl Szmutny
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
* *
* opentx is based on code named * Based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * th9x - http://code.google.com/p/th9x
* er9x by Erez Raviv: http://code.google.com/p/er9x/, * er9x - http://code.google.com/p/er9x
* and the original (and ongoing) project by * gruvin9x - http://code.google.com/p/gruvin9x
* Thomas Husterer, th9x: http://code.google.com/p/th9x/ *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -31,7 +16,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#include <ctype.h> #include <ctype.h>

View file

@ -1,27 +1,12 @@
/* /*
* Authors (alphabetical order) * Copyright (C) OpenTX
* - Andre Bernet <bernet.andre@gmail.com>
* - Andreas Weitl
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Gabriel Birkus
* - Jean-Pierre Parisy
* - Karl Szmutny
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
* *
* opentx is based on code named * Based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, * th9x - http://code.google.com/p/th9x
* er9x by Erez Raviv: http://code.google.com/p/er9x/, * er9x - http://code.google.com/p/er9x
* and the original (and ongoing) project by * gruvin9x - http://code.google.com/p/gruvin9x
* Thomas Husterer, th9x: http://code.google.com/p/th9x/ *
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
@ -31,7 +16,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*
*/ */
#ifndef _LUA_API_H_ #ifndef _LUA_API_H_

View file

@ -143,21 +143,21 @@ double gpsToDouble(bool neg, int16_t bp, int16_t ap)
#if defined(FRSKY_HUB) && !defined(CPUARM) #if defined(FRSKY_HUB) && !defined(CPUARM)
void extractLatitudeLongitude(uint32_t * latitude, uint32_t * longitude) void extractLatitudeLongitude(uint32_t * latitude, uint32_t * longitude)
{ {
div_t qr = div(frskyData.hub.gpsLatitude_bp, 100); div_t qr = div(telemetryData.hub.gpsLatitude_bp, 100);
*latitude = ((uint32_t)(qr.quot) * 1000000) + (((uint32_t)(qr.rem) * 10000 + frskyData.hub.gpsLatitude_ap) * 5) / 3; *latitude = ((uint32_t)(qr.quot) * 1000000) + (((uint32_t)(qr.rem) * 10000 + telemetryData.hub.gpsLatitude_ap) * 5) / 3;
qr = div(frskyData.hub.gpsLongitude_bp, 100); qr = div(telemetryData.hub.gpsLongitude_bp, 100);
*longitude = ((uint32_t)(qr.quot) * 1000000) + (((uint32_t)(qr.rem) * 10000 + frskyData.hub.gpsLongitude_ap) * 5) / 3; *longitude = ((uint32_t)(qr.quot) * 1000000) + (((uint32_t)(qr.rem) * 10000 + telemetryData.hub.gpsLongitude_ap) * 5) / 3;
} }
void getGpsPilotPosition() void getGpsPilotPosition()
{ {
extractLatitudeLongitude(&frskyData.hub.pilotLatitude, &frskyData.hub.pilotLongitude); extractLatitudeLongitude(&telemetryData.hub.pilotLatitude, &telemetryData.hub.pilotLongitude);
uint32_t lat = frskyData.hub.pilotLatitude / 10000; uint32_t lat = telemetryData.hub.pilotLatitude / 10000;
uint32_t angle2 = (lat*lat) / 10000; uint32_t angle2 = (lat*lat) / 10000;
uint32_t angle4 = angle2 * angle2; uint32_t angle4 = angle2 * angle2;
frskyData.hub.distFromEarthAxis = 139*(((uint32_t)10000000-((angle2*(uint32_t)123370)/81)+(angle4/25))/12500); telemetryData.hub.distFromEarthAxis = 139*(((uint32_t)10000000-((angle2*(uint32_t)123370)/81)+(angle4/25))/12500);
// TRACE("frskyData.hub.distFromEarthAxis=%d", frskyData.hub.distFromEarthAxis); // TRACE("telemetryData.hub.distFromEarthAxis=%d", telemetryData.hub.distFromEarthAxis);
} }
void getGpsDistance() void getGpsDistance()
@ -166,21 +166,21 @@ void getGpsDistance()
extractLatitudeLongitude(&lat, &lng); extractLatitudeLongitude(&lat, &lng);
// printf("lat=%d (%d), long=%d (%d)\n", lat, abs(lat - frskyData.hub.pilotLatitude), lng, abs(lng - frskyData.hub.pilotLongitude)); // printf("lat=%d (%d), long=%d (%d)\n", lat, abs(lat - telemetryData.hub.pilotLatitude), lng, abs(lng - telemetryData.hub.pilotLongitude));
uint32_t angle = (lat > frskyData.hub.pilotLatitude) ? lat - frskyData.hub.pilotLatitude : frskyData.hub.pilotLatitude - lat; uint32_t angle = (lat > telemetryData.hub.pilotLatitude) ? lat - telemetryData.hub.pilotLatitude : telemetryData.hub.pilotLatitude - lat;
uint32_t dist = EARTH_RADIUS * angle / 1000000; uint32_t dist = EARTH_RADIUS * angle / 1000000;
uint32_t result = dist*dist; uint32_t result = dist*dist;
angle = (lng > frskyData.hub.pilotLongitude) ? lng - frskyData.hub.pilotLongitude : frskyData.hub.pilotLongitude - lng; angle = (lng > telemetryData.hub.pilotLongitude) ? lng - telemetryData.hub.pilotLongitude : telemetryData.hub.pilotLongitude - lng;
dist = frskyData.hub.distFromEarthAxis * angle / 1000000; dist = telemetryData.hub.distFromEarthAxis * angle / 1000000;
result += dist*dist; result += dist*dist;
dist = abs(TELEMETRY_BARO_ALT_AVAILABLE() ? TELEMETRY_RELATIVE_BARO_ALT_BP : TELEMETRY_RELATIVE_GPS_ALT_BP); dist = abs(TELEMETRY_BARO_ALT_AVAILABLE() ? TELEMETRY_RELATIVE_BARO_ALT_BP : TELEMETRY_RELATIVE_GPS_ALT_BP);
result += dist*dist; result += dist*dist;
frskyData.hub.gpsDistance = isqrt32(result); telemetryData.hub.gpsDistance = isqrt32(result);
if (frskyData.hub.gpsDistance > frskyData.hub.maxGpsDistance) if (telemetryData.hub.gpsDistance > telemetryData.hub.maxGpsDistance)
frskyData.hub.maxGpsDistance = frskyData.hub.gpsDistance; telemetryData.hub.maxGpsDistance = telemetryData.hub.gpsDistance;
} }
#endif #endif

View file

@ -370,39 +370,39 @@ getvalue_t getValue(mixsrc_t i)
} }
} }
#elif defined(FRSKY) #elif defined(FRSKY)
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RSSI_TX) return frskyData.rssi[1].value; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RSSI_TX) return telemetryData.rssi[1].value;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RSSI_RX) return frskyData.rssi[0].value; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RSSI_RX) return telemetryData.rssi[0].value;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_A1) return frskyData.analog[TELEM_ANA_A1].value; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_A1) return telemetryData.analog[TELEM_ANA_A1].value;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_A2) return frskyData.analog[TELEM_ANA_A2].value; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_A2) return telemetryData.analog[TELEM_ANA_A2].value;
#if defined(FRSKY_SPORT) #if defined(FRSKY_SPORT)
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ALT) return frskyData.hub.baroAltitude; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ALT) return telemetryData.hub.baroAltitude;
#elif defined(FRSKY_HUB) || defined(WS_HOW_HIGH) #elif defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ALT) return TELEMETRY_RELATIVE_BARO_ALT_BP; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ALT) return TELEMETRY_RELATIVE_BARO_ALT_BP;
#endif #endif
#if defined(FRSKY_HUB) #if defined(FRSKY_HUB)
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RPM) return frskyData.hub.rpm; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_RPM) return telemetryData.hub.rpm;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_FUEL) return frskyData.hub.fuelLevel; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_FUEL) return telemetryData.hub.fuelLevel;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_T1) return frskyData.hub.temperature1; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_T1) return telemetryData.hub.temperature1;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_T2) return frskyData.hub.temperature2; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_T2) return telemetryData.hub.temperature2;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_SPEED) return TELEMETRY_GPS_SPEED_BP; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_SPEED) return TELEMETRY_GPS_SPEED_BP;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_DIST) return frskyData.hub.gpsDistance; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_DIST) return telemetryData.hub.gpsDistance;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_GPSALT) return TELEMETRY_RELATIVE_GPS_ALT_BP; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_GPSALT) return TELEMETRY_RELATIVE_GPS_ALT_BP;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CELL) return (int16_t)TELEMETRY_MIN_CELL_VOLTAGE; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CELL) return (int16_t)TELEMETRY_MIN_CELL_VOLTAGE;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CELLS_SUM) return (int16_t)frskyData.hub.cellsSum; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CELLS_SUM) return (int16_t)telemetryData.hub.cellsSum;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_VFAS) return (int16_t)frskyData.hub.vfas; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_VFAS) return (int16_t)telemetryData.hub.vfas;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CURRENT) return (int16_t)frskyData.hub.current; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CURRENT) return (int16_t)telemetryData.hub.current;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CONSUMPTION) return frskyData.hub.currentConsumption; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_CONSUMPTION) return telemetryData.hub.currentConsumption;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_POWER) return frskyData.hub.power; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_POWER) return telemetryData.hub.power;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCx) return frskyData.hub.accelX; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCx) return telemetryData.hub.accelX;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCy) return frskyData.hub.accelY; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCy) return telemetryData.hub.accelY;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCz) return frskyData.hub.accelZ; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ACCz) return telemetryData.hub.accelZ;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_HDG) return frskyData.hub.gpsCourse_bp; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_HDG) return telemetryData.hub.gpsCourse_bp;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_VSPEED) return frskyData.hub.varioSpeed; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_VSPEED) return telemetryData.hub.varioSpeed;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ASPEED) return frskyData.hub.airSpeed; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_ASPEED) return telemetryData.hub.airSpeed;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_DTE) return frskyData.hub.dTE; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_DTE) return telemetryData.hub.dTE;
else if (i<=MIXSRC_FIRST_TELEM-1+TELEM_MIN_A1) return frskyData.analog[TELEM_ANA_A1].min; else if (i<=MIXSRC_FIRST_TELEM-1+TELEM_MIN_A1) return telemetryData.analog[TELEM_ANA_A1].min;
else if (i==MIXSRC_FIRST_TELEM-1+TELEM_MIN_A2) return frskyData.analog[TELEM_ANA_A2].min; else if (i==MIXSRC_FIRST_TELEM-1+TELEM_MIN_A2) return telemetryData.analog[TELEM_ANA_A2].min;
else if (i<=MIXSRC_FIRST_TELEM-1+TELEM_CSW_MAX) return *(((int16_t*)(&frskyData.hub.minAltitude))+i-(MIXSRC_FIRST_TELEM-1+TELEM_MIN_ALT)); else if (i<=MIXSRC_FIRST_TELEM-1+TELEM_CSW_MAX) return *(((int16_t*)(&telemetryData.hub.minAltitude))+i-(MIXSRC_FIRST_TELEM-1+TELEM_MIN_ALT));
#endif #endif
#endif #endif
else return 0; else return 0;

View file

@ -300,6 +300,8 @@ void generalDefault()
#endif #endif
#if defined(CPUARM) #if defined(CPUARM)
g_eeGeneral.ttsLanguage[0] = 'e';
g_eeGeneral.ttsLanguage[1] = 'n';
g_eeGeneral.wavVolume = 2; g_eeGeneral.wavVolume = 2;
g_eeGeneral.backgroundVolume = 1; g_eeGeneral.backgroundVolume = 1;
#endif #endif
@ -919,7 +921,7 @@ getvalue_t convert8bitsTelemValue(uint8_t channel, ls_telemetry_value_t value)
#endif #endif
#if defined(FRSKY)&& !defined(CPUARM) #if defined(FRSKY)&& !defined(CPUARM)
FORCEINLINE void convertUnit(getvalue_t & val, uint8_t & unit) void convertUnit(getvalue_t & val, uint8_t & unit)
{ {
if (IS_IMPERIAL_ENABLE()) { if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_TEMPERATURE) { if (unit == UNIT_TEMPERATURE) {
@ -2667,7 +2669,6 @@ int main()
MCUCR = 0x80 ; // Must be done twice MCUCR = 0x80 ; // Must be done twice
#elif defined(PCBSTD) #elif defined(PCBSTD)
uint8_t mcusr = MCUCSR; uint8_t mcusr = MCUCSR;
MCUCSR = 0;
MCUCSR = 0x80 ; // Disable JTAG port that can interfere with POT3 MCUCSR = 0x80 ; // Disable JTAG port that can interfere with POT3
MCUCSR = 0x80 ; // Must be done twice MCUCSR = 0x80 ; // Must be done twice
#endif #endif

View file

@ -222,8 +222,8 @@
#endif #endif
#if defined(SIMU) #if defined(SIMU)
#ifndef FORCEINLINE #if !defined(FORCEINLINE)
#define FORCEINLINE #define FORCEINLINE inline
#endif #endif
#if !defined(NOINLINE) #if !defined(NOINLINE)
#define NOINLINE #define NOINLINE
@ -1301,29 +1301,11 @@ void evalFunctions();
extern volatile rotenc_t g_rotenc[1]; extern volatile rotenc_t g_rotenc[1];
#endif #endif
#if defined(CPUARM)
#include "telemetry/telemetry.h" #include "telemetry/telemetry.h"
#endif
#if defined (FRSKY)
// FrSky Telemetry
#include "telemetry/frsky.h"
#elif defined(JETI)
// Jeti-DUPLEX Telemetry
#include "telemetry/jeti.h"
#elif defined(ARDUPILOT)
// ArduPilot Telemetry
#include "telemetry/ardupilot.h"
#elif defined(NMEA)
// NMEA Telemetry
#include "telemetry/nmea.h"
#elif defined(MAVLINK)
// Mavlink Telemetry
#include "telemetry/mavlink.h"
#endif
#if defined(CPUARM) #if defined(CPUARM)
uint16_t crc16(uint8_t * buf, uint32_t len); uint8_t crc8(const uint8_t * ptr, uint32_t len);
uint16_t crc16(const uint8_t * ptr, uint32_t len);
#endif #endif
#define PLAY_REPEAT(x) (x) /* Range 0 to 15 */ #define PLAY_REPEAT(x) (x) /* Range 0 to 15 */

View file

@ -68,7 +68,7 @@ PACK(struct Dsm2PulsesData {
}); });
#endif #endif
#define CROSSFIRE_BAUDRATE 921600 #define CROSSFIRE_BAUDRATE 400000
#define CROSSFIRE_FRAME_LEN 25 #define CROSSFIRE_FRAME_LEN 25
#define CROSSFIRE_CHANNELS_COUNT 16 #define CROSSFIRE_CHANNELS_COUNT 16
PACK(struct CrossfirePulsesData { PACK(struct CrossfirePulsesData {

View file

@ -524,7 +524,7 @@ int main(int argc,char **argv)
#endif #endif
#if defined(FRSKY) && !defined(FRSKY_SPORT) #if defined(FRSKY) && !defined(FRSKY_SPORT)
frskyStreaming = 1; telemetryStreaming = 1;
#endif #endif
printf("Model size = %d\n", (int)sizeof(g_model)); printf("Model size = %d\n", (int)sizeof(g_model));

View file

@ -1,4 +1,4 @@
//This file was auto-generated by generate_datacopy.py script on Wed Mar 16 20:12:19 2016. Do not edit this file! //This file was auto-generated by generate_datacopy.py script on Fri Mar 25 14:17:31 2016. Do not edit this file!
@ -77,6 +77,7 @@ void copyCustomFunctionData(A * dest, B * src)
{ {
dest->swtch = src->swtch; dest->swtch = src->swtch;
dest->func = src->func; dest->func = src->func;
copyCustomFunctionData_all(&dest->all, &src->all);
dest->active = src->active; dest->active = src->active;
} }
@ -165,6 +166,24 @@ void copyFrSkyTelemetryData(A * dest, B * src)
} }
} }
template <class A, class B>
void copyTelemetrySensor(A * dest, B * src)
{
dest->id = src->id;
dest->instance = src->instance;
memcpy(dest->label, src->label, sizeof(dest->label));
dest->type = src->type;
dest->unit = src->unit;
dest->prec = src->prec;
dest->autoOffset = src->autoOffset;
dest->filter = src->filter;
dest->logs = src->logs;
dest->persistent = src->persistent;
dest->onlyPositive = src->onlyPositive;
dest->subId = src->subId;
copyTelemetrySensor_custom(&dest->custom, &src->custom);
}
template <class A, class B> template <class A, class B>
void copyModuleData(A * dest, B * src) void copyModuleData(A * dest, B * src)
{ {
@ -305,3 +324,17 @@ void copyRadioData(A * dest, B * src)
dest->potsConfig = src->potsConfig; dest->potsConfig = src->potsConfig;
} }
template <class A, class B>
void copyCustomFunctionData_all(A * dest, B * src)
{
dest->val = src->val;
dest->mode = src->mode;
dest->param = src->param;
}
template <class A, class B>
void copyTelemetrySensor_custom(A * dest, B * src)
{
dest->ratio = src->ratio;
dest->offset = src->offset;
}

View file

@ -34,11 +34,6 @@ PACK(struct RamBackupUncompressed {
Backup::RamBackupUncompressed ramBackupUncompressed __DMA; Backup::RamBackupUncompressed ramBackupUncompressed __DMA;
PACK(struct RamBackup {
uint16_t size;
uint8_t data[4094];
});
#if defined(SIMU) #if defined(SIMU)
RamBackup _ramBackup; RamBackup _ramBackup;
RamBackup * ramBackup = &_ramBackup; RamBackup * ramBackup = &_ramBackup;
@ -52,15 +47,6 @@ void rambackupWrite()
copyModelData(&ramBackupUncompressed.model, &g_model); copyModelData(&ramBackupUncompressed.model, &g_model);
ramBackup->size = compress(ramBackup->data, 4094, (const uint8_t *)&ramBackupUncompressed, sizeof(ramBackupUncompressed)); ramBackup->size = compress(ramBackup->data, 4094, (const uint8_t *)&ramBackupUncompressed, sizeof(ramBackupUncompressed));
TRACE("RamBackupWrite sdsize=%d backupsize=%d rlcsize=%d", sizeof(ModelData)+sizeof(RadioData), sizeof(Backup::RamBackupUncompressed), ramBackup->size); TRACE("RamBackupWrite sdsize=%d backupsize=%d rlcsize=%d", sizeof(ModelData)+sizeof(RadioData), sizeof(Backup::RamBackupUncompressed), ramBackup->size);
#if 0
// TODO move this code to non regression tests
Backup::RamBackupUncompressed ramBackupRestored;
if (uncompress((uint8_t *)&ramBackupRestored, sizeof(ramBackupRestored), ramBackup->data, ramBackup->size) != sizeof(ramBackupUncompressed))
TRACE("ERROR uncompress");
if (memcmp(&ramBackupUncompressed, &ramBackupRestored, sizeof(ramBackupUncompressed)) != 0)
TRACE("ERROR restore");
#endif
} }
bool rambackupRestore() bool rambackupRestore()

View file

@ -30,4 +30,11 @@ const char * readModel(const char * filename, uint8_t * buffer, uint32_t size);
const char * loadModel(const char * filename); const char * loadModel(const char * filename);
const char * createModel(); const char * createModel();
PACK(struct RamBackup {
uint16_t size;
uint8_t data[4094];
});
extern RamBackup * ramBackup;
#endif // _SDCARD_RAW_H_ #endif // _SDCARD_RAW_H_

View file

@ -279,7 +279,7 @@ uint8_t trimDown(uint8_t idx)
return trimHelper(~PIND, idx); return trimHelper(~PIND, idx);
} }
FORCEINLINE void readKeysAndTrims() void readKeysAndTrims()
{ {
uint8_t enuk = KEY_MENU; uint8_t enuk = KEY_MENU;

View file

@ -18,7 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "../../opentx.h" #include "opentx.h"
struct t_voice Voice ; struct t_voice Voice ;

View file

@ -18,7 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "../../opentx.h" #include "opentx.h"
#if defined(FRSKY) #if defined(FRSKY)
@ -33,9 +33,6 @@ void telemetryEnableRx(void)
UCSRB_N(TLM_USART) |= (1 << RXCIE_N(TLM_USART)); // enable Interrupt UCSRB_N(TLM_USART) |= (1 << RXCIE_N(TLM_USART)); // enable Interrupt
} }
void processSerialData(uint8_t data);
extern uint8_t frskyRxBufferCount; // TODO not driver, change name
ISR(USART_RX_vect_N(TLM_USART)) ISR(USART_RX_vect_N(TLM_USART))
{ {
uint8_t stat; uint8_t stat;
@ -79,10 +76,10 @@ ISR(USART_RX_vect_N(TLM_USART))
if (stat & ((1 << FE_N(TLM_USART)) | (1 << DOR_N(TLM_USART)) | (1 << UPE_N(TLM_USART)))) { if (stat & ((1 << FE_N(TLM_USART)) | (1 << DOR_N(TLM_USART)) | (1 << UPE_N(TLM_USART)))) {
// discard buffer and start fresh on any comms error // discard buffer and start fresh on any comms error
frskyRxBufferCount = 0; telemetryRxBufferCount = 0;
} }
else { else {
processSerialData(data); processFrskyTelemetryData(data);
} }
cli() ; cli() ;

View file

@ -164,7 +164,7 @@ void pwrOff()
#endif #endif
} }
FORCEINLINE uint8_t keyDown() uint8_t keyDown()
{ {
return ((~PINL) & 0x3F) || ROTENC_DOWN(); return ((~PINL) & 0x3F) || ROTENC_DOWN();
} }
@ -240,7 +240,7 @@ uint8_t trimDown(uint8_t idx)
return (in & pgm_read_byte(crossTrim+idx)); return (in & pgm_read_byte(crossTrim+idx));
} }
FORCEINLINE void readKeysAndTrims() void readKeysAndTrims()
{ {
uint8_t enuk = KEY_MENU; uint8_t enuk = KEY_MENU;

View file

@ -45,7 +45,7 @@ static void ADS7952_Init()
SPI_InitTypeDef SPI_InitStructure; SPI_InitTypeDef SPI_InitStructure;
GPIO_InitStructure.GPIO_Pin = ADC_SPI_PIN_MISO|ADC_SPI_PIN_SCK|ADC_SPI_PIN_MOSI; GPIO_InitStructure.GPIO_Pin = ADC_SPI_PIN_MISO|ADC_SPI_PIN_SCK|ADC_SPI_PIN_MOSI;
GPIO_InitStructure.GPIO_Speed =GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed =GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
@ -54,7 +54,7 @@ static void ADS7952_Init()
GPIO_InitStructure.GPIO_Pin = ADC_SPI_PIN_CS; GPIO_InitStructure.GPIO_Pin = ADC_SPI_PIN_CS;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(ADC_SPI_GPIO, &GPIO_InitStructure); GPIO_Init(ADC_SPI_GPIO, &GPIO_InitStructure);

View file

@ -84,7 +84,7 @@ void audioSpiInit(void)
SPI_InitTypeDef SPI_InitStructure; SPI_InitTypeDef SPI_InitStructure;
GPIO_InitStructure.GPIO_Pin = AUDIO_SPI_MISO_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = AUDIO_SPI_MISO_GPIO_PIN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

View file

@ -270,5 +270,5 @@ void checkTrainerSettings()
uint16_t getBatteryVoltage() uint16_t getBatteryVoltage()
{ {
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
return (uint16_t)((instant_vbat * (1000 + g_eeGeneral.txVoltageCalibration) ) / 1637); return (uint16_t)((instant_vbat * (1000 + g_eeGeneral.txVoltageCalibration) ) / 1629);
} }

View file

@ -38,7 +38,7 @@ void hapticInit(void)
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = HAPTIC_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = HAPTIC_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(HAPTIC_GPIO, &GPIO_InitStructure); GPIO_Init(HAPTIC_GPIO, &GPIO_InitStructure);

View file

@ -195,7 +195,7 @@ void keysInit()
{ {
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;

View file

@ -75,7 +75,7 @@ static void LCD_AF_GPIOConfig(void)
GPIO_PinAFConfig(GPIOI,GPIO_PinSource14,GPIO_AF_LTDC); GPIO_PinAFConfig(GPIOI,GPIO_PinSource14,GPIO_AF_LTDC);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14;
GPIO_InitStructure.GPIO_Speed =GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed =GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode =GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode =GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType =GPIO_OType_PP; GPIO_InitStructure.GPIO_OType =GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd =GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd =GPIO_PuPd_NOPULL;
@ -113,7 +113,7 @@ static void LCD_AF_GPIOConfig(void)
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 ; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 ;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
@ -125,7 +125,7 @@ static void LCD_Backlight_Config(void)
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = LCD_GPIO_PIN_BL; GPIO_InitStructure.GPIO_Pin = LCD_GPIO_PIN_BL;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(LCD_GPIO_BL, &GPIO_InitStructure); GPIO_Init(LCD_GPIO_BL, &GPIO_InitStructure);
@ -137,7 +137,7 @@ static void LCD_NRSTConfig(void)
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = LCD_GPIO_PIN_NRST; GPIO_InitStructure.GPIO_Pin = LCD_GPIO_PIN_NRST;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(LCD_GPIO_NRST, &GPIO_InitStructure); GPIO_Init(LCD_GPIO_NRST, &GPIO_InitStructure);

View file

@ -25,7 +25,7 @@ void ledOn()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = LED_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = LED_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(LED_GPIO, &GPIO_InitStructure); GPIO_Init(LED_GPIO, &GPIO_InitStructure);
@ -36,7 +36,7 @@ void ledOff()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = LED_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = LED_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(LED_GPIO, &GPIO_InitStructure); GPIO_Init(LED_GPIO, &GPIO_InitStructure);

View file

@ -131,7 +131,7 @@ static void intmoduleNoneStart()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = INTMODULE_TX_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = INTMODULE_TX_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(INTMODULE_TX_GPIO, &GPIO_InitStructure); GPIO_Init(INTMODULE_TX_GPIO, &GPIO_InitStructure);
@ -217,7 +217,7 @@ static void extmoduleNoneStart()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure); GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);
@ -261,7 +261,7 @@ static void extmoduleCrossfireStart()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure); GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);
@ -314,7 +314,7 @@ void intmodulePxxStart()
GPIO_InitStructure.GPIO_Pin = INTMODULE_TX_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = INTMODULE_TX_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(INTMODULE_TX_GPIO, &GPIO_InitStructure); GPIO_Init(INTMODULE_TX_GPIO, &GPIO_InitStructure);
@ -372,7 +372,7 @@ void extmodulePxxStart()
GPIO_PinAFConfig(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PinSource, EXTMODULE_PPM_GPIO_AF); GPIO_PinAFConfig(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PinSource, EXTMODULE_PPM_GPIO_AF);
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure); GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);
@ -432,7 +432,7 @@ static void extmoduleDsm2Start()
GPIO_PinAFConfig(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PinSource, EXTMODULE_PPM_GPIO_AF); GPIO_PinAFConfig(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PinSource, EXTMODULE_PPM_GPIO_AF);
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure); GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);
@ -490,7 +490,7 @@ static void extmodulePpmStart()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure); GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);

View file

@ -26,7 +26,7 @@ void pwrInit()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(PWR_GPIO, &GPIO_InitStructure); GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
@ -64,7 +64,7 @@ void pwrOff()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = AUDIO_SHUTDOWN_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = AUDIO_SHUTDOWN_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(AUDIO_SHUTDOWN_GPIO, &GPIO_InitStructure); GPIO_Init(AUDIO_SHUTDOWN_GPIO, &GPIO_InitStructure);
@ -100,7 +100,7 @@ void pwrResetHandler()
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(PWR_GPIO, &GPIO_InitStructure); GPIO_Init(PWR_GPIO, &GPIO_InitStructure);

View file

@ -36,7 +36,7 @@ void uart3Setup(unsigned int baudrate, bool dma)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(SERIAL_GPIO, &GPIO_InitStructure); GPIO_Init(SERIAL_GPIO, &GPIO_InitStructure);
USART_InitStructure.USART_BaudRate = baudrate; USART_InitStructure.USART_BaudRate = baudrate;

View file

@ -18,6 +18,116 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
/**
******************************************************************************
* @file system_stm32f4xx.c
* @author MCD Application Team
* @version V1.1.0
* @date 25-March-2016
* @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File.
* This file contains the system clock configuration for STM32F4xx devices,
* and is generated by the clock configuration tool
* stm32f4xx_Clock_Configuration_V1.1.0.xls
*
* 1. This file provides two functions and one global variable to be called from
* user application:
* - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
* and Divider factors, AHB/APBx prescalers and Flash settings),
* depending on the configuration made in the clock xls tool.
* This function is called at startup just after reset and
* before branch to main program. This call is made inside
* the "startup_stm32f4xx.s" file.
*
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
* by the user application to setup the SysTick
* timer or configure other parameters.
*
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
* be called whenever the core clock is changed
* during program execution.
*
* 2. After each device reset the HSI (16 MHz) is used as system clock source.
* Then SystemInit() function is called, in "startup_stm32f4xx.s" file, to
* configure the system clock before to branch to main program.
*
* 3. If the system clock source selected by user fails to startup, the SystemInit()
* function will do nothing and HSI still used as system clock source. User can
* add some code to deal with this issue inside the SetSysClock() function.
*
* 4. The default value of HSE crystal is set to 25MHz, refer to "HSE_VALUE" define
* in "stm32f4xx.h" file. When HSE is used as system clock source, directly or
* through PLL, and you are using different crystal you have to adapt the HSE
* value to your own configuration.
*
* 5. This file configures the system clock as follows:
*=============================================================================
*=============================================================================
* Supported STM32F40xx/41xx/427x/437x devices
*-----------------------------------------------------------------------------
* System Clock source | PLL (HSE)
*-----------------------------------------------------------------------------
* SYSCLK(Hz) | 168000000
*-----------------------------------------------------------------------------
* HCLK(Hz) | 168000000
*-----------------------------------------------------------------------------
* AHB Prescaler | 1
*-----------------------------------------------------------------------------
* APB1 Prescaler | 4
*-----------------------------------------------------------------------------
* APB2 Prescaler | 2
*-----------------------------------------------------------------------------
* HSE Frequency(Hz) | 12000000
*-----------------------------------------------------------------------------
* PLL_M | 12
*-----------------------------------------------------------------------------
* PLL_N | 336
*-----------------------------------------------------------------------------
* PLL_P | 2
*-----------------------------------------------------------------------------
* PLL_Q | 7
*-----------------------------------------------------------------------------
* PLLI2S_N | NA
*-----------------------------------------------------------------------------
* PLLI2S_R | NA
*-----------------------------------------------------------------------------
* I2S input clock | NA
*-----------------------------------------------------------------------------
* VDD(V) | 3.3
*-----------------------------------------------------------------------------
* Main regulator output voltage | Scale1 mode
*-----------------------------------------------------------------------------
* Flash Latency(WS) | 5
*-----------------------------------------------------------------------------
* Prefetch Buffer | ON
*-----------------------------------------------------------------------------
* Instruction cache | ON
*-----------------------------------------------------------------------------
* Data cache | ON
*-----------------------------------------------------------------------------
* Require 48MHz for USB OTG FS, | Enabled
* SDIO and RNG clock |
*-----------------------------------------------------------------------------
*=============================================================================
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/** @addtogroup CMSIS /** @addtogroup CMSIS
* @{ * @{
*/ */
@ -89,7 +199,7 @@
* @{ * @{
*/ */
uint32_t SystemCoreClock = 180000000; uint32_t SystemCoreClock = 168000000;
__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

View file

@ -46,7 +46,7 @@ void telemetryPortInit(uint32_t baudrate)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(TELEMETRY_GPIO, &GPIO_InitStructure); GPIO_Init(TELEMETRY_GPIO, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = TELEMETRY_DIR_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = TELEMETRY_DIR_GPIO_PIN;

Some files were not shown because too many files have changed in this diff Show more