chore: Remove support for binary storage format (#2900)
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
if(APPLE)
|
||||
set(CMAKE_C_FLAGS "-Wno-asm-operand-widths -Wno-deprecated-declarations")
|
||||
set(CMAKE_CXX_FLAGS "-Wno-asm-operand-widths -Wno-deprecated-declarations")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wno-asm-operand-widths -Wno-deprecated-declarations")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wno-asm-operand-widths -Wno-deprecated-declarations")
|
||||
endif()
|
||||
|
||||
if(MINGW OR WIN32)
|
||||
|
||||
@@ -58,7 +58,6 @@ option(TBS_RELEASE "Used to build TBS released firmware" OFF)
|
||||
option(IMRC_RELEASE "Used to build IMRC released firmware" OFF)
|
||||
option(HARDWARE_TRAINER_MULTI "Allow multi trainer" OFF)
|
||||
option(BOOTLOADER "Include Bootloader" ON)
|
||||
option(YAML_STORAGE "Enable YAML storage" ON)
|
||||
|
||||
# since we reset all default CMAKE compiler flags for firmware builds, provide an alternate way for user to specify additional flags.
|
||||
set(FIRMWARE_C_FLAGS "" CACHE STRING "Additional flags for firmware target c compiler (note: all CMAKE_C_FLAGS[_*] are ignored for firmware/bootloader).")
|
||||
@@ -149,45 +148,17 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/bitmaps/${BITMAPS_DIR})
|
||||
|
||||
include(gui/CMakeLists.txt)
|
||||
|
||||
# TODO: move to storage/
|
||||
set(SRC ${SRC} storage/storage_common.cpp)
|
||||
|
||||
include(storage/conversions/CMakeLists.txt)
|
||||
|
||||
if(${STORAGE} STREQUAL SDCARD)
|
||||
set(SRC ${SRC} storage/sdcard_common.cpp)
|
||||
if(${STORAGE_FORMAT} STREQUAL RAW)
|
||||
set(SRC ${SRC} storage/modelslist.cpp storage/sdcard_raw.cpp)
|
||||
add_definitions(-DSDCARD_RAW)
|
||||
elseif(${STORAGE_FORMAT} STREQUAL YAML)
|
||||
set(SRC ${SRC} storage/sdcard_yaml.cpp)
|
||||
add_definitions(-DSDCARD_YAML)
|
||||
include(storage/yaml/CMakeLists.txt)
|
||||
if (${STORAGE_CONVERT} STREQUAL EEPROM_RLC)
|
||||
if (STORAGE_CONVERSIONS LESS 221)
|
||||
set(SRC ${SRC} storage/eeprom_rlc.cpp)
|
||||
add_definitions(-DEEPROM_RLC)
|
||||
endif()
|
||||
else(${STORAGE_CONVERT} STREQUAL RAW)
|
||||
set(SRC ${SRC} storage/sdcard_raw.cpp)
|
||||
endif()
|
||||
endif()
|
||||
if(STORAGE_MODELSLIST)
|
||||
set(SRC ${SRC} storage/modelslist.cpp)
|
||||
add_definitions(-DSTORAGE_MODELSLIST)
|
||||
endif()
|
||||
elseif(${STORAGE} STREQUAL EEPROM)
|
||||
set(SRC ${SRC} storage/eeprom_common.cpp)
|
||||
add_definitions(-DEEPROM)
|
||||
if(${STORAGE_FORMAT} STREQUAL RLC)
|
||||
set(SRC ${SRC} storage/eeprom_rlc.cpp)
|
||||
add_definitions(-DEEPROM_RLC)
|
||||
else()
|
||||
set(SRC ${SRC} storage/eeprom_none.cpp)
|
||||
add_definitions(-DEEPROM_NONE)
|
||||
endif()
|
||||
set(SRC ${SRC} storage/sdcard_common.cpp)
|
||||
set(SRC ${SRC} storage/sdcard_yaml.cpp)
|
||||
add_definitions(-DSDCARD_YAML)
|
||||
include(storage/yaml/CMakeLists.txt)
|
||||
if(STORAGE_MODELSLIST)
|
||||
set(SRC ${SRC} storage/modelslist.cpp)
|
||||
add_definitions(-DSTORAGE_MODELSLIST)
|
||||
endif()
|
||||
|
||||
|
||||
if(RTC_BACKUP_RAM)
|
||||
add_definitions(-DRTC_BACKUP_RAM)
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
set(STORAGE_CONVERSIONS 219)
|
||||
|
||||
if(PCB STREQUAL X7)
|
||||
if(PCBREV STREQUAL ZORRO OR PCBREV STREQUAL TPRO OR PCBREV STREQUAL TX12MK2 OR PCBREV STREQUAL LR3PRO OR PCBREV STREQUAL COMMANDO8)
|
||||
set(STORAGE_CONVERSIONS 221)
|
||||
endif()
|
||||
endif()
|
||||
message("Storage conversion: ${STORAGE_CONVERSIONS}")
|
||||
|
||||
if(STORAGE_CONVERSIONS)
|
||||
add_definitions(-DSTORAGE_CONVERSIONS=${STORAGE_CONVERSIONS})
|
||||
set(SRC
|
||||
${SRC}
|
||||
storage/conversions/conversions.cpp
|
||||
storage/conversions/conversions_219_220.cpp
|
||||
storage/conversions/conversions_220_221.cpp
|
||||
)
|
||||
|
||||
include(storage/conversions/yaml/CMakeLists.txt)
|
||||
endif()
|
||||
@@ -1,288 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "conversions.h"
|
||||
|
||||
#if defined(SDCARD_RAW) || defined(SDCARD_YAML)
|
||||
#include "storage/modelslist.h"
|
||||
#include "storage/sdcard_common.h"
|
||||
#include "storage/sdcard_raw.h"
|
||||
#include "storage/sdcard_yaml.h"
|
||||
#endif
|
||||
|
||||
#if defined(STORAGE_MODELSLIST)
|
||||
static void drawProgressScreen(const char* filename, int progress, int total)
|
||||
{
|
||||
#if defined(COLORLCD)
|
||||
lcdInitDirectDrawing();
|
||||
|
||||
OpenTxTheme* l_theme = static_cast<OpenTxTheme*>(theme);
|
||||
l_theme->drawBackground(lcd);
|
||||
|
||||
lcd->drawText(LCD_W / 2, LCD_H / 2 - 30, STR_CONVERTING,
|
||||
FONT(XL) | CENTERED | COLOR_THEME_WARNING);
|
||||
lcd->drawText(LCD_W / 2, LCD_H / 2, filename,
|
||||
FONT(STD) | CENTERED | COLOR_THEME_SECONDARY1);
|
||||
|
||||
l_theme->drawProgressBar(lcd,
|
||||
LCD_W / 4,
|
||||
LCD_H / 2 + 40,
|
||||
LCD_W / 2,
|
||||
20,
|
||||
progress, total);
|
||||
lcdRefresh();
|
||||
|
||||
// invalidate screen to enable quick return
|
||||
// to normal display routine
|
||||
lv_obj_invalidate(lv_scr_act());
|
||||
|
||||
WDG_RESET();
|
||||
#else
|
||||
// TODO: BW progress screen
|
||||
#endif
|
||||
}
|
||||
|
||||
void convertBinRadioData(const char * path, int version)
|
||||
{
|
||||
TRACE("convertRadioData(%s,%d)", path, version);
|
||||
|
||||
#if defined(COLORLCD)
|
||||
// the theme has not been loaded before
|
||||
static_cast<OpenTxTheme*>(theme)->load();
|
||||
|
||||
// Init backlight mode before entering alert screens
|
||||
requiredBacklightBright = BACKLIGHT_FORCED_ON;
|
||||
g_eeGeneral.blOffBright = 20;
|
||||
#endif
|
||||
|
||||
RAISE_ALERT(STR_STORAGE_WARNING, STR_SDCARD_CONVERSION_REQUIRE, NULL,
|
||||
AU_NONE);
|
||||
|
||||
// Load models list before converting
|
||||
modelslist.load(ModelsList::Format::txt);
|
||||
|
||||
unsigned converted = 0;
|
||||
auto to_convert = modelslist.getModelsCount() + 1;
|
||||
|
||||
drawProgressScreen(RADIO_FILENAME, converted, to_convert);
|
||||
TRACE("converting '%s' (%d/%d)", RADIO_FILENAME, converted, to_convert);
|
||||
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 219) {
|
||||
convertRadioData_219_to_220(path);
|
||||
version = 220;
|
||||
}
|
||||
#endif
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 220) {
|
||||
convertRadioData_220_to_221(path);
|
||||
version = 221;
|
||||
}
|
||||
#endif
|
||||
converted++;
|
||||
|
||||
#if defined(SIMU)
|
||||
RTOS_WAIT_MS(200);
|
||||
#endif
|
||||
|
||||
const char* error = nullptr;
|
||||
for(auto model_it = modelslist.begin(); model_it != modelslist.end(); ++model_it) {
|
||||
uint8_t model_version = 0;
|
||||
auto* model_ptr = *model_it;
|
||||
char* filename = model_ptr->modelFilename;
|
||||
|
||||
TRACE("converting '%s' (%d/%d)", filename, converted, to_convert);
|
||||
drawProgressScreen(filename, converted, to_convert);
|
||||
|
||||
// read only the version number (size=0)
|
||||
error = readModelBin(filename, nullptr, 0, &model_version);
|
||||
if (!error) {
|
||||
// TODO: error handling
|
||||
error = convertBinModelData(filename, model_version);
|
||||
|
||||
if (error) {
|
||||
TRACE("ERROR converting '%s': %s", filename, error);
|
||||
}
|
||||
} else {
|
||||
TRACE("ERROR reading '%s': %s", filename, error);
|
||||
}
|
||||
|
||||
converted++;
|
||||
|
||||
#if defined(SIMU)
|
||||
RTOS_WAIT_MS(200);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(SDCARD_YAML) || defined(STORAGE_MODELSLIST)
|
||||
modelslist.clear();
|
||||
modelslist.load();
|
||||
#endif
|
||||
}
|
||||
|
||||
void patchFilenameToYaml(char* str)
|
||||
{
|
||||
constexpr unsigned bin_len = sizeof(MODELS_EXT) - 1;
|
||||
constexpr unsigned yml_len = sizeof(YAML_EXT) - 1;
|
||||
|
||||
// patch file extension
|
||||
const char* ext = strrchr(str, '.');
|
||||
if (ext && (strlen(ext) == bin_len) &&
|
||||
!strncmp(ext, STR_MODELS_EXT, bin_len)) {
|
||||
memcpy((void*)ext, (void*)STR_YAML_EXT, yml_len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
const char* convertBinModelData(char* filename, int version)
|
||||
{
|
||||
TRACE("convertModelData(%s)", filename);
|
||||
|
||||
char path[FF_MAX_LFN + 1];
|
||||
memcpy(path, MODELS_PATH, sizeof(MODELS_PATH)-1);
|
||||
path[sizeof(MODELS_PATH)-1] = '/';
|
||||
strcpy(&path[sizeof(MODELS_PATH)], filename);
|
||||
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 219) {
|
||||
const char* error = convertModelData_219_to_220(path);
|
||||
if (error) return error;
|
||||
version = 220;
|
||||
}
|
||||
#endif
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
if (version == 220) {
|
||||
const char* error = convertModelData_220_to_221(path);
|
||||
if (error) return error;
|
||||
version = 221;
|
||||
}
|
||||
#endif
|
||||
|
||||
patchFilenameToYaml(filename);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(EEPROM) || defined(EEPROM_RLC)
|
||||
#include "storage/eeprom_common.h"
|
||||
|
||||
void eeConvertModel(int id, int version)
|
||||
{
|
||||
TRACE("eeConvertModel(%d,%d)", id, version);
|
||||
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 219) {
|
||||
convertModelData_219_to_220(id);
|
||||
version = 220;
|
||||
}
|
||||
#endif
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
if (version == 220) {
|
||||
convertModelData_220_to_221(id);
|
||||
version = 221;
|
||||
}
|
||||
#endif
|
||||
// TODO: error handling
|
||||
}
|
||||
|
||||
bool eeConvert(uint8_t start_version)
|
||||
{
|
||||
const char *msg = NULL;
|
||||
|
||||
switch (start_version) {
|
||||
case 219:
|
||||
msg = "EEprom Data v219";
|
||||
break;
|
||||
case 220:
|
||||
msg = "EEprom Data v220";
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
// Information to the user and wait for key press
|
||||
g_eeGeneral.backlightMode = e_backlight_mode_on;
|
||||
g_eeGeneral.backlightBright = 0;
|
||||
g_eeGeneral.contrast = 25;
|
||||
|
||||
ALERT(STR_STORAGE_WARNING, msg, AU_BAD_RADIODATA);
|
||||
|
||||
RAISE_ALERT(STR_STORAGE_WARNING, STR_EEPROM_CONVERTING, NULL, AU_NONE);
|
||||
|
||||
// General Settings conversion
|
||||
int version = start_version;
|
||||
(void)version;
|
||||
|
||||
sdCheckAndCreateDirectory(RADIO_PATH);
|
||||
sdCheckAndCreateDirectory(MODELS_PATH);
|
||||
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
if (version == 219) {
|
||||
version = 220;
|
||||
convertRadioData_219_to_220();
|
||||
}
|
||||
#endif
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
if (version == 220) {
|
||||
version = 221;
|
||||
convertRadioData_220_to_221();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(STORAGE_MODELSLIST)
|
||||
modelslist.clear();
|
||||
#endif
|
||||
|
||||
#if LCD_W >= 212
|
||||
lcdDrawRect(60, 6*FH+4, 132, 3);
|
||||
#else
|
||||
lcdDrawRect(10, 6*FH+4, 102, 3);
|
||||
#endif
|
||||
|
||||
// Models conversion
|
||||
for (uint8_t id=0; id<MAX_MODELS; id++) {
|
||||
#if LCD_W >= 212
|
||||
lcdDrawSolidHorizontalLine(61, 6*FH+5, 10+id*2, FORCE);
|
||||
#else
|
||||
lcdDrawSolidHorizontalLine(11, 6*FH+5, 10+(id*3)/2, FORCE);
|
||||
#endif
|
||||
lcdRefresh();
|
||||
|
||||
#if defined(SIMU)
|
||||
RTOS_WAIT_MS(100);
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD_RAW) || defined(SDCARD_YAML)
|
||||
if (eeModelExistsRlc(id)) {
|
||||
#else
|
||||
if (eeModelExists(id)) {
|
||||
#endif
|
||||
eeConvertModel(id, start_version);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(STORAGE_MODELSLIST)
|
||||
modelslist.save();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
// Entry points for converting radio & model data
|
||||
void convertBinRadioData(const char * path, int version);
|
||||
const char* convertBinModelData(char * filename, int version);
|
||||
|
||||
bool eeConvert(uint8_t start_version);
|
||||
void eeConvertModel(int id, int version);
|
||||
|
||||
// // Conversions 216 to 217
|
||||
// void convertModelData_216_to_217(ModelData &model);
|
||||
// void convertRadioData_216_to_217(RadioData &settings);
|
||||
|
||||
// // Conversions 217 to 218
|
||||
// void convertModelData_217_to_218(ModelData &model);
|
||||
// void convertRadioData_217_to_218(RadioData &settings);
|
||||
|
||||
// // Conversions 218 to 219
|
||||
// void convertModelData_218_to_219(ModelData &model);
|
||||
// void convertRadioData_218_to_219(RadioData &settings);
|
||||
|
||||
|
||||
// Conversions 219 to 220
|
||||
const char* convertModelData_219_to_220(uint8_t id);
|
||||
const char* convertModelData_219_to_220(const char* filename);
|
||||
|
||||
const char* convertRadioData_219_to_220();
|
||||
const char* convertRadioData_219_to_220(const char* path);
|
||||
|
||||
// Conversions 220 to 221
|
||||
const char* convertModelData_220_to_221(uint8_t id);
|
||||
const char* convertModelData_220_to_221(const char* filename);
|
||||
|
||||
const char* convertRadioData_220_to_221();
|
||||
const char* convertRadioData_220_to_221(const char* path);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,445 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "datastructs_218.h"
|
||||
|
||||
/*
|
||||
* 60 (Horus / X9) / 40 (others) telemetry sensors instead of 32
|
||||
* ALL: ReceiverData array added
|
||||
* ALL: registrationId added
|
||||
* ALL: failsafeChannels moved from ModuleData to ModelData
|
||||
* ALL: ModuleData / TrainerModuleData modified
|
||||
* PCBX9 : 6 chars for expos / mixes names instead of 8
|
||||
*/
|
||||
|
||||
typedef ModelData ModelData_v219;
|
||||
|
||||
int convertSource_218_to_219(int source)
|
||||
{
|
||||
// on X7: 2 additional switches
|
||||
// on X9D / X9D+: 1 additional switch
|
||||
// on xlite : 2 more storage switches
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
if (source >= MIXSRC_SE)
|
||||
source += 2;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7)
|
||||
if (source >= MIXSRC_SI)
|
||||
source += 2;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9D) || defined(PCBX9DP)
|
||||
if (source >= MIXSRC_SI)
|
||||
source += 1;
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
if (source >= MIXSRC_SI)
|
||||
source += 2;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX10)
|
||||
if (source == MIXSRC_EXT1 || source == MIXSRC_EXT2)
|
||||
source += 2;
|
||||
#endif
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
int convertSwitch_218_to_219(int swtch)
|
||||
{
|
||||
// on X7: 2 additional switches
|
||||
// on X9D / X9D+: 1 additional switch
|
||||
// on XLite: 2 additional storage switches
|
||||
// on X10: 2 additional pots => 12 multipos switches
|
||||
#if defined(PCBX7) || defined(PCBHORUS) || defined(PCBX9D) || defined(PCBX9DP) || defined(PCBXLITE)
|
||||
if (swtch < 0)
|
||||
return -convertSwitch_218_to_219(-swtch);
|
||||
#endif
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
if (swtch >= SWSRC_SE0)
|
||||
swtch += 2 * 3;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX7)
|
||||
if (swtch >= SWSRC_SI0)
|
||||
swtch += 2 * 3;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9D) || defined(PCBX9DP)
|
||||
if (swtch >= SWSRC_SI0)
|
||||
swtch += 3;
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
if (swtch >= SWSRC_SI0)
|
||||
swtch += 2 * 3;
|
||||
#endif
|
||||
|
||||
#if defined(PCBX10)
|
||||
if (swtch >= SWSRC_FIRST_MULTIPOS_SWITCH + 3 * XPOTS_MULTIPOS_COUNT)
|
||||
swtch += 2 * XPOTS_MULTIPOS_COUNT;
|
||||
#endif
|
||||
|
||||
return swtch;
|
||||
}
|
||||
|
||||
void convertModelData_218_to_219(ModelData &model)
|
||||
{
|
||||
static_assert(sizeof(ModelData_v218) <= sizeof(ModelData), "ModelData size has been reduced");
|
||||
|
||||
ModelData_v218 * oldModelAllocated = (ModelData_v218 *)malloc(sizeof(ModelData_v218));
|
||||
ModelData_v218 &oldModel = *oldModelAllocated;
|
||||
|
||||
memcpy(&oldModel, &model, sizeof(ModelData_v218));
|
||||
ModelData_v219 & newModel = (ModelData_v219 &) model;
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
// 4 bytes more for the ModelHeader::bitmap
|
||||
memclear(&newModel.header.bitmap[10], 4);
|
||||
memcpy(newModel.timers, oldModel.timers, offsetof(ModelData_v218, mixData) - offsetof(ModelData_v218, timers));
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
// trainer battery compartment removed
|
||||
if (newModel.trainerData.mode >= TRAINER_MODE_MASTER_BLUETOOTH)
|
||||
newModel.trainerData.mode -= 1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
memclear(newModel.mixData, sizeof(ModelData_v219) - offsetof(ModelData_v219, mixData));
|
||||
|
||||
char name[LEN_MODEL_NAME+1];
|
||||
zchar2str(name, oldModel.header.name, LEN_MODEL_NAME);
|
||||
TRACE("Model %s conversion from v218 to v219", name);
|
||||
|
||||
for (uint8_t i=0; i<MAX_TIMERS_218; i++) {
|
||||
TimerData & timer = newModel.timers[i];
|
||||
if (timer.mode >= TMRMODE_COUNT)
|
||||
timer.mode = TMRMODE_COUNT + convertSwitch_218_to_219(oldModel.timers[i].mode - TMRMODE_COUNT + 1) - 1;
|
||||
else if (timer.mode < 0)
|
||||
timer.mode = convertSwitch_218_to_219(oldModel.timers[i].mode);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<MAX_MIXERS_218; i++) {
|
||||
memmove(&newModel.mixData[i], &oldModel.mixData[i], sizeof(MixData_v218));
|
||||
newModel.mixData[i].srcRaw = convertSource_218_to_219(newModel.mixData[i].srcRaw); // from newModel to avoid overwrite
|
||||
newModel.mixData[i].swtch = convertSwitch_218_to_219(newModel.mixData[i].swtch); // from newModel to avoid overwrite
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<MAX_OUTPUT_CHANNELS_218; i++) {
|
||||
memmove(&newModel.limitData[i], &oldModel.limitData[i], sizeof(LimitData));
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<MAX_EXPOS_218; i++) {
|
||||
memmove(&newModel.expoData[i], &oldModel.expoData[i], sizeof(ExpoData_v218));
|
||||
newModel.expoData[i].srcRaw = convertSource_218_to_219(newModel.expoData[i].srcRaw); // from newModel to avoid overwrite
|
||||
newModel.expoData[i].swtch = convertSwitch_218_to_219(newModel.expoData[i].swtch); // from newModel to avoid overwrite
|
||||
#if LCD_W == 212
|
||||
newModel.expoData[i].offset = oldModel.expoData[i].offset; // 212x64: expo name has been reduced to 6 chars instead of 8
|
||||
newModel.expoData[i].curve = oldModel.expoData[i].curve; // 212x64: expo name has been reduced to 6 chars instead of 8
|
||||
#endif
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<MAX_CURVES_218; i++) {
|
||||
memmove(&newModel.curves[i], &oldModel.curves[i], sizeof(CurveHeader_v218));
|
||||
}
|
||||
|
||||
for (uint32_t i=0; i<MAX_CURVE_POINTS_218; i++) {
|
||||
newModel.points[i] = oldModel.points[i];
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<MAX_LOGICAL_SWITCHES_218; i++) {
|
||||
memmove(&newModel.logicalSw[i], &oldModel.logicalSw[i], sizeof(LogicalSwitchData_v218));
|
||||
LogicalSwitchData & sw = newModel.logicalSw[i];
|
||||
uint8_t cstate = lswFamily(sw.func);
|
||||
if (cstate == LS_FAMILY_OFS || cstate == LS_FAMILY_COMP || cstate == LS_FAMILY_DIFF) {
|
||||
LogicalSwitchData & sw = newModel.logicalSw[i];
|
||||
sw.v1 = convertSource_218_to_219(sw.v1);
|
||||
if (cstate == LS_FAMILY_COMP) {
|
||||
sw.v2 = convertSource_218_to_219(sw.v2);
|
||||
}
|
||||
}
|
||||
else if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
|
||||
sw.v1 = convertSwitch_218_to_219(sw.v1);
|
||||
sw.v2 = convertSwitch_218_to_219(sw.v2);
|
||||
}
|
||||
else if (cstate == LS_FAMILY_EDGE) {
|
||||
sw.v1 = convertSwitch_218_to_219(sw.v1);
|
||||
}
|
||||
sw.andsw = convertSwitch_218_to_219(sw.andsw);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS_218; i++) {
|
||||
memmove(&newModel.customFn[i], &oldModel.customFn[i], sizeof(CustomFunctionData_v218));
|
||||
CustomFunctionData & cf = newModel.customFn[i];
|
||||
cf.swtch = convertSwitch_218_to_219(cf.swtch);
|
||||
if (cf.func == FUNC_PLAY_VALUE || cf.func == FUNC_VOLUME || (IS_ADJUST_GV_FUNC(cf.func) && cf.all.mode == FUNC_ADJUST_GVAR_SOURCE)) {
|
||||
cf.all.val = convertSource_218_to_219(cf.all.val);
|
||||
}
|
||||
}
|
||||
|
||||
newModel.swashR = oldModel.swashR;
|
||||
|
||||
for (uint8_t i=0; i<MAX_FLIGHT_MODES_218; i++) {
|
||||
memmove(&newModel.flightModeData[i], &oldModel.flightModeData[i], sizeof(FlightModeData_v218));
|
||||
FlightModeData & sw = newModel.flightModeData[i];
|
||||
sw.swtch = convertSwitch_218_to_219(sw.swtch);
|
||||
}
|
||||
|
||||
newModel.thrTraceSrc = oldModel.thrTraceSrc;
|
||||
#if defined(PCBX10)
|
||||
if (newModel.thrTraceSrc > 3) // 0=Thr, 1/2/3=Old 3 Pots, then Sliders
|
||||
newModel.thrTraceSrc += 2;
|
||||
#endif
|
||||
newModel.switchWarningState = oldModel.switchWarningState;
|
||||
#if !defined(COLORLCD)
|
||||
newModel.switchWarningEnable = oldModel.switchWarningEnable;
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<MAX_GVARS_218; i++) {
|
||||
memmove(&newModel.gvars[i], &oldModel.gvars[i], sizeof(GVarData_v218));
|
||||
}
|
||||
|
||||
newModel.varioData.source = oldModel.frsky.varioSource;
|
||||
newModel.varioData.centerSilent = oldModel.frsky.varioCenterSilent;
|
||||
newModel.varioData.centerMax = oldModel.frsky.varioCenterMax;
|
||||
newModel.varioData.centerMin = oldModel.frsky.varioCenterMin;
|
||||
newModel.varioData.min = oldModel.frsky.varioMin;
|
||||
newModel.varioData.max = oldModel.frsky.varioMax;
|
||||
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E)
|
||||
newModel.voltsSource = oldModel.frsky.voltsSource;
|
||||
newModel.altitudeSource = oldModel.frsky.altitudeSource;
|
||||
#endif
|
||||
|
||||
newModel.rssiAlarms = oldModel.rssiAlarms;
|
||||
newModel.potsWarnMode = oldModel.potsWarnMode;
|
||||
|
||||
for (int i=0; i<NUM_MODULES; i++) {
|
||||
memcpy(&newModel.moduleData[i], &oldModel.moduleData[i], 4);
|
||||
memcpy(((uint8_t *)&newModel.moduleData[i]) + 4, ((uint8_t *)&oldModel.moduleData[i]) + 64 + 4, 2);
|
||||
if (newModel.moduleData[i].type >= MODULE_TYPE_ISRM_PXX2)
|
||||
newModel.moduleData[i].type += 1;
|
||||
if (newModel.moduleData[i].type >= MODULE_TYPE_R9M_PXX2)
|
||||
newModel.moduleData[i].type += 4;
|
||||
if (newModel.moduleData[i].type == MODULE_TYPE_XJT_PXX1) {
|
||||
newModel.moduleData[i].subType = newModel.moduleData[i].rfProtocol;
|
||||
#if defined(RADIO_X9DP2019)
|
||||
if (i == INTERNAL_MODULE) {
|
||||
newModel.moduleData[i].type = MODULE_TYPE_ISRM_PXX2;
|
||||
newModel.moduleData[i].subType = MODULE_SUBTYPE_ISRM_PXX2_ACCST_D16;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(RADIO_T12)
|
||||
newModel.moduleData[INTERNAL_MODULE].type = MODULE_TYPE_NONE; // Early t12 firmware had unused INT settings that need to be cleared
|
||||
#endif
|
||||
|
||||
for (uint8_t module=0; module<2; module++) {
|
||||
if (oldModel.moduleData[module].failsafeMode == FAILSAFE_CUSTOM) {
|
||||
memcpy(newModel.failsafeChannels, oldModel.moduleData[module].failsafeChannels, sizeof(newModel.failsafeChannels));
|
||||
}
|
||||
}
|
||||
|
||||
newModel.trainerData.mode = oldModel.trainerMode;
|
||||
newModel.trainerData.channelsStart = oldModel.moduleData[NUM_MODULES].channelsStart;
|
||||
newModel.trainerData.channelsCount = oldModel.moduleData[NUM_MODULES].channelsCount;
|
||||
newModel.trainerData.frameLength = oldModel.moduleData[NUM_MODULES].ppm.frameLength;
|
||||
newModel.trainerData.delay = oldModel.moduleData[NUM_MODULES].ppm.delay;
|
||||
newModel.trainerData.pulsePol = oldModel.moduleData[NUM_MODULES].ppm.pulsePol;
|
||||
|
||||
#if defined(PCBHORUS) || defined(PCBTARANIS)
|
||||
memmove(newModel.scriptsData, oldModel.scriptsData,
|
||||
sizeof(newModel.scriptsData) +
|
||||
sizeof(newModel.inputNames) +
|
||||
sizeof(newModel.potsWarnEnabled) +
|
||||
sizeof(newModel.potsWarnPosition));
|
||||
#else
|
||||
memmove(newModel.inputNames, oldModel.inputNames,
|
||||
sizeof(newModel.inputNames) +
|
||||
sizeof(newModel.potsWarnEnabled) +
|
||||
sizeof(newModel.potsWarnPosition));
|
||||
#endif
|
||||
|
||||
for (uint8_t i=0; i<MAX_TELEMETRY_SENSORS_218; i++) {
|
||||
newModel.telemetrySensors[i].id = oldModel.telemetrySensors[i].id;
|
||||
if (oldModel.telemetrySensors[i].type == 0 && ZLEN(oldModel.telemetrySensors[i].label) > 0 && (isModuleTypePXX1(oldModel.moduleData[0].type) || isModuleTypePXX1(oldModel.moduleData[1].type)))
|
||||
newModel.telemetrySensors[i].instance = 0xE0 + (oldModel.telemetrySensors[i].instance & 0x1F) - 1;
|
||||
else
|
||||
newModel.telemetrySensors[i].instance = oldModel.telemetrySensors[i].instance;
|
||||
memcpy(newModel.telemetrySensors[i].label, oldModel.telemetrySensors[i].label, TELEM_LABEL_LEN); // id + instance + label
|
||||
newModel.telemetrySensors[i].subId = oldModel.telemetrySensors[i].subId;
|
||||
newModel.telemetrySensors[i].type = oldModel.telemetrySensors[i].type;
|
||||
newModel.telemetrySensors[i].unit = oldModel.telemetrySensors[i].unit;
|
||||
if (newModel.telemetrySensors[i].unit >= UNIT_MILLILITERS_PER_MINUTE)
|
||||
newModel.telemetrySensors[i].unit += 11;
|
||||
newModel.telemetrySensors[i].prec = oldModel.telemetrySensors[i].prec;
|
||||
newModel.telemetrySensors[i].autoOffset = oldModel.telemetrySensors[i].autoOffset;
|
||||
newModel.telemetrySensors[i].filter = oldModel.telemetrySensors[i].filter;
|
||||
newModel.telemetrySensors[i].logs = oldModel.telemetrySensors[i].logs;
|
||||
newModel.telemetrySensors[i].persistent = oldModel.telemetrySensors[i].persistent;
|
||||
newModel.telemetrySensors[i].onlyPositive = oldModel.telemetrySensors[i].onlyPositive;
|
||||
memcpy(((uint8_t *)&newModel.telemetrySensors[i]) + 10, ((uint8_t *)&oldModel.telemetrySensors[i]) + 9, 4);
|
||||
}
|
||||
|
||||
#if defined(PCBX9E)
|
||||
newModel.toplcdTimer = oldModel.toplcdTimer;
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#if defined(FIXME) //TODO
|
||||
memcpy(newModel.screenData, oldModel.screenData,
|
||||
sizeof(newModel.screenData) +
|
||||
sizeof(newModel.topbarData));
|
||||
|
||||
for (int screen=0; screen<MAX_CUSTOM_SCREENS; screen++) {
|
||||
CustomScreenData& screenData = g_model.screenData[screen];
|
||||
if (screenData.LayoutId[0] == '\0')
|
||||
continue;
|
||||
for (int zone=0; zone<MAX_LAYOUT_ZONES; zone++) {
|
||||
Layout::ZonePersistentData * zoneData = &screenData.layoutData.zones[zone];
|
||||
if (strcmp("Value", zoneData->widgetName))
|
||||
continue;
|
||||
|
||||
ZoneOptionValue& option = zoneData->widgetData.options[0];
|
||||
option.unsignedValue = convertSource_218_to_219(option.unsignedValue);
|
||||
}
|
||||
}
|
||||
|
||||
for (int zone=0; zone<MAX_LAYOUT_ZONES; zone++) {
|
||||
TopBar::ZonePersistentData * zoneData = &g_model.topbarData.zones[zone];
|
||||
if (strcmp("Value", zoneData->widgetName))
|
||||
continue;
|
||||
|
||||
ZoneOptionValue & option = zoneData->widgetData.options[0];
|
||||
option.unsignedValue = convertSource_218_to_219(option.unsignedValue);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
newModel.screensType = oldModel.frsky.screensType;
|
||||
memmove(&newModel.screens, &oldModel.frsky.screens, sizeof(newModel.screens));
|
||||
for (int i=0; i<MAX_TELEMETRY_SCREENS; i++) {
|
||||
uint8_t screenType = (newModel.screensType >> (2*i)) & 0x03;
|
||||
if (screenType == TELEMETRY_SCREEN_TYPE_VALUES) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
for (int k = 0; k < NUM_LINE_ITEMS; k++) {
|
||||
newModel.screens[i].lines[j].sources[k] = convertSource_218_to_219(oldModel.frsky.screens[i].lines[j].sources[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (screenType == TELEMETRY_SCREEN_TYPE_BARS) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
newModel.screens[i].bars[j].source = convertSource_218_to_219(oldModel.frsky.screens[i].bars[j].source);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
free(oldModelAllocated);
|
||||
}
|
||||
|
||||
void convertRadioData_218_to_219(RadioData & settings)
|
||||
{
|
||||
TRACE("Radio conversion from v218 to v219");
|
||||
|
||||
settings.version = 219;
|
||||
settings.variant = EEPROM_VARIANT;
|
||||
|
||||
RadioData_v218 * oldSettingsAllocated = (RadioData_v218 *)malloc(sizeof(RadioData_v218));
|
||||
RadioData_v218 & oldSettings = *oldSettingsAllocated;
|
||||
memcpy(&oldSettings, &settings, sizeof(RadioData_v218));
|
||||
|
||||
#if defined(PCBX9D) || defined(PCBX9DP)
|
||||
// no bluetooth before PCBREV 2019
|
||||
settings.auxSerialMode = oldSettings.auxSerialMode;
|
||||
settings.slidersConfig = oldSettings.slidersConfig;
|
||||
settings.potsConfig = oldSettings.potsConfig;
|
||||
settings.backlightColor = oldSettings.backlightColor;
|
||||
settings.switchUnlockStates = oldSettings.switchUnlockStates;
|
||||
settings.switchConfig = oldSettings.switchConfig;
|
||||
#if defined(RADIO_X9DP2019)
|
||||
settings.switchConfig |= SWITCH_TOGGLE << 16;
|
||||
#endif
|
||||
memcpy(&settings.switchNames[0], &oldSettings.switchNames[0], 8 * LEN_SWITCH_NAME);
|
||||
memclear(&settings.switchNames[8], LEN_SWITCH_NAME);
|
||||
memcpy(&settings.anaNames[0], &oldSettings.anaNames[0], (NUM_STICKS+NUM_POTS+NUM_SLIDERS) * LEN_ANA_NAME);
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
// 2 new pots from X10:
|
||||
// - copy btw. 'chkSum' and 'auxSerialMode' (excl.)
|
||||
memcpy(&settings.chkSum, &oldSettings.chkSum, offsetof(RadioData, switchConfig) - sizeof(uint8_t) - offsetof(RadioData, chkSum));
|
||||
// - move calibration data
|
||||
memcpy(&settings.calib[NUM_STICKS + 5], &oldSettings.calib[NUM_STICKS + 3], sizeof(CalibData) * (STORAGE_NUM_SLIDERS + STORAGE_NUM_MOUSE_ANALOGS));
|
||||
memclear(&settings.calib[NUM_STICKS + 3], sizeof(CalibData) * 2);
|
||||
|
||||
// move fields after custom functions
|
||||
settings.auxSerialMode = oldSettings.auxSerialMode;
|
||||
settings.switchConfig = oldSettings.switchConfig;
|
||||
settings.potsConfig = oldSettings.potsConfig;
|
||||
settings.slidersConfig = oldSettings.slidersConfig;
|
||||
|
||||
// 2 new switches
|
||||
memcpy(&settings.switchNames[0], &oldSettings.switchNames[0], 8 * LEN_SWITCH_NAME);
|
||||
memclear(&settings.switchNames[8], 2 * LEN_SWITCH_NAME);
|
||||
|
||||
// 2 new pots for X10
|
||||
// - split 'anaNames' (sticks + 3 old pots, 2 new pots, other old analogs)
|
||||
memcpy(&settings.anaNames[0], &oldSettings.anaNames[0], (NUM_STICKS + 3) * LEN_ANA_NAME);
|
||||
memclear(&settings.anaNames[NUM_STICKS + 3], 2 * LEN_SWITCH_NAME);
|
||||
memcpy(&settings.anaNames[NUM_STICKS + 5], &oldSettings.anaNames[NUM_STICKS + 3], STORAGE_NUM_SLIDERS * LEN_ANA_NAME);
|
||||
|
||||
// - copy rest of RadioData struct
|
||||
memcpy(&settings.currModelFilename[0], &oldSettings.currModelFilename[0], sizeof(RadioData_v218) - offsetof(RadioData_v218, currModelFilename[0]));
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T12)
|
||||
g_eeGeneral.switchConfig = bfSet<uint32_t>(g_eeGeneral.switchConfig, SWITCH_2POS, 10, 2); // T12 comes with wrongly defined pot2
|
||||
g_eeGeneral.potsConfig = bfSet<uint32_t>(g_eeGeneral.potsConfig, POT_WITHOUT_DETENT, 2, 2); // T12 comes with wrongly defined pot2
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX7) || defined(PCBXLITE) || defined(PCBHORUS)
|
||||
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS_218; i++) {
|
||||
CustomFunctionData & cf = settings.customFn[i];
|
||||
cf.swtch = convertSwitch_218_to_219(cf.swtch);
|
||||
if (cf.func == FUNC_PLAY_VALUE || cf.func == FUNC_VOLUME || (IS_ADJUST_GV_FUNC(cf.func) && cf.all.mode == FUNC_ADJUST_GVAR_SOURCE)) {
|
||||
cf.all.val = convertSource_218_to_219(cf.all.val);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_X9DP2019)
|
||||
// force re-calibration
|
||||
settings.chkSum = 0xFFFF;
|
||||
setDefaultOwnerId();
|
||||
#endif
|
||||
|
||||
settings.pwrOnSpeed = 0;
|
||||
settings.pwrOffSpeed = 0;
|
||||
|
||||
free(oldSettingsAllocated);
|
||||
}
|
||||
@@ -1,355 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#if STORAGE_CONVERSIONS < 220
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#include "definitions.h"
|
||||
#include "datastructs_219.h"
|
||||
#include "datastructs_220.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "strhelpers.h"
|
||||
|
||||
#if defined(EEPROM) || defined(EEPROM_RLC)
|
||||
#include <storage/eeprom_common.h>
|
||||
#else
|
||||
#include <storage/sdcard_common.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Summary of all changes between 219 & 220
|
||||
//
|
||||
// All Radios:
|
||||
// ===========
|
||||
//
|
||||
// PACK(struct TimerData {
|
||||
// - int32_t mode:9; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
// - uint32_t start:23;
|
||||
// - int32_t value:24;
|
||||
// + uint32_t start:22;
|
||||
// + int32_t swtch:10;
|
||||
// + int32_t value:22;
|
||||
// + uint32_t mode:3; // timer mode (OFF, ON, Start, THs, TH%, THt)
|
||||
// uint32_t countdownBeep:2;
|
||||
// uint32_t minuteBeep:1;
|
||||
// uint32_t persistent:2;
|
||||
// int32_t countdownStart:2; // -2=30s -1=20s 0=10s 1=5s converted to -2=5s -1=10s 0=20s 1=30s
|
||||
// - uint32_t direction:1;
|
||||
// NOBACKUP(char name[LEN_TIMER_NAME]);
|
||||
// });
|
||||
//
|
||||
// enum TimerModes {
|
||||
// - TMRMODE_NONE,// ->OFF
|
||||
// - TMRMODE_ABS, // ->ON
|
||||
// + TMRMODE_OFF,
|
||||
// + TMRMODE_ON,
|
||||
// + TMRMODE_START, // 2 -> +1
|
||||
// TMRMODE_THR,
|
||||
// TMRMODE_THR_REL,
|
||||
// - TMRMODE_THR_TRG, // ->START
|
||||
// - TMRMODE_COUNT
|
||||
// + TMRMODE_THR_START,
|
||||
// + TMRMODE_COUNT,
|
||||
// + TMRMODE_MAX = TMRMODE_COUNT - 1
|
||||
// };
|
||||
//
|
||||
// COLORLCD:
|
||||
// =========
|
||||
//
|
||||
// - CHKSIZE(CustomScreenData, 610);
|
||||
// - CHKSIZE(Topbar::PersistentData, 216);
|
||||
// + CHKSIZE(CustomScreenData, 850);
|
||||
// + CHKTYPE(TopBarPersistentData, 300);
|
||||
//
|
||||
// - CHKSIZE(RadioData, 881);
|
||||
// - CHKSIZE(ModelData, 9736);
|
||||
// + CHKSIZE(RadioData, 901);
|
||||
// + CHKSIZE(ModelData, 11020);
|
||||
//
|
||||
// -> RadioData change probably comes from THEME_DATA (added parameter types)
|
||||
// -> ModelData: +1284 (CustomScreenData x 5 = 1200; TopBar::PersistentData: +84)
|
||||
//
|
||||
|
||||
typedef bin_storage_220::TimerData TimerData_v220;
|
||||
|
||||
static void convertToStr(char* str, size_t len)
|
||||
{
|
||||
for (size_t c = 0; c < len; c++) {
|
||||
str[c] = zchar2char(str[c]);
|
||||
}
|
||||
// Trim string
|
||||
while(len > 0 && str[len-1]) {
|
||||
if (str[len - 1] != ' ' && str[len - 1] != '\0') break;
|
||||
str[--len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
void convertModelData_219_to_220(void* data)
|
||||
{
|
||||
constexpr unsigned md_size = sizeof(bin_storage_220::ModelData);
|
||||
auto& model = *reinterpret_cast<bin_storage_220::ModelData*>(data);
|
||||
|
||||
auto oldModelAllocated = reinterpret_cast<bin_storage_220::ModelData*>(malloc(md_size));
|
||||
bin_storage_220::ModelData& oldModel = *oldModelAllocated;
|
||||
|
||||
memcpy(&oldModel, &model, md_size);
|
||||
bin_storage_220::ModelData& newModel = (bin_storage_220::ModelData&)model;
|
||||
convertToStr(model.header.name, LEN_MODEL_NAME_219);
|
||||
|
||||
for (uint8_t i=0; i<MAX_TIMERS_219; i++) {
|
||||
// convert to new timers v220
|
||||
bin_storage_220::TimerData& timer = newModel.timers[i];
|
||||
convertToStr(timer.name, LEN_TIMER_NAME_219);
|
||||
|
||||
TimerData_v219& timer_219 = *(TimerData_v219*)(&oldModel.timers[i]);
|
||||
|
||||
// Convert mode
|
||||
|
||||
if (timer_219.mode >= bin_storage_220::TMRMODE_START) {
|
||||
timer_219.mode += 1;
|
||||
}
|
||||
if (timer_219.mode < bin_storage_220::TMRMODE_COUNT
|
||||
&& timer_219.mode >=0) {
|
||||
timer.mode = timer_219.mode;
|
||||
}
|
||||
else {
|
||||
timer.mode = bin_storage_220::TMRMODE_ON;
|
||||
if (timer_219.mode > 0)
|
||||
timer.swtch = timer_219.mode - (bin_storage_220::TMRMODE_COUNT - 1);
|
||||
else
|
||||
timer.swtch = timer_219.mode;
|
||||
}
|
||||
|
||||
timer.start = timer_219.start;
|
||||
timer.value = timer_219.value;
|
||||
timer.countdownBeep = timer_219.countdownBeep;
|
||||
timer.minuteBeep = timer_219.minuteBeep;
|
||||
timer.persistent = timer_219.persistent;
|
||||
timer.countdownStart = (timer_219.countdownStart * -1) - 1;
|
||||
|
||||
}
|
||||
|
||||
// MixData::name
|
||||
for (uint8_t i=0; i<MAX_MIXERS_219; ++i) {
|
||||
convertToStr(model.mixData[i].name, LEN_EXPOMIX_NAME_219);
|
||||
}
|
||||
|
||||
// LimitData::name
|
||||
for (uint8_t i=0; i<MAX_OUTPUT_CHANNELS_219; ++i) {
|
||||
convertToStr(model.limitData[i].name, LEN_CHANNEL_NAME_219);
|
||||
}
|
||||
|
||||
// ExpoData::name
|
||||
for (uint8_t i=0; i<MAX_EXPOS_219; ++i) {
|
||||
convertToStr(model.expoData[i].name, LEN_EXPOMIX_NAME_219);
|
||||
}
|
||||
|
||||
// CurveHeader.name
|
||||
for (uint8_t i=0; i<MAX_CURVES_219; ++i) {
|
||||
convertToStr(model.curves[i].name, LEN_CURVE_NAME_219);
|
||||
}
|
||||
|
||||
// CustomFunctionData::play.name
|
||||
// for (uint8_t i = 0; i < MAX_SPECIAL_FUNCTIONS_219; ++i) {
|
||||
// CustomFunctionData* cfn = &(model.customFn[i]);
|
||||
// if (cfn->func == FUNC_PLAY_TRACK || cfn->func == FUNC_BACKGND_MUSIC) {
|
||||
// convertToStr(cfn->play.name, LEN_FUNCTION_NAME_219);
|
||||
// }
|
||||
// }
|
||||
|
||||
// GVarData::name ?
|
||||
for (uint8_t i=0; i<MAX_GVARS_219; ++i) {
|
||||
convertToStr(model.gvars[i].name, LEN_GVAR_NAME_219);
|
||||
}
|
||||
|
||||
// ScriptData::name ?
|
||||
// ScriptData::file ?
|
||||
for (uint8_t i=0; i<MAX_SCRIPTS_219; ++i) {
|
||||
convertToStr(model.scriptsData[i].file, LEN_SCRIPT_FILENAME);
|
||||
convertToStr(model.scriptsData[i].name, LEN_SCRIPT_NAME);
|
||||
}
|
||||
|
||||
// Input names
|
||||
for (uint8_t i=0; i<MAX_INPUTS_219; ++i) {
|
||||
convertToStr(model.inputNames[i], LEN_INPUT_NAME_219);
|
||||
}
|
||||
|
||||
// Telemetry names
|
||||
for (uint8_t i=0; i<MAX_TELEMETRY_SENSORS_219; ++i) {
|
||||
convertToStr(model.telemetrySensors[i].label, TELEM_LABEL_LEN_219);
|
||||
}
|
||||
|
||||
// FlightModeData name
|
||||
for (uint8_t i=0; i<MAX_FLIGHT_MODES_219; ++i) {
|
||||
convertToStr(model.flightModeData[i].name, LEN_FLIGHT_MODE_NAME_219);
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: convert all names from zchar to "normal" chars
|
||||
//
|
||||
|
||||
// g_model.header.bitmap ???? really ????
|
||||
// TelemetryScriptData::file ?
|
||||
// ModuleData::pxx2.receiverName
|
||||
|
||||
#if defined(COLORLCD)
|
||||
// Clear CustomScreenData + TopBarPersistentData
|
||||
// as they cannot be converted (missing option types)
|
||||
memset(newModel.screenData, 0,
|
||||
sizeof(newModel.screenData) +
|
||||
sizeof(newModel.topbarData));
|
||||
|
||||
strcpy(newModel.screenData[0].LayoutId, "Layout2P1");
|
||||
auto persistentData = &newModel.screenData[0].layoutData;
|
||||
|
||||
// top bar
|
||||
persistentData->options[0].type = bin_storage_220::ZOV_Bool;
|
||||
persistentData->options[0].value.boolValue = true;
|
||||
|
||||
// flight mode
|
||||
persistentData->options[1].type = bin_storage_220::ZOV_Bool;
|
||||
persistentData->options[1].value.boolValue = true;
|
||||
|
||||
// sliders
|
||||
persistentData->options[2].type = bin_storage_220::ZOV_Bool;
|
||||
persistentData->options[2].value.boolValue = true;
|
||||
|
||||
// trims
|
||||
persistentData->options[3].type = bin_storage_220::ZOV_Bool;
|
||||
persistentData->options[3].value.boolValue = true;
|
||||
|
||||
// mirrored
|
||||
persistentData->options[4].type = bin_storage_220::ZOV_Bool;
|
||||
persistentData->options[4].value.boolValue = false;
|
||||
#endif
|
||||
free(oldModelAllocated);
|
||||
}
|
||||
|
||||
#if !defined(EEPROM_RLC)
|
||||
const char* convertModelData_219_to_220(const char* path)
|
||||
{
|
||||
constexpr unsigned md_size = sizeof(bin_storage_220::ModelData);
|
||||
|
||||
auto md_220 = reinterpret_cast<bin_storage_220::ModelData*>(malloc(md_size));
|
||||
memset(md_220, 0, md_size);
|
||||
|
||||
uint8_t version;
|
||||
const char* error = loadFileBin(path, (uint8_t *)md_220, md_size, &version);
|
||||
if (!error) {
|
||||
convertModelData_219_to_220((void*)md_220);
|
||||
error = writeFileBin(path, (uint8_t *)md_220, md_size, 220);
|
||||
}
|
||||
|
||||
free(md_220);
|
||||
return error;
|
||||
}
|
||||
#else
|
||||
const char* convertModelData_219_to_220(uint8_t id)
|
||||
{
|
||||
constexpr unsigned md_size = sizeof(bin_storage_220::ModelData);
|
||||
|
||||
auto md_220 = reinterpret_cast<uint8_t*>(malloc(md_size));
|
||||
memset(md_220, 0, md_size);
|
||||
|
||||
uint16_t read = eeLoadModelData(id, md_220, md_size);
|
||||
if (read == md_size) {
|
||||
convertModelData_219_to_220((void*)md_220);
|
||||
eeWriteModelData(id, (uint8_t *)md_220, md_size, true);
|
||||
} else {
|
||||
// ERROR: size mismatch !!!
|
||||
}
|
||||
|
||||
free(md_220);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
void convertRadioData_219_to_220(void* data)
|
||||
{
|
||||
TRACE("Radio conversion from v219 to v220");
|
||||
|
||||
auto& settings = *reinterpret_cast<bin_storage_220::RadioData*>(data);
|
||||
settings.version = 220;
|
||||
settings.variant = EEPROM_VARIANT;
|
||||
|
||||
#if defined(COLORLCD)
|
||||
// Clear CustomScreenData + TopBarPersistentData
|
||||
// as they cannot be converted (missing option types)
|
||||
strcpy(settings.themeName, "EdgeTX");
|
||||
memset(&settings.themeData, 0, sizeof(settings.themeData));
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < NUM_SWITCHES_219; ++i) {
|
||||
char* sw_name = &(settings.switchNames[i][0]);
|
||||
convertToStr(sw_name, LEN_SWITCH_NAME_219);
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_STICKS_219 + NUM_POTS_219 + NUM_SLIDERS_219; ++i) {
|
||||
char* sw_name = &(settings.anaNames[i][0]);
|
||||
convertToStr(sw_name, LEN_ANA_NAME_219);
|
||||
}
|
||||
|
||||
#if defined(PCBHORUS) || defined(PCBNV14)
|
||||
convertToStr(settings.bluetoothName, LEN_BLUETOOTH_NAME_219);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(EEPROM_RLC)
|
||||
const char* convertRadioData_219_to_220(const char* path)
|
||||
{
|
||||
constexpr unsigned rd_size = sizeof(bin_storage_220::RadioData);
|
||||
|
||||
auto rd_220 = reinterpret_cast<bin_storage_220::RadioData*>(malloc(rd_size));
|
||||
memset(rd_220, 0, rd_size);
|
||||
|
||||
uint8_t version;
|
||||
const char* error = loadFileBin(path, (uint8_t *)rd_220, rd_size, &version);
|
||||
if (!error) {
|
||||
convertRadioData_219_to_220((void*)rd_220);
|
||||
error = writeFileBin(path, (uint8_t *)rd_220, rd_size, 220);
|
||||
}
|
||||
|
||||
free(rd_220);
|
||||
return error;
|
||||
}
|
||||
#else
|
||||
const char* convertRadioData_219_to_220()
|
||||
{
|
||||
constexpr unsigned rd_size = sizeof(bin_storage_220::RadioData);
|
||||
auto rd_220 = reinterpret_cast<uint8_t*>(malloc(rd_size));
|
||||
|
||||
uint16_t read = eeLoadGeneralSettingsData(rd_220, rd_size);
|
||||
if (read >= rd_size - 1) { // 220 started with 1 byte less than 219
|
||||
convertRadioData_219_to_220((void*)rd_220);
|
||||
eeWriteGeneralSettingData((uint8_t *)rd_220, rd_size, true);
|
||||
} else {
|
||||
// ERROR: size mismatch !!!
|
||||
}
|
||||
|
||||
free(rd_220);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#include "definitions.h"
|
||||
#include "datastructs_220.h"
|
||||
|
||||
#include "sdcard.h"
|
||||
|
||||
#include <storage/yaml/yaml_node.h>
|
||||
|
||||
using namespace bin_storage_220;
|
||||
#include <storage/sdcard_common.h>
|
||||
|
||||
#if defined(SDCARD_YAML)
|
||||
#include <storage/sdcard_yaml.h>
|
||||
#endif
|
||||
|
||||
// see "yaml/yaml_datastructs.h"
|
||||
namespace yaml_conv_220 {
|
||||
const YamlNode* get_radiodata_nodes();
|
||||
const YamlNode* get_modeldata_nodes();
|
||||
const YamlNode* get_partialmodel_nodes();
|
||||
};
|
||||
|
||||
#if defined(STORAGE_MODELSLIST)
|
||||
|
||||
void patchFilenameToYaml(char* str);
|
||||
|
||||
static const char* convertData_220_to_221(
|
||||
const char* path, unsigned size, const YamlNode* root_node,
|
||||
void (*patchBinary)(uint8_t*) = nullptr)
|
||||
{
|
||||
auto data = reinterpret_cast<uint8_t*>(malloc(size));
|
||||
memset(data, 0, size);
|
||||
|
||||
uint8_t version;
|
||||
|
||||
const char* error = loadFileBin(path, data, size, &version);
|
||||
if (!error) {
|
||||
if (patchBinary) patchBinary(data);
|
||||
|
||||
char output_fname[FF_MAX_LFN+1];
|
||||
strncpy(output_fname, path, FF_MAX_LFN);
|
||||
output_fname[FF_MAX_LFN] = '\0';
|
||||
|
||||
uint16_t file_checksum = 0;
|
||||
YamlFileChecksum(root_node, data, &file_checksum);
|
||||
patchFilenameToYaml(output_fname);
|
||||
error = writeFileYaml(output_fname, root_node, data, file_checksum);
|
||||
}
|
||||
|
||||
free(data);
|
||||
return error;
|
||||
}
|
||||
|
||||
#if defined(COLORLCD)
|
||||
void patchWidgetOptions(ZonePersistentData* zones, unsigned n_zones)
|
||||
{
|
||||
for (unsigned i = 0; i < n_zones; i++) {
|
||||
auto& zone = zones[i];
|
||||
auto name_len = strnlen(zone.widgetName, sizeof(zone.widgetName));
|
||||
std::string widgetName(zone.widgetName, name_len);
|
||||
|
||||
if (widgetName.empty()) continue;
|
||||
|
||||
if (widgetName == "Value") {
|
||||
zone.widgetData.options[0].type = ZOV_Source;
|
||||
zone.widgetData.options[1].type = ZOV_Color;
|
||||
} else if (widgetName == "Gauge") {
|
||||
zone.widgetData.options[0].type = ZOV_Source;
|
||||
zone.widgetData.options[3].type = ZOV_Color;
|
||||
} else if (widgetName == "Outputs") {
|
||||
zone.widgetData.options[2].type = ZOV_Color;
|
||||
zone.widgetData.options[3].type = ZOV_Color;
|
||||
zone.widgetData.options[4].type = ZOV_Color;
|
||||
} else if (widgetName == "Text") {
|
||||
zone.widgetData.options[1].type = ZOV_Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void patchModelData(uint8_t* data)
|
||||
{
|
||||
auto md = reinterpret_cast<bin_storage_220::ModelData*>(data);
|
||||
for (auto& screen : md->screenData) {
|
||||
|
||||
if (!strnlen(screen.LayoutId, sizeof(screen.LayoutId)))
|
||||
break;
|
||||
|
||||
patchWidgetOptions(screen.layoutData.zones, MAX_LAYOUT_ZONES);
|
||||
}
|
||||
|
||||
patchWidgetOptions(md->topbarData.zones, MAX_TOPBAR_ZONES);
|
||||
}
|
||||
#else
|
||||
#define patchModelData nullptr
|
||||
#endif
|
||||
|
||||
const char* convertModelData_220_to_221(const char* path)
|
||||
{
|
||||
constexpr unsigned md_size = sizeof(bin_storage_220::ModelData);
|
||||
return convertData_220_to_221(path, md_size,
|
||||
yaml_conv_220::get_modeldata_nodes(),
|
||||
patchModelData);
|
||||
}
|
||||
|
||||
static void patchRadioData(uint8_t* data)
|
||||
{
|
||||
auto rd = reinterpret_cast<bin_storage_220::RadioData*>(data);
|
||||
rd->version = 221;
|
||||
patchFilenameToYaml(rd->currModelFilename);
|
||||
}
|
||||
|
||||
const char* convertRadioData_220_to_221(const char* path)
|
||||
{
|
||||
constexpr unsigned rd_size = sizeof(bin_storage_220::RadioData);
|
||||
return convertData_220_to_221(path, rd_size,
|
||||
yaml_conv_220::get_radiodata_nodes(),
|
||||
patchRadioData);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <storage/eeprom_common.h>
|
||||
|
||||
|
||||
const char* convertModelData_220_to_221(uint8_t id)
|
||||
{
|
||||
constexpr unsigned size = sizeof(bin_storage_220::ModelData);
|
||||
auto data = reinterpret_cast<uint8_t*>(malloc(size));
|
||||
memset(data, 0, size);
|
||||
|
||||
const char* error = nullptr;
|
||||
uint16_t read = eeLoadModelData(id, data, size);
|
||||
if (read == size) {
|
||||
char model_idx[MODELIDX_STRLEN + sizeof(YAML_EXT)];
|
||||
getModelNumberStr(id, model_idx);
|
||||
GET_FILENAME(path, MODELS_PATH, model_idx, YAML_EXT);
|
||||
error = writeFileYaml(path, yaml_conv_220::get_modeldata_nodes(), data, 0);
|
||||
} else {
|
||||
// ERROR: size mismatch !!!
|
||||
}
|
||||
|
||||
free(data);
|
||||
return error;
|
||||
}
|
||||
|
||||
const char* convertRadioData_220_to_221()
|
||||
{
|
||||
constexpr unsigned size = sizeof(bin_storage_220::RadioData);
|
||||
auto data = reinterpret_cast<uint8_t*>(malloc(size));
|
||||
memset(data, 0, size);
|
||||
|
||||
const char* error = nullptr;
|
||||
uint16_t read = eeLoadGeneralSettingsData(data, size);
|
||||
uint16_t file_checksum = 0;
|
||||
|
||||
YamlFileChecksum(yaml_conv_220::get_radiodata_nodes(), data, &file_checksum);
|
||||
|
||||
if (read == size) {
|
||||
error = writeFileYaml(RADIO_SETTINGS_YAML_PATH,
|
||||
yaml_conv_220::get_radiodata_nodes(), data, file_checksum);
|
||||
} else {
|
||||
// ERROR: size mismatch !!!
|
||||
}
|
||||
|
||||
free(data);
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,598 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OPENTX_DATASTRUCTS_218_H
|
||||
#define OPENTX_DATASTRUCTS_218_H
|
||||
|
||||
#define MAX_TIMERS_218 3
|
||||
#define MAX_GVARS_218 9
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define NUM_SWITCHES_218 8
|
||||
#elif defined(PCBXLITE)
|
||||
#define NUM_SWITCHES_218 4
|
||||
#elif defined(PCBX7)
|
||||
#define NUM_SWITCHES_218 6
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_SWITCHES_218 18 // yes, it's a lot!
|
||||
#else
|
||||
#define NUM_SWITCHES_218 8
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_SWITCH_NAME_218 3
|
||||
#define LEN_ANA_NAME_218 3
|
||||
#define LEN_MODEL_FILENAME_218 16
|
||||
#define LEN_BLUETOOTH_NAME_218 10
|
||||
#else
|
||||
#define LEN_SWITCH_NAME_218 3
|
||||
#define LEN_ANA_NAME_218 3
|
||||
#define LEN_BLUETOOTH_NAME_218 10
|
||||
#endif
|
||||
|
||||
#define LEN_GVAR_NAME_218 3
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_MODEL_NAME_218 15
|
||||
#define LEN_TIMER_NAME_218 8
|
||||
#define LEN_FLIGHT_MODE_NAME_218 10
|
||||
#define LEN_BITMAP_NAME_218 10
|
||||
#define LEN_EXPOMIX_NAME_218 6
|
||||
#define LEN_CHANNEL_NAME_218 6
|
||||
#define LEN_INPUT_NAME_218 4
|
||||
#define LEN_CURVE_NAME_218 3
|
||||
#define LEN_FUNCTION_NAME_218 6
|
||||
#define MAX_CURVES_218 32
|
||||
#define MAX_CURVE_POINTS_218 512
|
||||
#elif LCD_W == 212
|
||||
#define LEN_MODEL_NAME_218 12
|
||||
#define LEN_TIMER_NAME_218 8
|
||||
#define LEN_FLIGHT_MODE_NAME_218 10
|
||||
#define LEN_BITMAP_NAME_218 10
|
||||
#define LEN_EXPOMIX_NAME_218 8
|
||||
#define LEN_CHANNEL_NAME_218 6
|
||||
#define LEN_INPUT_NAME_218 4
|
||||
#define LEN_CURVE_NAME_218 3
|
||||
#define LEN_FUNCTION_NAME_218 8
|
||||
#define MAX_CURVES_218 32
|
||||
#define MAX_CURVE_POINTS_218 512
|
||||
#else
|
||||
#define LEN_MODEL_NAME_218 10
|
||||
#define LEN_TIMER_NAME_218 3
|
||||
#define LEN_FLIGHT_MODE_NAME_218 6
|
||||
#define LEN_EXPOMIX_NAME_218 6
|
||||
#define LEN_CHANNEL_NAME_218 4
|
||||
#define LEN_INPUT_NAME_218 3
|
||||
#define LEN_CURVE_NAME_218 3
|
||||
#define LEN_FUNCTION_NAME_218 6
|
||||
#define MAX_CURVES_218 16
|
||||
#define MAX_CURVE_POINTS_218 512
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define MAX_MODELS_218 60
|
||||
#define MAX_OUTPUT_CHANNELS_218 32 // number of real output channels CH1-CH32
|
||||
#define MAX_FLIGHT_MODES_218 9
|
||||
#define MAX_MIXERS_218 64
|
||||
#define MAX_EXPOS_218 64
|
||||
#define MAX_LOGICAL_SWITCHES_218 64
|
||||
#define MAX_SPECIAL_FUNCTIONS_218 64 // number of functions assigned to switches
|
||||
#define MAX_SCRIPTS_218 9
|
||||
#define MAX_INPUTS_218 32
|
||||
#define MAX_TRAINER_CHANNELS_218 16
|
||||
#define MAX_TELEMETRY_SENSORS_218 32
|
||||
#define MAX_CUSTOM_SCREENS_218 5
|
||||
#elif defined(PCBTARANIS)
|
||||
#define MAX_MODELS_218 60
|
||||
#define MAX_OUTPUT_CHANNELS_218 32 // number of real output channels CH1-CH32
|
||||
#define MAX_FLIGHT_MODES_218 9
|
||||
#define MAX_MIXERS_218 64
|
||||
#define MAX_EXPOS_218 64
|
||||
#define MAX_LOGICAL_SWITCHES_218 64
|
||||
#define MAX_SPECIAL_FUNCTIONS_218 64 // number of functions assigned to switches
|
||||
#define MAX_SCRIPTS_218 7
|
||||
#define MAX_INPUTS_218 32
|
||||
#define MAX_TRAINER_CHANNELS_218 16
|
||||
#define MAX_TELEMETRY_SENSORS_218 32
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
typedef uint32_t swarnstate218_t;
|
||||
#elif defined(PCBX9E)
|
||||
typedef uint64_t swconfig218_t;
|
||||
typedef uint64_t swarnstate218_t;
|
||||
typedef uint32_t swarnenable218_t;
|
||||
#elif defined(PCBTARANIS)
|
||||
typedef uint16_t swconfig218_t;
|
||||
typedef uint16_t swarnstate218_t;
|
||||
typedef uint8_t swarnenable218_t;
|
||||
#else
|
||||
typedef uint8_t swarnstate218_t;
|
||||
typedef uint8_t swarnenable218_t;
|
||||
#endif
|
||||
|
||||
PACK(typedef struct {
|
||||
uint8_t type:4;
|
||||
int8_t rfProtocol:4;
|
||||
uint8_t channelsStart;
|
||||
int8_t channelsCount; // 0=8 channels
|
||||
uint8_t failsafeMode:4; // only 3 bits used
|
||||
uint8_t subType:3;
|
||||
uint8_t invertedSerial:1; // telemetry serial inverted from standard
|
||||
int16_t failsafeChannels[MAX_OUTPUT_CHANNELS_218];
|
||||
union {
|
||||
struct {
|
||||
int8_t delay:6;
|
||||
uint8_t pulsePol:1;
|
||||
uint8_t outputType:1; // false = open drain, true = push pull
|
||||
int8_t frameLength;
|
||||
} ppm;
|
||||
struct {
|
||||
uint8_t rfProtocolExtra:2;
|
||||
uint8_t spare1:3;
|
||||
uint8_t customProto:1;
|
||||
uint8_t autoBindMode:1;
|
||||
uint8_t lowPowerMode:1;
|
||||
int8_t optionValue;
|
||||
} multi;
|
||||
struct {
|
||||
uint8_t power:2; // 0=10 mW, 1=100 mW, 2=500 mW, 3=1W
|
||||
uint8_t spare1:2;
|
||||
uint8_t receiverTelemetryOff:1; // false = receiver telem enabled
|
||||
uint8_t receiverHigherChannels:1; // false = pwm out 1-8, true 9-16
|
||||
uint8_t external_antenna:1; // false = internal antenna, true = external antenna
|
||||
uint8_t fast:1;
|
||||
uint8_t spare2;
|
||||
} pxx;
|
||||
struct {
|
||||
uint8_t spare1:6;
|
||||
uint8_t noninverted:1;
|
||||
uint8_t spare2:1;
|
||||
int8_t refreshRate; // definition as framelength for ppm (* 5 + 225 = time in 1/10 ms)
|
||||
} sbus;
|
||||
};
|
||||
}) ModuleData_v218;
|
||||
|
||||
PACK(typedef struct {
|
||||
int32_t mode:9; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint32_t start:23;
|
||||
int32_t value:24;
|
||||
uint32_t countdownBeep:2;
|
||||
uint32_t minuteBeep:1;
|
||||
uint32_t persistent:2;
|
||||
int32_t countdownStart:2;
|
||||
uint32_t direction:1;
|
||||
char name[LEN_TIMER_NAME_218];
|
||||
}) TimerData_v218;
|
||||
|
||||
#define ROTENC_DATA
|
||||
|
||||
PACK(typedef struct {
|
||||
trim_t trim[NUM_TRIMS];
|
||||
char name[LEN_FLIGHT_MODE_NAME_218];
|
||||
int16_t swtch:9; // swtch of phase[0] is not used
|
||||
int16_t spare:7;
|
||||
uint8_t fadeIn;
|
||||
uint8_t fadeOut;
|
||||
ROTENC_DATA
|
||||
gvar_t gvars[MAX_GVARS_218];
|
||||
}) FlightModeData_v218;
|
||||
|
||||
PACK(typedef struct {
|
||||
int16_t weight:11; // GV1=-1024, -GV1=1023
|
||||
uint16_t destCh:5;
|
||||
uint16_t srcRaw:10; // srcRaw=0 means not used
|
||||
uint16_t carryTrim:1;
|
||||
uint16_t mixWarn:2; // mixer warning
|
||||
uint16_t mltpx:2; // multiplex method: 0 means +=, 1 means *=, 2 means :=
|
||||
uint16_t spare:1;
|
||||
int32_t offset:14;
|
||||
int32_t swtch:9;
|
||||
uint32_t flightModes:9;
|
||||
CurveRef curve;
|
||||
uint8_t delayUp;
|
||||
uint8_t delayDown;
|
||||
uint8_t speedUp;
|
||||
uint8_t speedDown;
|
||||
char name[LEN_EXPOMIX_NAME_218];
|
||||
}) MixData_v218;
|
||||
|
||||
PACK(typedef struct {
|
||||
uint16_t mode:2;
|
||||
uint16_t scale:14;
|
||||
uint16_t srcRaw:10;
|
||||
int16_t carryTrim:6;
|
||||
uint32_t chn:5;
|
||||
int32_t swtch:9;
|
||||
uint32_t flightModes:9;
|
||||
int32_t weight:8;
|
||||
int32_t spare:1;
|
||||
char name[LEN_EXPOMIX_NAME_218];
|
||||
int8_t offset;
|
||||
CurveRef curve;
|
||||
}) ExpoData_v218;
|
||||
|
||||
PACK(typedef struct {
|
||||
uint8_t type:1;
|
||||
uint8_t smooth:1;
|
||||
int8_t points:6; // describes number of points - 5
|
||||
char name[LEN_CURVE_NAME_218];
|
||||
}) CurveHeader_v218;
|
||||
|
||||
PACK(typedef struct {
|
||||
int16_t calib[4];
|
||||
TrainerMix mix[4];
|
||||
}) TrainerData_v218;
|
||||
|
||||
PACK(typedef struct { // Logical Switches data
|
||||
uint8_t func;
|
||||
int32_t v1:10;
|
||||
int32_t v3:10;
|
||||
int32_t andsw:9;
|
||||
uint32_t andswtype:1;
|
||||
uint32_t spare:2;
|
||||
int16_t v2;
|
||||
uint8_t delay;
|
||||
uint8_t duration;
|
||||
}) LogicalSwitchData_v218;
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#define CFN_SPARE_TYPE int32_t
|
||||
#else
|
||||
#define CFN_SPARE_TYPE int16_t
|
||||
#endif
|
||||
|
||||
PACK(typedef struct {
|
||||
int16_t swtch:9;
|
||||
uint16_t func:7;
|
||||
PACK(union {
|
||||
PACK(struct {
|
||||
char name[LEN_FUNCTION_NAME_218];
|
||||
}) play;
|
||||
|
||||
PACK(struct {
|
||||
int16_t val;
|
||||
uint8_t mode;
|
||||
uint8_t param;
|
||||
CFN_SPARE_TYPE spare2;
|
||||
}) all;
|
||||
|
||||
PACK(struct {
|
||||
int32_t val1;
|
||||
CFN_SPARE_TYPE val2;
|
||||
}) clear;
|
||||
});
|
||||
uint8_t active;
|
||||
}) CustomFunctionData_v218;
|
||||
|
||||
PACK(struct GVarData_v218 {
|
||||
char name[LEN_GVAR_NAME_218];
|
||||
uint32_t min:12;
|
||||
uint32_t max:12;
|
||||
uint32_t popup:1;
|
||||
uint32_t prec:1;
|
||||
uint32_t unit:2;
|
||||
uint32_t spare:4;
|
||||
});
|
||||
|
||||
#if defined(COLORLCD)
|
||||
PACK(struct FrSkyTelemetryData_v217 {
|
||||
uint8_t varioSource:7;
|
||||
uint8_t varioCenterSilent:1;
|
||||
int8_t varioCenterMax;
|
||||
int8_t varioCenterMin;
|
||||
int8_t varioMin;
|
||||
int8_t varioMax;
|
||||
});
|
||||
#else
|
||||
union FrSkyScreenData {
|
||||
FrSkyBarData bars[4];
|
||||
FrSkyLineData lines[4];
|
||||
#if defined(PCBTARANIS)
|
||||
TelemetryScriptData script;
|
||||
#endif
|
||||
};
|
||||
PACK(struct FrSkyTelemetryData_v217 {
|
||||
uint8_t voltsSource;
|
||||
uint8_t altitudeSource;
|
||||
uint8_t screensType; // 2bits per screen (None/Gauges/Numbers/Script)
|
||||
FrSkyScreenData screens[MAX_TELEMETRY_SCREENS];
|
||||
uint8_t varioSource:7;
|
||||
uint8_t varioCenterSilent:1;
|
||||
int8_t varioCenterMax;
|
||||
int8_t varioCenterMin;
|
||||
int8_t varioMin;
|
||||
int8_t varioMax;
|
||||
});
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define MODELDATA_EXTRA_218 uint8_t spare:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData_v218 moduleData[NUM_MODULES+1]; ScriptData scriptsData[MAX_SCRIPTS_218]; char inputNames[MAX_INPUTS_218][LEN_INPUT_NAME_218]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[3 + 4];
|
||||
#elif defined(PCBTARANIS)
|
||||
#define MODELDATA_EXTRA_218 uint8_t spare:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData_v218 moduleData[NUM_MODULES+1]; ScriptData scriptsData[MAX_SCRIPTS_218]; char inputNames[MAX_INPUTS_218][LEN_INPUT_NAME_218]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[STORAGE_NUM_POTS + STORAGE_NUM_SLIDERS];
|
||||
#endif
|
||||
|
||||
PACK(struct TelemetrySensor_218 {
|
||||
union {
|
||||
uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type.
|
||||
uint16_t persistentValue;
|
||||
};
|
||||
union {
|
||||
PACK(struct {
|
||||
uint8_t physID:5;
|
||||
uint8_t rxIndex:3; // 1 bit for module index, 2 bits for receiver index
|
||||
}) frskyInstance;
|
||||
uint8_t instance;
|
||||
uint8_t formula;
|
||||
};
|
||||
char label[TELEM_LABEL_LEN]; // user defined label
|
||||
uint8_t type:1; // 0=custom / 1=calculated
|
||||
uint8_t unit:5; // user can choose what unit to display each value in
|
||||
uint8_t prec:2;
|
||||
uint8_t autoOffset:1;
|
||||
uint8_t filter:1;
|
||||
uint8_t logs:1;
|
||||
uint8_t persistent:1;
|
||||
uint8_t onlyPositive:1;
|
||||
uint8_t subId:3;
|
||||
union {
|
||||
PACK(struct {
|
||||
uint16_t ratio;
|
||||
int16_t offset;
|
||||
}) custom;
|
||||
PACK(struct {
|
||||
uint8_t source;
|
||||
uint8_t index;
|
||||
uint16_t spare;
|
||||
}) cell;
|
||||
PACK(struct {
|
||||
int8_t sources[4];
|
||||
}) calc;
|
||||
PACK(struct {
|
||||
uint8_t source;
|
||||
uint8_t spare[3];
|
||||
}) consumption;
|
||||
PACK(struct {
|
||||
uint8_t gps;
|
||||
uint8_t alt;
|
||||
uint16_t spare;
|
||||
}) dist;
|
||||
uint32_t param;
|
||||
};
|
||||
});
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
PACK(struct CustomScreenData_v218 {
|
||||
char LayoutId[10];
|
||||
LayoutPersistentData layoutData;
|
||||
});
|
||||
#define VIEW_DATA \
|
||||
CustomScreenData screenData[MAX_CUSTOM_SCREENS]; \
|
||||
TopBarPersistentData topbarData; \
|
||||
uint8_t view;
|
||||
#elif defined(PCBTARANIS)
|
||||
#define VIEW_DATA uint8_t view;
|
||||
#else
|
||||
#define VIEW_DATA
|
||||
#endif
|
||||
|
||||
#if LEN_BITMAP_NAME > 0
|
||||
#define MODEL_HEADER_BITMAP_FIELD_218 char bitmap[10];
|
||||
#else
|
||||
#define MODEL_HEADER_BITMAP_FIELD_218
|
||||
#endif
|
||||
|
||||
PACK(struct ModelHeader_v218 {
|
||||
char name[LEN_MODEL_NAME]; // must be first for eeLoadModelName
|
||||
uint8_t modelId[NUM_MODULES];
|
||||
MODEL_HEADER_BITMAP_FIELD_218
|
||||
});
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#define SWITCH_WARNING_DATA_218
|
||||
#else
|
||||
#define SWITCH_WARNING_DATA_218 swarnenable218_t switchWarningEnable;
|
||||
#endif
|
||||
|
||||
PACK(struct ModelData_v218 {
|
||||
ModelHeader_v218 header;
|
||||
TimerData_v218 timers[MAX_TIMERS_218];
|
||||
uint8_t telemetryProtocol:3;
|
||||
uint8_t thrTrim:1; // Enable Throttle Trim
|
||||
uint8_t noGlobalFunctions:1;
|
||||
uint8_t displayTrims:2;
|
||||
uint8_t ignoreSensorIds:1;
|
||||
int8_t trimInc:3; // Trim Increments
|
||||
uint8_t disableThrottleWarning:1;
|
||||
uint8_t displayChecklist:1;
|
||||
uint8_t extendedLimits:1;
|
||||
uint8_t extendedTrims:1;
|
||||
uint8_t throttleReversed:1;
|
||||
BeepANACenter beepANACenter;
|
||||
MixData_v218 mixData[MAX_MIXERS_218];
|
||||
LimitData limitData[MAX_OUTPUT_CHANNELS_218];
|
||||
ExpoData_v218 expoData[MAX_EXPOS_218];
|
||||
|
||||
CurveHeader_v218 curves[MAX_CURVES_218];
|
||||
int8_t points[MAX_CURVE_POINTS_218];
|
||||
|
||||
LogicalSwitchData_v218 logicalSw[MAX_LOGICAL_SWITCHES_218];
|
||||
CustomFunctionData_v218 customFn[MAX_SPECIAL_FUNCTIONS_218];
|
||||
SwashRingData swashR;
|
||||
FlightModeData_v218 flightModeData[MAX_FLIGHT_MODES_218];
|
||||
|
||||
uint8_t thrTraceSrc;
|
||||
|
||||
swarnstate218_t switchWarningState;
|
||||
|
||||
SWITCH_WARNING_DATA_218
|
||||
|
||||
GVarData_v218 gvars[MAX_GVARS_218];
|
||||
|
||||
FrSkyTelemetryData_v217 frsky;
|
||||
RssiAlarmData rssiAlarms;
|
||||
|
||||
MODELDATA_EXTRA_218
|
||||
|
||||
TelemetrySensor_218 telemetrySensors[MAX_TELEMETRY_SENSORS_218];
|
||||
|
||||
TARANIS_PCBX9E_FIELD(uint8_t toplcdTimer)
|
||||
|
||||
// TODO conversion for custom screens?
|
||||
VIEW_DATA
|
||||
});
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define EXTRA_GENERAL_FIELDS_218 \
|
||||
uint8_t auxSerialMode:4; \
|
||||
uint8_t slidersConfig:4; \
|
||||
uint32_t switchConfig; \
|
||||
uint8_t potsConfig; /* two bits per pot */ \
|
||||
char switchNames[NUM_SWITCHES_218][LEN_SWITCH_NAME_218]; \
|
||||
char anaNames[NUM_STICKS+3+4][LEN_ANA_NAME_218]; \
|
||||
char currModelFilename[LEN_MODEL_FILENAME_218+1]; \
|
||||
uint8_t spare:1; \
|
||||
uint8_t blOffBright:7; \
|
||||
char bluetoothName[LEN_BLUETOOTH_NAME_218];
|
||||
#elif defined(PCBTARANIS)
|
||||
#if defined(STORAGE_BLUETOOTH) && !defined(PCBX9D) && !defined(PCBX9DP)
|
||||
#define BLUETOOTH_FIELDS_218 \
|
||||
uint8_t spare; \
|
||||
char bluetoothName[LEN_BLUETOOTH_NAME_218];
|
||||
#else
|
||||
#define BLUETOOTH_FIELDS_218
|
||||
#endif
|
||||
#define EXTRA_GENERAL_FIELDS_218 \
|
||||
uint8_t auxSerialMode:4; \
|
||||
uint8_t slidersConfig:4; \
|
||||
uint8_t potsConfig; /* two bits per pot */\
|
||||
uint8_t backlightColor; \
|
||||
swarnstate218_t switchUnlockStates; \
|
||||
swconfig218_t switchConfig; \
|
||||
char switchNames[NUM_SWITCHES_218][LEN_SWITCH_NAME_218]; \
|
||||
char anaNames[NUM_STICKS+STORAGE_NUM_POTS+STORAGE_NUM_SLIDERS][LEN_ANA_NAME_218]; \
|
||||
BLUETOOTH_FIELDS_218
|
||||
#else
|
||||
#define EXTRA_GENERAL_FIELDS_218 EXTRA_GENERAL_FIELDS_GENERAL_218
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#include "gui/colorlcd/theme.h"
|
||||
#define THEME_NAME_LEN 8
|
||||
#define THEME_DATA \
|
||||
char themeName[THEME_NAME_LEN]; \
|
||||
OpenTxTheme::PersistentData themeData;
|
||||
#else
|
||||
#define THEME_DATA
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define NUM_CALIBRATION_INPUTS 13
|
||||
#else
|
||||
#define NUM_CALIBRATION_INPUTS (NUM_STICKS+STORAGE_NUM_POTS+STORAGE_NUM_SLIDERS)
|
||||
#endif
|
||||
|
||||
PACK(struct RadioData_v218 {
|
||||
uint8_t version;
|
||||
uint16_t variant;
|
||||
CalibData calib[NUM_CALIBRATION_INPUTS];
|
||||
uint16_t chkSum;
|
||||
N_HORUS_FIELD(int8_t currModel);
|
||||
N_HORUS_FIELD(uint8_t contrast);
|
||||
uint8_t vBatWarn;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t backlightMode;
|
||||
TrainerData_v218 trainer;
|
||||
uint8_t view; // index of view in main screen
|
||||
int8_t buzzerMode:2;
|
||||
uint8_t fai:1;
|
||||
int8_t beepMode:2; // -2=quiet, -1=only alarms, 0=no keys, 1=all
|
||||
uint8_t alarmsFlash:1;
|
||||
uint8_t disableMemoryWarning:1;
|
||||
uint8_t disableAlarmWarning:1;
|
||||
uint8_t stickMode:2;
|
||||
int8_t timezone:5;
|
||||
uint8_t adjustRTC:1;
|
||||
uint8_t inactivityTimer;
|
||||
uint8_t telemetryBaudrate:3;
|
||||
int8_t splashMode:3;
|
||||
int8_t hapticMode:2;
|
||||
int8_t switchesDelay;
|
||||
uint8_t lightAutoOff;
|
||||
uint8_t templateSetup; // RETA order for receiver channels
|
||||
int8_t PPM_Multiplier;
|
||||
int8_t hapticLength;
|
||||
N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t reNavigation));
|
||||
N_HORUS_FIELD(N_TARANIS_FIELD(uint8_t stickReverse));
|
||||
int8_t beepLength:3;
|
||||
int8_t hapticStrength:3;
|
||||
uint8_t gpsFormat:1;
|
||||
uint8_t unexpectedShutdown:1;
|
||||
uint8_t speakerPitch;
|
||||
int8_t speakerVolume;
|
||||
int8_t vBatMin;
|
||||
int8_t vBatMax;
|
||||
|
||||
uint8_t backlightBright;
|
||||
uint32_t globalTimer;
|
||||
uint8_t bluetoothBaudrate:4;
|
||||
uint8_t bluetoothMode:4;
|
||||
uint8_t countryCode;
|
||||
uint8_t imperial:1;
|
||||
uint8_t noJitterFilter:1; /* 0 - Jitter filter active */
|
||||
uint8_t disableRssiPoweroffAlarm:1;
|
||||
uint8_t USBMode:2;
|
||||
uint8_t spareExtraArm:3;
|
||||
char ttsLanguage[2];
|
||||
int8_t beepVolume:4;
|
||||
int8_t wavVolume:4;
|
||||
int8_t varioVolume:4;
|
||||
int8_t backgroundVolume:4;
|
||||
int8_t varioPitch;
|
||||
int8_t varioRange;
|
||||
int8_t varioRepeat;
|
||||
CustomFunctionData_v218 customFn[MAX_SPECIAL_FUNCTIONS_218];
|
||||
|
||||
EXTRA_GENERAL_FIELDS_218
|
||||
|
||||
THEME_DATA
|
||||
});
|
||||
|
||||
#include "chksize.h"
|
||||
|
||||
#define CHKSIZE(x, y) check_size<struct x, y>()
|
||||
|
||||
static inline void check_struct_218()
|
||||
{
|
||||
#if defined(PCBHORUS)
|
||||
// FIXME !!!
|
||||
CHKSIZE(ModelData_v218, 10664);
|
||||
#elif defined(PCBX9E)
|
||||
CHKSIZE(ModelData_v218, 6520);
|
||||
#elif defined(PCBX9D)
|
||||
CHKSIZE(RadioData_v218, 872);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#undef CHKSIZE
|
||||
|
||||
#endif //OPENTX_DATASTRUCTS_218_H
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MAX_TIMERS_219 3
|
||||
#define MAX_GVARS_219 9
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define NUM_SWITCHES_219 10
|
||||
#elif defined(PCBXLITE) ||defined(PCBXLITES)
|
||||
#define NUM_SWITCHES_219 6
|
||||
#elif defined(RADIO_TLITE) || defined(RADIO_FAMILY_JUMPER_T12) || defined(RADIO_T8) || defined(PCBNV14)
|
||||
#define NUM_SWITCHES_219 8
|
||||
#elif defined(PCBX7) || defined(PCBX7ACCESS)
|
||||
#define NUM_SWITCHES_219 8
|
||||
#elif defined(PCBX9LITES)
|
||||
#define NUM_SWITCHES_219 7
|
||||
#elif defined(PCBX9LITE)
|
||||
#define NUM_SWITCHES_219 5
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_SWITCHES_219 18
|
||||
#elif defined(RADIO_X9DP2019) || defined(PCBX9D) || defined(PCBX9DP)
|
||||
#define NUM_SWITCHES_219 9
|
||||
#else
|
||||
#error "Unsupported Conversion for Radio"
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define NUM_POTS_219 5
|
||||
#define NUM_SLIDERS_219 4
|
||||
#elif defined(PCBX9LITE)
|
||||
#define NUM_POTS_219 1
|
||||
#define NUM_SLIDERS_219 0
|
||||
#elif defined(RADIO_T8) || defined(RADIO_TLITE) || defined(PCBXLITE) || defined(PCBX7) || defined(PCBNV14)
|
||||
#define NUM_POTS_219 2
|
||||
#define NUM_SLIDERS_219 0
|
||||
#elif defined(PCBX9E)
|
||||
#define NUM_POTS_219 4
|
||||
#define NUM_SLIDERS_219 4
|
||||
#else
|
||||
#define NUM_POTS_219 3
|
||||
#define NUM_SLIDERS_219 2
|
||||
#endif
|
||||
|
||||
#define NUM_STICKS_219 4
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_SWITCH_NAME_219 3
|
||||
#define LEN_ANA_NAME_219 3
|
||||
#define LEN_MODEL_FILENAME_219 16
|
||||
#define LEN_BLUETOOTH_NAME_219 10
|
||||
#else
|
||||
#define LEN_SWITCH_NAME_219 3
|
||||
#define LEN_ANA_NAME_219 3
|
||||
#define LEN_BLUETOOTH_NAME_219 10
|
||||
#endif
|
||||
|
||||
#define LEN_GVAR_NAME_219 3
|
||||
#define TELEM_LABEL_LEN_219 4
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_MODEL_NAME_219 15
|
||||
#define LEN_TIMER_NAME_219 8
|
||||
#define LEN_FLIGHT_MODE_NAME_219 10
|
||||
#define LEN_BITMAP_NAME_219 14
|
||||
#define LEN_EXPOMIX_NAME_219 6
|
||||
#define LEN_CHANNEL_NAME_219 6
|
||||
#define LEN_INPUT_NAME_219 4
|
||||
#define LEN_CURVE_NAME_219 3
|
||||
#define LEN_FUNCTION_NAME_219 6
|
||||
#define MAX_CURVES_219 32
|
||||
#define MAX_CURVE_POINTS_219 512
|
||||
#elif LCD_W == 212
|
||||
#define LEN_MODEL_NAME_219 12
|
||||
#define LEN_TIMER_NAME_219 8
|
||||
#define LEN_FLIGHT_MODE_NAME_219 10
|
||||
#define LEN_BITMAP_NAME_219 10
|
||||
#define LEN_EXPOMIX_NAME_219 6
|
||||
#define LEN_CHANNEL_NAME_219 6
|
||||
#define LEN_INPUT_NAME_219 4
|
||||
#define LEN_CURVE_NAME_219 3
|
||||
#define LEN_FUNCTION_NAME_219 8
|
||||
#define MAX_CURVES_219 32
|
||||
#define MAX_CURVE_POINTS_219 512
|
||||
#else
|
||||
#define LEN_MODEL_NAME_219 10
|
||||
#define LEN_TIMER_NAME_219 3
|
||||
#define LEN_FLIGHT_MODE_NAME_219 6
|
||||
#define LEN_EXPOMIX_NAME_219 6
|
||||
#define LEN_CHANNEL_NAME_219 4
|
||||
#define LEN_INPUT_NAME_219 3
|
||||
#define LEN_CURVE_NAME_219 3
|
||||
#define LEN_FUNCTION_NAME_219 6
|
||||
#define MAX_CURVES_219 32
|
||||
#define MAX_CURVE_POINTS_219 512
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS) || defined(PCBNV14)
|
||||
#define MAX_MODELS_219 60
|
||||
#define MAX_OUTPUT_CHANNELS_219 32 // number of real output channels CH1-CH32
|
||||
#define MAX_FLIGHT_MODES_219 9
|
||||
#define MAX_MIXERS_219 64
|
||||
#define MAX_EXPOS_219 64
|
||||
#define MAX_LOGICAL_SWITCHES_219 64
|
||||
#define MAX_SPECIAL_FUNCTIONS_219 64 // number of functions assigned to switches
|
||||
#define MAX_SCRIPTS_219 9
|
||||
#define MAX_INPUTS_219 32
|
||||
#define MAX_TRAINER_CHANNELS_219 16
|
||||
#define MAX_TELEMETRY_SENSORS_219 60
|
||||
#define MAX_CUSTOM_SCREENS_219 5
|
||||
#elif defined(PCBTARANIS)
|
||||
#define MAX_MODELS_219 60
|
||||
#define MAX_OUTPUT_CHANNELS_219 32 // number of real output channels CH1-CH32
|
||||
#define MAX_FLIGHT_MODES_219 9
|
||||
#define MAX_MIXERS_219 64
|
||||
#define MAX_EXPOS_219 64
|
||||
#define MAX_LOGICAL_SWITCHES_219 64
|
||||
#define MAX_SPECIAL_FUNCTIONS_219 64 // number of functions assigned to switches
|
||||
#define MAX_SCRIPTS_219 7
|
||||
#define MAX_INPUTS_219 32
|
||||
#define MAX_TRAINER_CHANNELS_219 16
|
||||
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E)
|
||||
#define MAX_TELEMETRY_SENSORS_219 60
|
||||
#else
|
||||
#define MAX_TELEMETRY_SENSORS_219 40
|
||||
#endif
|
||||
#endif
|
||||
|
||||
PACK(typedef struct {
|
||||
int32_t mode:9; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
uint32_t start:23;
|
||||
int32_t value:24;
|
||||
uint32_t countdownBeep:2;
|
||||
uint32_t minuteBeep:1;
|
||||
uint32_t persistent:2;
|
||||
int32_t countdownStart:2;
|
||||
uint32_t direction:1;
|
||||
char name[LEN_TIMER_NAME_219];
|
||||
}) TimerData_v219;
|
||||
|
||||
// #include "chksize.h"
|
||||
|
||||
// #define CHKSIZE(x, y) check_size<struct x, y>()
|
||||
|
||||
// static inline void check_struct_219()
|
||||
// {
|
||||
// #if defined(PCBHORUS)
|
||||
// CHKSIZE(ModelData_v219, 10664);
|
||||
// #elif defined(PCBX9E)
|
||||
// CHKSIZE(ModelData_v219, 6520);
|
||||
// #elif defined(PCBX9D)
|
||||
// CHKSIZE(RadioData_v219, 872);
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// #undef CHKSIZE
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace bin_storage_220 {
|
||||
|
||||
#include "yaml/dataconstants_220.h"
|
||||
#include "yaml/datastructs_220.h"
|
||||
#include "yaml/myeeprom_220.h"
|
||||
|
||||
};
|
||||
|
||||
// prevent board.h from being included
|
||||
#define _BOARD_H_
|
||||
@@ -1,2 +0,0 @@
|
||||
set(SRC ${SRC}
|
||||
storage/conversions/yaml/yaml_datastructs.cpp)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MAX_LAYOUT_ZONES 10
|
||||
#define MAX_LAYOUT_OPTIONS 10
|
||||
|
||||
#if defined(PCBNV14)
|
||||
#define MAX_TOPBAR_ZONES 2
|
||||
#else
|
||||
#define MAX_TOPBAR_ZONES 4
|
||||
#endif
|
||||
|
||||
#define WIDGET_NAME_LEN 10
|
||||
#define MAX_WIDGET_OPTIONS 5
|
||||
#define MAX_TOPBAR_OPTIONS 1
|
||||
#define LAYOUT_ID_LEN 10
|
||||
|
||||
#include "zone_220.h"
|
||||
|
||||
struct WidgetPersistentData {
|
||||
ZoneOptionValueTyped options[MAX_WIDGET_OPTIONS];
|
||||
};
|
||||
|
||||
struct ZonePersistentData {
|
||||
char widgetName[WIDGET_NAME_LEN];
|
||||
WidgetPersistentData widgetData;
|
||||
};
|
||||
|
||||
struct LayoutPersistentData {
|
||||
ZonePersistentData zones[MAX_LAYOUT_ZONES];
|
||||
ZoneOptionValueTyped options[MAX_LAYOUT_OPTIONS];
|
||||
};
|
||||
|
||||
struct TopBarPersistentData {
|
||||
ZonePersistentData zones[MAX_TOPBAR_ZONES];
|
||||
ZoneOptionValueTyped options[MAX_TOPBAR_OPTIONS];
|
||||
};
|
||||
@@ -1,275 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#if defined(_MYEEPROM_H_)
|
||||
#error "This file MUST NOT be included side-by-side with myeeprom.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(SDCARD_YAML)
|
||||
#define EEPROM_VER 221
|
||||
#else
|
||||
#define EEPROM_VER 220
|
||||
#endif
|
||||
#define FIRST_CONV_EEPROM_VER 219
|
||||
|
||||
#define GET_MODULE_PPM_POLARITY(idx) g_model.moduleData[idx].ppm.pulsePol
|
||||
#define GET_TRAINER_PPM_POLARITY() g_model.trainerData.pulsePol
|
||||
#define GET_SBUS_POLARITY(idx) g_model.moduleData[idx].sbus.noninverted
|
||||
#define GET_MODULE_PPM_DELAY(idx) (g_model.moduleData[idx].ppm.delay * 50 + 300)
|
||||
#define GET_TRAINER_PPM_DELAY() (g_model.trainerData.delay * 50 + 300)
|
||||
|
||||
#if defined(HARDWARE_TRAINER_EXTERNAL_MODULE)
|
||||
#define IS_TRAINER_EXTERNAL_MODULE() (g_model.trainerData.mode == TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE || g_model.trainerData.mode == TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE)
|
||||
#else
|
||||
#define IS_TRAINER_EXTERNAL_MODULE() false
|
||||
#endif
|
||||
|
||||
#define IS_TRAINER_AUX_SERIAL() (g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER)
|
||||
|
||||
#define IS_PLAY_FUNC(func) ((func) >= FUNC_PLAY_SOUND && func <= FUNC_PLAY_VALUE)
|
||||
|
||||
#if defined(GVARS)
|
||||
#define IS_ADJUST_GV_FUNC(func) ((func) == FUNC_ADJUST_GVAR)
|
||||
#else
|
||||
#define IS_ADJUST_GV_FUNC(func) (0)
|
||||
#endif
|
||||
|
||||
#if defined(HAPTIC)
|
||||
#define IS_HAPTIC_FUNC(func) ((func) == FUNC_HAPTIC)
|
||||
#else
|
||||
#define IS_HAPTIC_FUNC(func) (0)
|
||||
#endif
|
||||
|
||||
#define HAS_ENABLE_PARAM(func) ((func) < FUNC_FIRST_WITHOUT_ENABLE || (func == FUNC_BACKLIGHT))
|
||||
#define HAS_REPEAT_PARAM(func) (IS_PLAY_FUNC(func) || IS_HAPTIC_FUNC(func))
|
||||
|
||||
#define CFN_EMPTY(p) (!(p)->swtch)
|
||||
#define CFN_SWITCH(p) ((p)->swtch)
|
||||
#define CFN_FUNC(p) ((p)->func)
|
||||
#define CFN_ACTIVE(p) ((p)->active)
|
||||
#define CFN_CH_INDEX(p) ((p)->all.param)
|
||||
#define CFN_GVAR_INDEX(p) ((p)->all.param)
|
||||
#define CFN_TIMER_INDEX(p) ((p)->all.param)
|
||||
#define CFN_PLAY_REPEAT(p) ((p)->active)
|
||||
#define CFN_PLAY_REPEAT_MUL 1
|
||||
#define CFN_PLAY_REPEAT_NOSTART 0xFF
|
||||
#define CFN_GVAR_MODE(p) ((p)->all.mode)
|
||||
#define CFN_PARAM(p) ((p)->all.val)
|
||||
#define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0)
|
||||
#define CFN_GVAR_CST_MIN -GVAR_MAX
|
||||
#define CFN_GVAR_CST_MAX GVAR_MAX
|
||||
#define MODEL_GVAR_MIN(idx) (CFN_GVAR_CST_MIN + g_model.gvars[idx].min)
|
||||
#define MODEL_GVAR_MAX(idx) (CFN_GVAR_CST_MAX - g_model.gvars[idx].max)
|
||||
|
||||
#if defined(PCBFRSKY) || defined(PCBNV14)
|
||||
#define SWITCH_CONFIG(x) (bfGet<swconfig_t>(g_eeGeneral.switchConfig, 2*(x), 2))
|
||||
#define SWITCH_EXISTS(x) (SWITCH_CONFIG(x) != SWITCH_NONE)
|
||||
#define IS_CONFIG_3POS(x) (SWITCH_CONFIG(x) == SWITCH_3POS)
|
||||
#define IS_CONFIG_TOGGLE(x) (SWITCH_CONFIG(x) == SWITCH_TOGGLE)
|
||||
#define SWITCH_WARNING_ALLOWED(x) (SWITCH_EXISTS(x) && !IS_CONFIG_TOGGLE(x))
|
||||
#else
|
||||
#define IS_CONFIG_3POS(x) IS_3POS(x)
|
||||
#define IS_CONFIG_TOGGLE(x) IS_TOGGLE(x)
|
||||
#define switchInfo(x) ((x) >= 3 ? (x)-2 : 0)
|
||||
#define SWITCH_EXISTS(x) true
|
||||
#endif
|
||||
|
||||
#define ALTERNATE_VIEW 0x10
|
||||
|
||||
// #if defined(COLORLCD)
|
||||
// #include "layout.h"
|
||||
// #include "theme.h"
|
||||
// #include "topbar.h"
|
||||
// #endif
|
||||
|
||||
#define SWITCHES_DELAY() uint8_t(15+g_eeGeneral.switchesDelay)
|
||||
#define SWITCHES_DELAY_NONE (-15)
|
||||
#define HAPTIC_STRENGTH() (3+g_eeGeneral.hapticStrength)
|
||||
|
||||
enum CurveRefType {
|
||||
CURVE_REF_DIFF,
|
||||
CURVE_REF_EXPO,
|
||||
CURVE_REF_FUNC,
|
||||
CURVE_REF_CUSTOM
|
||||
};
|
||||
|
||||
#define EXPO_VALID(ed) ((ed)->mode)
|
||||
#define EXPO_MODE_ENABLE(ed, v) (((v)<0 && ((ed)->mode&1)) || ((v)>=0 && ((ed)->mode&2)))
|
||||
|
||||
#define limit_min_max_t int16_t
|
||||
#define LIMIT_EXT_PERCENT 150
|
||||
#define LIMIT_STD_PERCENT 100
|
||||
#define LIMIT_EXT_MAX (LIMIT_EXT_PERCENT*10)
|
||||
#define LIMIT_STD_MAX (LIMIT_STD_PERCENT*10)
|
||||
#define PPM_CENTER_MAX 500
|
||||
#define LIMIT_MAX(lim) \
|
||||
(GV_IS_GV_VALUE(lim->max, -GV_RANGELARGE, GV_RANGELARGE) \
|
||||
? GET_GVAR_PREC1(lim->max, -LIMIT_EXT_MAX, +LIMIT_EXT_MAX, \
|
||||
mixerCurrentFlightMode) \
|
||||
: lim->max + LIMIT_STD_MAX)
|
||||
#define LIMIT_MIN(lim) \
|
||||
(GV_IS_GV_VALUE(lim->min, -GV_RANGELARGE, GV_RANGELARGE) \
|
||||
? GET_GVAR_PREC1(lim->min, -LIMIT_EXT_MAX, +LIMIT_EXT_MAX, \
|
||||
mixerCurrentFlightMode) \
|
||||
: lim->min - LIMIT_STD_MAX)
|
||||
#define LIMIT_OFS(lim) \
|
||||
(GV_IS_GV_VALUE(lim->offset, -LIMIT_STD_MAX, LIMIT_STD_MAX) \
|
||||
? GET_GVAR_PREC1(lim->offset, -LIMIT_STD_MAX, +LIMIT_STD_MAX, \
|
||||
mixerCurrentFlightMode) \
|
||||
: lim->offset)
|
||||
#define LIMIT_MAX_RESX(lim) calc1000toRESX(LIMIT_MAX(lim))
|
||||
#define LIMIT_MIN_RESX(lim) calc1000toRESX(LIMIT_MIN(lim))
|
||||
#define LIMIT_OFS_RESX(lim) calc1000toRESX(LIMIT_OFS(lim))
|
||||
|
||||
#define LIMITS_MIN_MAX_OFFSET LIMIT_STD_MAX
|
||||
|
||||
#define TRIM_OFF (1)
|
||||
#define TRIM_ON (0)
|
||||
#define TRIM_RUD (-1)
|
||||
#define TRIM_ELE (-2)
|
||||
#define TRIM_THR (-3)
|
||||
#define TRIM_AIL (-4)
|
||||
#if defined(PCBHORUS)
|
||||
#define TRIM_T5 (-5)
|
||||
#define TRIM_T6 (-6)
|
||||
#define TRIM_LAST TRIM_T6
|
||||
#else
|
||||
#define TRIM_LAST TRIM_AIL
|
||||
#endif
|
||||
|
||||
enum MixerMultiplex {
|
||||
MLTPX_ADD = 0,
|
||||
MLTPX_MUL = 1,
|
||||
MLTPX_REPL = 2,
|
||||
};
|
||||
|
||||
enum TrainerMultiplex {
|
||||
TRAINER_OFF = 0,
|
||||
TRAINER_ADD = 1,
|
||||
TRAINER_REPL = 2,
|
||||
};
|
||||
|
||||
#define GV1_SMALL 128
|
||||
#define GV1_LARGE 1024
|
||||
#define GV_RANGE_OFFSET 500
|
||||
#define DELAY_MAX 250 /* 25 seconds */
|
||||
#define SLOW_MAX 250 /* 25 seconds */
|
||||
|
||||
#define MD_WEIGHT(md) (md->weight)
|
||||
#define MD_WEIGHT_TO_UNION(md, var) var.word = md->weight
|
||||
#define MD_UNION_TO_WEIGHT(var, md) md->weight = var.word
|
||||
|
||||
#define MD_OFFSET(md) (md->offset)
|
||||
#define MD_OFFSET_TO_UNION(md, var) var.word = md->offset
|
||||
#define MD_UNION_TO_OFFSET(var, md) md->offset = var.word
|
||||
|
||||
enum LogicalSwitchesFunctions {
|
||||
LS_FUNC_NONE,
|
||||
LS_FUNC_VEQUAL, // v==offset
|
||||
LS_FUNC_VALMOSTEQUAL, // v~=offset
|
||||
LS_FUNC_VPOS, // v>offset
|
||||
LS_FUNC_VNEG, // v<offset
|
||||
LS_FUNC_RANGE,
|
||||
LS_FUNC_APOS, // |v|>offset
|
||||
LS_FUNC_ANEG, // |v|<offset
|
||||
LS_FUNC_AND,
|
||||
LS_FUNC_OR,
|
||||
LS_FUNC_XOR,
|
||||
LS_FUNC_EDGE,
|
||||
LS_FUNC_EQUAL,
|
||||
LS_FUNC_GREATER,
|
||||
LS_FUNC_LESS,
|
||||
LS_FUNC_DIFFEGREATER,
|
||||
LS_FUNC_ADIFFEGREATER,
|
||||
LS_FUNC_TIMER,
|
||||
LS_FUNC_STICKY,
|
||||
LS_FUNC_COUNT,
|
||||
LS_FUNC_MAX = LS_FUNC_COUNT-1
|
||||
};
|
||||
|
||||
#define MAX_LS_DURATION 250 /*25s*/
|
||||
#define MAX_LS_DELAY 250 /*25s*/
|
||||
#define MAX_LS_ANDSW SWSRC_LAST
|
||||
|
||||
enum TelemetrySensorType
|
||||
{
|
||||
TELEM_TYPE_CUSTOM,
|
||||
TELEM_TYPE_CALCULATED
|
||||
};
|
||||
|
||||
enum TelemetrySensorFormula
|
||||
{
|
||||
TELEM_FORMULA_ADD,
|
||||
TELEM_FORMULA_AVERAGE,
|
||||
TELEM_FORMULA_MIN,
|
||||
TELEM_FORMULA_MAX,
|
||||
TELEM_FORMULA_MULTIPLY,
|
||||
TELEM_FORMULA_TOTALIZE,
|
||||
TELEM_FORMULA_CELL,
|
||||
TELEM_FORMULA_CONSUMPTION,
|
||||
TELEM_FORMULA_DIST,
|
||||
TELEM_FORMULA_LAST = TELEM_FORMULA_DIST
|
||||
};
|
||||
|
||||
enum SwashType {
|
||||
SWASH_TYPE_NONE,
|
||||
SWASH_TYPE_120,
|
||||
SWASH_TYPE_120X,
|
||||
SWASH_TYPE_140,
|
||||
SWASH_TYPE_90,
|
||||
SWASH_TYPE_MAX = SWASH_TYPE_90
|
||||
};
|
||||
|
||||
#define TRIM_EXTENDED_MAX 500
|
||||
#define TRIM_EXTENDED_MIN (-TRIM_EXTENDED_MAX)
|
||||
#define TRIM_MAX 125
|
||||
#define TRIM_MIN (-TRIM_MAX)
|
||||
|
||||
#define TRIMS_ARRAY_SIZE 8
|
||||
#define TRIM_MODE_NONE 0x1F // 0b11111
|
||||
|
||||
#define IS_MANUAL_RESET_TIMER(idx) (g_model.timers[idx].persistent == 2)
|
||||
|
||||
#define TIMER_COUNTDOWN_START(x) (g_model.timers[x].countdownStart == 0 ? 20 : (g_model.timers[x].countdownStart == 1 ? 30 : (g_model.timers[x].countdownStart == -1 ? 10 : 5)))
|
||||
|
||||
// #include "pulses/modules_constants.h"
|
||||
|
||||
enum DisplayTrims
|
||||
{
|
||||
DISPLAY_TRIMS_NEVER,
|
||||
DISPLAY_TRIMS_CHANGE,
|
||||
DISPLAY_TRIMS_ALWAYS
|
||||
};
|
||||
|
||||
extern RadioData g_eeGeneral;
|
||||
extern ModelData g_model;
|
||||
|
||||
PACK(union u_int8int16_t {
|
||||
struct {
|
||||
int8_t lo;
|
||||
uint8_t hi;
|
||||
} bytes_t;
|
||||
int16_t word;
|
||||
});
|
||||
|
||||
constexpr uint8_t EE_GENERAL = 0x01;
|
||||
constexpr uint8_t EE_MODEL = 0x02;
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <storage/yaml/yaml_node.h>
|
||||
#include <storage/yaml/yaml_bits.h>
|
||||
#include <storage/yaml/yaml_tree_walker.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <debug.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../../../strhelpers.h"
|
||||
#include "../../../switches.h"
|
||||
#include "../../../timers.h"
|
||||
#include "../../../pulses/multi.h"
|
||||
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
|
||||
namespace yaml_conv_220 {
|
||||
|
||||
#include "yaml_datastructs_funcs.cpp"
|
||||
|
||||
#if defined(PCBX12S)
|
||||
#include "yaml_datastructs_x12s.cpp"
|
||||
#elif defined(PCBX10)
|
||||
#include "yaml_datastructs_x10.cpp"
|
||||
#elif defined(PCBNV14)
|
||||
#include "yaml_datastructs_nv14.cpp"
|
||||
#elif defined(PCBX7)
|
||||
#if defined(RADIO_T12)
|
||||
#include "yaml_datastructs_t12.cpp"
|
||||
#elif defined(RADIO_TLITE)
|
||||
#include "yaml_datastructs_tlite.cpp"
|
||||
#elif defined(RADIO_TX12)
|
||||
#include "yaml_datastructs_tx12.cpp"
|
||||
#elif defined(RADIO_TX12MK2)
|
||||
#include "yaml_datastructs_tx12mk2.cpp"
|
||||
#elif defined(RADIO_ZORRO)
|
||||
#include "yaml_datastructs_zorro.cpp"
|
||||
#elif defined(RADIO_T8)
|
||||
#include "yaml_datastructs_t8.cpp"
|
||||
#else
|
||||
#include "yaml_datastructs_x7.cpp"
|
||||
#endif
|
||||
#elif defined(PCBX9LITE) && !defined(PCBX9LITES)
|
||||
#include "yaml_datastructs_x9lite.cpp"
|
||||
#elif defined(PCBX9LITES)
|
||||
#include "yaml_datastructs_x9lites.cpp"
|
||||
#elif defined(PCBXLITE) && !defined(PCBXLITES)
|
||||
#include "yaml_datastructs_xlite.cpp"
|
||||
#elif defined(PCBXLITES)
|
||||
#include "yaml_datastructs_xlites.cpp"
|
||||
#elif defined(PCBX9E)
|
||||
#include "yaml_datastructs_x9e.cpp"
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP)
|
||||
#include "yaml_datastructs_x9d.cpp"
|
||||
#else
|
||||
#error "Board not supported by YAML storage"
|
||||
#endif
|
||||
|
||||
static_assert(MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN,
|
||||
"MAX_STR > MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN");
|
||||
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
namespace yaml_conv_220 {
|
||||
#include "yaml_datastructs_funcs.cpp"
|
||||
};
|
||||
|
||||
#endif // STORAGE_CONVERSIONS
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,893 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_TOUCH, "DISABLE_TOUCH" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ZoneOptionValueEnum[] = {
|
||||
{ ZOV_Unsigned, "Unsigned" },
|
||||
{ ZOV_Signed, "Signed" },
|
||||
{ ZOV_Bool, "Bool" },
|
||||
{ ZOV_String, "String" },
|
||||
{ ZOV_Source, "Source" },
|
||||
{ ZOV_Color, "Color" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 48 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
|
||||
YAML_UNSIGNED( "unsignedValue", 32 ),
|
||||
YAML_SIGNED( "signedValue", 32 ),
|
||||
YAML_UNSIGNED( "boolValue", 32 ),
|
||||
YAML_STRING("stringValue", 8),
|
||||
YAML_CUSTOM("source",r_zov_source,w_zov_source),
|
||||
YAML_CUSTOM("color",r_zov_color,w_zov_color),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum),
|
||||
YAML_UNION("value", 64, union_ZoneOptionValue_elmts, select_zov),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_OpenTxTheme__PersistentData[] = {
|
||||
YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 9, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_UNSIGNED( "stickReverse", 8 ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ENUM("aux2SerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr),
|
||||
YAML_ARRAY("slidersConfig", 1, 8, struct_sliderConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 216 ),
|
||||
YAML_STRING("currModelFilename", 17),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "blOffBright", 7 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("themeName", 8),
|
||||
YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 15),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_STRING("bitmap", 14),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 10),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_UNSIGNED( "flysky_telemetry", 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_32[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_WidgetPersistentData[] = {
|
||||
YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZonePersistentData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("widgetName", 12),
|
||||
YAML_STRUCT("widgetData", 480, struct_WidgetPersistentData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LayoutPersistentData[] = {
|
||||
YAML_ARRAY("zones", 576, 10, struct_ZonePersistentData, NULL),
|
||||
YAML_ARRAY("options", 96, 10, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("LayoutId", 10),
|
||||
YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TopBarPersistentData[] = {
|
||||
YAML_ARRAY("zones", 576, 2, struct_ZonePersistentData, NULL),
|
||||
YAML_ARRAY("options", 96, 1, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 248, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 9, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 5, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
|
||||
YAML_ARRAY("screenData", 6800, 5, struct_CustomScreenData, NULL),
|
||||
YAML_STRUCT("topbarData", 1248, struct_TopBarPersistentData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 248, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,862 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,862 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,862 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,862 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,854 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,910 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_TOUCH, "DISABLE_TOUCH" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ZoneOptionValueEnum[] = {
|
||||
{ ZOV_Unsigned, "Unsigned" },
|
||||
{ ZOV_Signed, "Signed" },
|
||||
{ ZOV_Bool, "Bool" },
|
||||
{ ZOV_String, "String" },
|
||||
{ ZOV_Source, "Source" },
|
||||
{ ZOV_Color, "Color" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_S1, "S1" },
|
||||
{ MIXSRC_6POS, "6POS" },
|
||||
{ MIXSRC_S2, "S2" },
|
||||
{ MIXSRC_EXT1, "EXT1" },
|
||||
{ MIXSRC_EXT2, "EXT2" },
|
||||
{ MIXSRC_LS, "LS" },
|
||||
{ MIXSRC_RS, "RS" },
|
||||
{ MIXSRC_MOUSE1, "MOUSE1" },
|
||||
{ MIXSRC_MOUSE2, "MOUSE2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_TrimT5, "TrimT5" },
|
||||
{ MIXSRC_TrimT6, "TrimT6" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_TrimT5Down, "TrimT5Down" },
|
||||
{ SWSRC_TrimT5Up, "TrimT5Up" },
|
||||
{ SWSRC_TrimT6Down, "TrimT6Down" },
|
||||
{ SWSRC_TrimT6Up, "TrimT6Up" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 48 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
|
||||
YAML_UNSIGNED( "unsignedValue", 32 ),
|
||||
YAML_SIGNED( "signedValue", 32 ),
|
||||
YAML_UNSIGNED( "boolValue", 32 ),
|
||||
YAML_STRING("stringValue", 8),
|
||||
YAML_CUSTOM("source",r_zov_source,w_zov_source),
|
||||
YAML_CUSTOM("color",r_zov_color,w_zov_color),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum),
|
||||
YAML_UNION("value", 64, union_ZoneOptionValue_elmts, select_zov),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_OpenTxTheme__PersistentData[] = {
|
||||
YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 15, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ENUM("aux2SerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr),
|
||||
YAML_ARRAY("slidersConfig", 1, 8, struct_sliderConfig, nullptr),
|
||||
YAML_PADDING( 240 ),
|
||||
YAML_PADDING( 312 ),
|
||||
YAML_STRING("currModelFilename", 17),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "blOffBright", 7 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("themeName", 8),
|
||||
YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 15),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_STRING("bitmap", 14),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 6, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 10),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_32[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_WidgetPersistentData[] = {
|
||||
YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZonePersistentData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("widgetName", 12),
|
||||
YAML_STRUCT("widgetData", 480, struct_WidgetPersistentData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LayoutPersistentData[] = {
|
||||
YAML_ARRAY("zones", 576, 10, struct_ZonePersistentData, NULL),
|
||||
YAML_ARRAY("options", 96, 10, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("LayoutId", 10),
|
||||
YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TopBarPersistentData[] = {
|
||||
YAML_ARRAY("zones", 576, 4, struct_ZonePersistentData, NULL),
|
||||
YAML_ARRAY("options", 96, 1, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 248, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 9, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 9, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
|
||||
YAML_ARRAY("screenData", 6800, 5, struct_CustomScreenData, NULL),
|
||||
YAML_STRUCT("topbarData", 2400, struct_TopBarPersistentData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 248, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,910 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_TOUCH, "DISABLE_TOUCH" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ZoneOptionValueEnum[] = {
|
||||
{ ZOV_Unsigned, "Unsigned" },
|
||||
{ ZOV_Signed, "Signed" },
|
||||
{ ZOV_Bool, "Bool" },
|
||||
{ ZOV_String, "String" },
|
||||
{ ZOV_Source, "Source" },
|
||||
{ ZOV_Color, "Color" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_S1, "S1" },
|
||||
{ MIXSRC_6POS, "6POS" },
|
||||
{ MIXSRC_S2, "S2" },
|
||||
{ MIXSRC_S3, "S3" },
|
||||
{ MIXSRC_S4, "S4" },
|
||||
{ MIXSRC_LS, "LS" },
|
||||
{ MIXSRC_RS, "RS" },
|
||||
{ MIXSRC_MOUSE1, "MOUSE1" },
|
||||
{ MIXSRC_MOUSE2, "MOUSE2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_TrimT5, "TrimT5" },
|
||||
{ MIXSRC_TrimT6, "TrimT6" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_TrimT5Down, "TrimT5Down" },
|
||||
{ SWSRC_TrimT5Up, "TrimT5Up" },
|
||||
{ SWSRC_TrimT6Down, "TrimT6Down" },
|
||||
{ SWSRC_TrimT6Up, "TrimT6Up" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 48, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 48, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 48 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
|
||||
YAML_UNSIGNED( "unsignedValue", 32 ),
|
||||
YAML_SIGNED( "signedValue", 32 ),
|
||||
YAML_UNSIGNED( "boolValue", 32 ),
|
||||
YAML_STRING("stringValue", 8),
|
||||
YAML_CUSTOM("source",r_zov_source,w_zov_source),
|
||||
YAML_CUSTOM("color",r_zov_color,w_zov_color),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum),
|
||||
YAML_UNION("value", 64, union_ZoneOptionValue_elmts, select_zov),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_OpenTxTheme__PersistentData[] = {
|
||||
YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 15, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ENUM("aux2SerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr),
|
||||
YAML_ARRAY("slidersConfig", 1, 8, struct_sliderConfig, nullptr),
|
||||
YAML_PADDING( 240 ),
|
||||
YAML_PADDING( 312 ),
|
||||
YAML_STRING("currModelFilename", 17),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "blOffBright", 7 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("themeName", 8),
|
||||
YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 15),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_STRING("bitmap", 14),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 6, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 10),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_32[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_WidgetPersistentData[] = {
|
||||
YAML_ARRAY("options", 96, 5, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ZonePersistentData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("widgetName", 12),
|
||||
YAML_STRUCT("widgetData", 480, struct_WidgetPersistentData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LayoutPersistentData[] = {
|
||||
YAML_ARRAY("zones", 576, 10, struct_ZonePersistentData, NULL),
|
||||
YAML_ARRAY("options", 96, 10, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("LayoutId", 10),
|
||||
YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TopBarPersistentData[] = {
|
||||
YAML_ARRAY("zones", 576, 4, struct_ZonePersistentData, NULL),
|
||||
YAML_ARRAY("options", 96, 1, struct_ZoneOptionValueTyped, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 248, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_UNSIGNED_CUST( "switchWarningState", 32, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 9, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 9, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
|
||||
YAML_ARRAY("screenData", 6800, 5, struct_CustomScreenData, NULL),
|
||||
YAML_STRUCT("topbarData", 2400, struct_TopBarPersistentData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 248, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,862 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,877 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_POT3, "POT3" },
|
||||
{ MIXSRC_SLIDER1, "SLIDER1" },
|
||||
{ MIXSRC_SLIDER2, "SLIDER2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 9, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 32 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 216 ),
|
||||
YAML_PADDING( 216 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 12),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_STRING("bitmap", 10),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 10),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_32[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 3, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 48, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 192, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 48 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED_CUST( "voltsSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED_CUST( "altitudeSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 5, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 192, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,917 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_POT3, "POT3" },
|
||||
{ MIXSRC_POT4, "POT4" },
|
||||
{ MIXSRC_SLIDER1, "SLIDER1" },
|
||||
{ MIXSRC_SLIDER2, "SLIDER2" },
|
||||
{ MIXSRC_SLIDER3, "SLIDER3" },
|
||||
{ MIXSRC_SLIDER4, "SLIDER4" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SI, "SI" },
|
||||
{ MIXSRC_SJ, "SJ" },
|
||||
{ MIXSRC_SK, "SK" },
|
||||
{ MIXSRC_SL, "SL" },
|
||||
{ MIXSRC_SM, "SM" },
|
||||
{ MIXSRC_SN, "SN" },
|
||||
{ MIXSRC_SO, "SO" },
|
||||
{ MIXSRC_SP, "SP" },
|
||||
{ MIXSRC_SQ, "SQ" },
|
||||
{ MIXSRC_SR, "SR" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_SI0, "SI0" },
|
||||
{ SWSRC_SI1, "SI1" },
|
||||
{ SWSRC_SI2, "SI2" },
|
||||
{ SWSRC_SJ0, "SJ0" },
|
||||
{ SWSRC_SJ1, "SJ1" },
|
||||
{ SWSRC_SJ2, "SJ2" },
|
||||
{ SWSRC_SK0, "SK0" },
|
||||
{ SWSRC_SK1, "SK1" },
|
||||
{ SWSRC_SK2, "SK2" },
|
||||
{ SWSRC_SL0, "SL0" },
|
||||
{ SWSRC_SL1, "SL1" },
|
||||
{ SWSRC_SL2, "SL2" },
|
||||
{ SWSRC_SM0, "SM0" },
|
||||
{ SWSRC_SM1, "SM1" },
|
||||
{ SWSRC_SM2, "SM2" },
|
||||
{ SWSRC_SN0, "SN0" },
|
||||
{ SWSRC_SN1, "SN1" },
|
||||
{ SWSRC_SN2, "SN2" },
|
||||
{ SWSRC_SO0, "SO0" },
|
||||
{ SWSRC_SO1, "SO1" },
|
||||
{ SWSRC_SO2, "SO2" },
|
||||
{ SWSRC_SP0, "SP0" },
|
||||
{ SWSRC_SP1, "SP1" },
|
||||
{ SWSRC_SP2, "SP2" },
|
||||
{ SWSRC_SQ0, "SQ0" },
|
||||
{ SWSRC_SQ1, "SQ1" },
|
||||
{ SWSRC_SQ2, "SQ2" },
|
||||
{ SWSRC_SR0, "SR0" },
|
||||
{ SWSRC_SR1, "SR1" },
|
||||
{ SWSRC_SR2, "SR2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 64, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 12, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 64 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 32, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 432 ),
|
||||
YAML_PADDING( 288 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 12),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_STRING("bitmap", 10),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 10),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_32[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 3, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 48, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 192, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 104, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 96 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED_CUST( "voltsSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED_CUST( "altitudeSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 32, 32, struct_string_32, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 8, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
|
||||
YAML_UNSIGNED( "toplcdTimer", 8 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 192, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 128, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,847 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 5, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 120 ),
|
||||
YAML_PADDING( 120 ),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 1, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,857 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 5, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 168 ),
|
||||
YAML_PADDING( 120 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 1, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,854 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,858 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_GYRO1, "GYRO1" },
|
||||
{ MIXSRC_GYRO2, "GYRO2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "gyroMax", 8 ),
|
||||
YAML_SIGNED( "gyroOffset", 8 ),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState", NULL, w_swtchWarn ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,862 +0,0 @@
|
||||
// generated by generate_yaml.py
|
||||
|
||||
//
|
||||
// Enums first
|
||||
//
|
||||
|
||||
const struct YamlIdStr enum_BacklightMode[] = {
|
||||
{ e_backlight_mode_off, "backlight_mode_off" },
|
||||
{ e_backlight_mode_keys, "backlight_mode_keys" },
|
||||
{ e_backlight_mode_sticks, "backlight_mode_sticks" },
|
||||
{ e_backlight_mode_all, "backlight_mode_all" },
|
||||
{ e_backlight_mode_on, "backlight_mode_on" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_AntennaModes[] = {
|
||||
{ ANTENNA_MODE_INTERNAL, "MODE_INTERNAL" },
|
||||
{ ANTENNA_MODE_ASK, "MODE_ASK" },
|
||||
{ ANTENNA_MODE_PER_MODEL, "MODE_PER_MODEL" },
|
||||
{ ANTENNA_MODE_EXTERNAL, "MODE_EXTERNAL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TrainerMultiplex[] = {
|
||||
{ TRAINER_OFF, "OFF" },
|
||||
{ TRAINER_ADD, "ADD" },
|
||||
{ TRAINER_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BeeperMode[] = {
|
||||
{ e_mode_quiet, "mode_quiet" },
|
||||
{ e_mode_alarms, "mode_alarms" },
|
||||
{ e_mode_nokeys, "mode_nokeys" },
|
||||
{ e_mode_all, "mode_all" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_BluetoothModes[] = {
|
||||
{ BLUETOOTH_OFF, "OFF" },
|
||||
{ BLUETOOTH_TELEMETRY, "TELEMETRY" },
|
||||
{ BLUETOOTH_TRAINER, "TRAINER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_OVERRIDE_CHANNEL, "OVERRIDE_CHANNEL" },
|
||||
{ FUNC_TRAINER, "TRAINER" },
|
||||
{ FUNC_INSTANT_TRIM, "INSTANT_TRIM" },
|
||||
{ FUNC_RESET, "RESET" },
|
||||
{ FUNC_SET_TIMER, "SET_TIMER" },
|
||||
{ FUNC_ADJUST_GVAR, "ADJUST_GVAR" },
|
||||
{ FUNC_VOLUME, "VOLUME" },
|
||||
{ FUNC_SET_FAILSAFE, "SET_FAILSAFE" },
|
||||
{ FUNC_RANGECHECK, "RANGECHECK" },
|
||||
{ FUNC_BIND, "BIND" },
|
||||
{ FUNC_PLAY_SOUND, "PLAY_SOUND" },
|
||||
{ FUNC_PLAY_TRACK, "PLAY_TRACK" },
|
||||
{ FUNC_PLAY_VALUE, "PLAY_VALUE" },
|
||||
{ FUNC_RESERVE4, "RESERVE4" },
|
||||
{ FUNC_PLAY_SCRIPT, "PLAY_SCRIPT" },
|
||||
{ FUNC_RESERVE5, "RESERVE5" },
|
||||
{ FUNC_BACKGND_MUSIC, "BACKGND_MUSIC" },
|
||||
{ FUNC_BACKGND_MUSIC_PAUSE, "BACKGND_MUSIC_PAUSE" },
|
||||
{ FUNC_VARIO, "VARIO" },
|
||||
{ FUNC_HAPTIC, "HAPTIC" },
|
||||
{ FUNC_LOGS, "LOGS" },
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
{ UART_MODE_TELEMETRY, "MODE_TELEMETRY" },
|
||||
{ UART_MODE_SBUS_TRAINER, "MODE_SBUS_TRAINER" },
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TimerModes[] = {
|
||||
{ TMRMODE_OFF, "OFF" },
|
||||
{ TMRMODE_ON, "ON" },
|
||||
{ TMRMODE_START, "START" },
|
||||
{ TMRMODE_THR, "THR" },
|
||||
{ TMRMODE_THR_REL, "THR_REL" },
|
||||
{ TMRMODE_THR_START, "THR_START" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixerMultiplex[] = {
|
||||
{ MLTPX_ADD, "ADD" },
|
||||
{ MLTPX_MUL, "MUL" },
|
||||
{ MLTPX_REPL, "REPL" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_MixSources[] = {
|
||||
{ MIXSRC_NONE, "NONE" },
|
||||
{ MIXSRC_Rud, "Rud" },
|
||||
{ MIXSRC_Ele, "Ele" },
|
||||
{ MIXSRC_Thr, "Thr" },
|
||||
{ MIXSRC_Ail, "Ail" },
|
||||
{ MIXSRC_POT1, "POT1" },
|
||||
{ MIXSRC_POT2, "POT2" },
|
||||
{ MIXSRC_MAX, "MAX" },
|
||||
{ MIXSRC_CYC1, "CYC1" },
|
||||
{ MIXSRC_CYC2, "CYC2" },
|
||||
{ MIXSRC_CYC3, "CYC3" },
|
||||
{ MIXSRC_TrimRud, "TrimRud" },
|
||||
{ MIXSRC_TrimEle, "TrimEle" },
|
||||
{ MIXSRC_TrimThr, "TrimThr" },
|
||||
{ MIXSRC_TrimAil, "TrimAil" },
|
||||
{ MIXSRC_SA, "SA" },
|
||||
{ MIXSRC_SB, "SB" },
|
||||
{ MIXSRC_SC, "SC" },
|
||||
{ MIXSRC_SD, "SD" },
|
||||
{ MIXSRC_SE, "SE" },
|
||||
{ MIXSRC_SF, "SF" },
|
||||
{ MIXSRC_SG, "SG" },
|
||||
{ MIXSRC_SH, "SH" },
|
||||
{ MIXSRC_SW1, "SW1" },
|
||||
{ MIXSRC_CH1, "CH1" },
|
||||
{ MIXSRC_CH2, "CH2" },
|
||||
{ MIXSRC_CH3, "CH3" },
|
||||
{ MIXSRC_CH4, "CH4" },
|
||||
{ MIXSRC_CH5, "CH5" },
|
||||
{ MIXSRC_CH6, "CH6" },
|
||||
{ MIXSRC_CH7, "CH7" },
|
||||
{ MIXSRC_CH8, "CH8" },
|
||||
{ MIXSRC_CH9, "CH9" },
|
||||
{ MIXSRC_CH10, "CH10" },
|
||||
{ MIXSRC_CH11, "CH11" },
|
||||
{ MIXSRC_CH12, "CH12" },
|
||||
{ MIXSRC_CH13, "CH13" },
|
||||
{ MIXSRC_CH14, "CH14" },
|
||||
{ MIXSRC_CH15, "CH15" },
|
||||
{ MIXSRC_CH16, "CH16" },
|
||||
{ MIXSRC_GVAR1, "GVAR1" },
|
||||
{ MIXSRC_TX_VOLTAGE, "TX_VOLTAGE" },
|
||||
{ MIXSRC_TX_TIME, "TX_TIME" },
|
||||
{ MIXSRC_TX_GPS, "TX_GPS" },
|
||||
{ MIXSRC_TIMER1, "TIMER1" },
|
||||
{ MIXSRC_TIMER2, "TIMER2" },
|
||||
{ MIXSRC_TIMER3, "TIMER3" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
|
||||
{ LS_FUNC_NONE, "FUNC_NONE" },
|
||||
{ LS_FUNC_VEQUAL, "FUNC_VEQUAL" },
|
||||
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
|
||||
{ LS_FUNC_VPOS, "FUNC_VPOS" },
|
||||
{ LS_FUNC_VNEG, "FUNC_VNEG" },
|
||||
{ LS_FUNC_RANGE, "FUNC_RANGE" },
|
||||
{ LS_FUNC_APOS, "FUNC_APOS" },
|
||||
{ LS_FUNC_ANEG, "FUNC_ANEG" },
|
||||
{ LS_FUNC_AND, "FUNC_AND" },
|
||||
{ LS_FUNC_OR, "FUNC_OR" },
|
||||
{ LS_FUNC_XOR, "FUNC_XOR" },
|
||||
{ LS_FUNC_EDGE, "FUNC_EDGE" },
|
||||
{ LS_FUNC_EQUAL, "FUNC_EQUAL" },
|
||||
{ LS_FUNC_GREATER, "FUNC_GREATER" },
|
||||
{ LS_FUNC_LESS, "FUNC_LESS" },
|
||||
{ LS_FUNC_DIFFEGREATER, "FUNC_DIFFEGREATER" },
|
||||
{ LS_FUNC_ADIFFEGREATER, "FUNC_ADIFFEGREATER" },
|
||||
{ LS_FUNC_TIMER, "FUNC_TIMER" },
|
||||
{ LS_FUNC_STICKY, "FUNC_STICKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwashType[] = {
|
||||
{ SWASH_TYPE_NONE, "TYPE_NONE" },
|
||||
{ SWASH_TYPE_120, "TYPE_120" },
|
||||
{ SWASH_TYPE_120X, "TYPE_120X" },
|
||||
{ SWASH_TYPE_140, "TYPE_140" },
|
||||
{ SWASH_TYPE_90, "TYPE_90" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_SwitchSources[] = {
|
||||
{ SWSRC_NONE, "NONE" },
|
||||
{ SWSRC_SA0, "SA0" },
|
||||
{ SWSRC_SA1, "SA1" },
|
||||
{ SWSRC_SA2, "SA2" },
|
||||
{ SWSRC_SB0, "SB0" },
|
||||
{ SWSRC_SB1, "SB1" },
|
||||
{ SWSRC_SB2, "SB2" },
|
||||
{ SWSRC_SC0, "SC0" },
|
||||
{ SWSRC_SC1, "SC1" },
|
||||
{ SWSRC_SC2, "SC2" },
|
||||
{ SWSRC_SD0, "SD0" },
|
||||
{ SWSRC_SD1, "SD1" },
|
||||
{ SWSRC_SD2, "SD2" },
|
||||
{ SWSRC_SE0, "SE0" },
|
||||
{ SWSRC_SE1, "SE1" },
|
||||
{ SWSRC_SE2, "SE2" },
|
||||
{ SWSRC_SF0, "SF0" },
|
||||
{ SWSRC_SF1, "SF1" },
|
||||
{ SWSRC_SF2, "SF2" },
|
||||
{ SWSRC_SG0, "SG0" },
|
||||
{ SWSRC_SG1, "SG1" },
|
||||
{ SWSRC_SG2, "SG2" },
|
||||
{ SWSRC_SH0, "SH0" },
|
||||
{ SWSRC_SH1, "SH1" },
|
||||
{ SWSRC_SH2, "SH2" },
|
||||
{ SWSRC_TrimRudLeft, "TrimRudLeft" },
|
||||
{ SWSRC_TrimRudRight, "TrimRudRight" },
|
||||
{ SWSRC_TrimEleDown, "TrimEleDown" },
|
||||
{ SWSRC_TrimEleUp, "TrimEleUp" },
|
||||
{ SWSRC_TrimThrDown, "TrimThrDown" },
|
||||
{ SWSRC_TrimThrUp, "TrimThrUp" },
|
||||
{ SWSRC_TrimAilLeft, "TrimAilLeft" },
|
||||
{ SWSRC_TrimAilRight, "TrimAilRight" },
|
||||
{ SWSRC_SW1, "SW1" },
|
||||
{ SWSRC_SW2, "SW2" },
|
||||
{ SWSRC_ON, "ON" },
|
||||
{ SWSRC_ONE, "ONE" },
|
||||
{ SWSRC_TELEMETRY_STREAMING, "TELEMETRY_STREAMING" },
|
||||
{ SWSRC_RADIO_ACTIVITY, "RADIO_ACTIVITY" },
|
||||
{ SWSRC_OFF, "OFF" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_PotsWarnMode[] = {
|
||||
{ POTS_WARN_OFF, "WARN_OFF" },
|
||||
{ POTS_WARN_MANUAL, "WARN_MANUAL" },
|
||||
{ POTS_WARN_AUTO, "WARN_AUTO" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_ModuleType[] = {
|
||||
{ MODULE_TYPE_NONE, "TYPE_NONE" },
|
||||
{ MODULE_TYPE_PPM, "TYPE_PPM" },
|
||||
{ MODULE_TYPE_XJT_PXX1, "TYPE_XJT_PXX1" },
|
||||
{ MODULE_TYPE_ISRM_PXX2, "TYPE_ISRM_PXX2" },
|
||||
{ MODULE_TYPE_DSM2, "TYPE_DSM2" },
|
||||
{ MODULE_TYPE_CROSSFIRE, "TYPE_CROSSFIRE" },
|
||||
{ MODULE_TYPE_MULTIMODULE, "TYPE_MULTIMODULE" },
|
||||
{ MODULE_TYPE_R9M_PXX1, "TYPE_R9M_PXX1" },
|
||||
{ MODULE_TYPE_R9M_PXX2, "TYPE_R9M_PXX2" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX1, "TYPE_R9M_LITE_PXX1" },
|
||||
{ MODULE_TYPE_R9M_LITE_PXX2, "TYPE_R9M_LITE_PXX2" },
|
||||
{ MODULE_TYPE_GHOST, "TYPE_GHOST" },
|
||||
{ MODULE_TYPE_R9M_LITE_PRO_PXX2, "TYPE_R9M_LITE_PRO_PXX2" },
|
||||
{ MODULE_TYPE_SBUS, "TYPE_SBUS" },
|
||||
{ MODULE_TYPE_XJT_LITE_PXX2, "TYPE_XJT_LITE_PXX2" },
|
||||
{ MODULE_TYPE_FLYSKY, "TYPE_FLYSKY" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_FailsafeModes[] = {
|
||||
{ FAILSAFE_NOT_SET, "NOT_SET" },
|
||||
{ FAILSAFE_HOLD, "HOLD" },
|
||||
{ FAILSAFE_CUSTOM, "CUSTOM" },
|
||||
{ FAILSAFE_NOPULSES, "NOPULSES" },
|
||||
{ FAILSAFE_RECEIVER, "RECEIVER" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorFormula[] = {
|
||||
{ TELEM_FORMULA_ADD, "FORMULA_ADD" },
|
||||
{ TELEM_FORMULA_AVERAGE, "FORMULA_AVERAGE" },
|
||||
{ TELEM_FORMULA_MIN, "FORMULA_MIN" },
|
||||
{ TELEM_FORMULA_MAX, "FORMULA_MAX" },
|
||||
{ TELEM_FORMULA_MULTIPLY, "FORMULA_MULTIPLY" },
|
||||
{ TELEM_FORMULA_TOTALIZE, "FORMULA_TOTALIZE" },
|
||||
{ TELEM_FORMULA_CELL, "FORMULA_CELL" },
|
||||
{ TELEM_FORMULA_CONSUMPTION, "FORMULA_CONSUMPTION" },
|
||||
{ TELEM_FORMULA_DIST, "FORMULA_DIST" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_TelemetrySensorType[] = {
|
||||
{ TELEM_TYPE_CUSTOM, "TYPE_CUSTOM" },
|
||||
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
//
|
||||
// Structs last
|
||||
//
|
||||
|
||||
static const struct YamlNode struct_CalibData[] = {
|
||||
YAML_IDX_CUST("calib",r_calib,w_calib),
|
||||
YAML_SIGNED( "mid", 16 ),
|
||||
YAML_SIGNED( "spanNeg", 16 ),
|
||||
YAML_SIGNED( "spanPos", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_16[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerMix[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "srcChn", 6 ),
|
||||
YAML_ENUM("mode", 2, enum_TrainerMultiplex),
|
||||
YAML_SIGNED( "studWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerData[] = {
|
||||
YAML_ARRAY("calib", 16, 4, struct_signed_16, NULL),
|
||||
YAML_ARRAY("mix", 16, 4, struct_TrainerMix, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_1[] = {
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_2[] = {
|
||||
YAML_SIGNED( "val", 16 ),
|
||||
YAML_UNSIGNED( "mode", 8 ),
|
||||
YAML_UNSIGNED( "param", 8 ),
|
||||
YAML_SIGNED( "spare", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_3[] = {
|
||||
YAML_SIGNED( "val1", 32 ),
|
||||
YAML_SIGNED( "val2", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_0_elmts[] = {
|
||||
YAML_STRUCT("play", 48, struct_anonymous_1, NULL),
|
||||
YAML_STRUCT("all", 64, struct_anonymous_2, NULL),
|
||||
YAML_STRUCT("clear", 64, struct_anonymous_3, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CustomFunctionData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_ENUM("func", 7, enum_Functions),
|
||||
YAML_CUSTOM("def",r_customFn,w_customFn),
|
||||
YAML_PADDING( 64 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_24[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RadioData[] = {
|
||||
YAML_UNSIGNED( "version", 8 ),
|
||||
YAML_CUSTOM("board",nullptr,w_board),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_ARRAY("calib", 48, 6, struct_CalibData, NULL),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_SIGNED( "currModel", 8 ),
|
||||
YAML_UNSIGNED( "contrast", 8 ),
|
||||
YAML_UNSIGNED( "vBatWarn", 8 ),
|
||||
YAML_SIGNED( "txVoltageCalibration", 8 ),
|
||||
YAML_ENUM("backlightMode", 3, enum_BacklightMode),
|
||||
YAML_ENUM("antennaMode", 2, enum_AntennaModes),
|
||||
YAML_UNSIGNED( "disableRtcWarning", 1 ),
|
||||
YAML_UNSIGNED( "keysBacklight", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRUCT("trainer", 128, struct_TrainerData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "fai", 1 ),
|
||||
YAML_SIGNED_CUST( "beepMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_UNSIGNED( "alarmsFlash", 1 ),
|
||||
YAML_UNSIGNED( "disableMemoryWarning", 1 ),
|
||||
YAML_UNSIGNED( "disableAlarmWarning", 1 ),
|
||||
YAML_UNSIGNED( "stickMode", 2 ),
|
||||
YAML_SIGNED( "timezone", 5 ),
|
||||
YAML_UNSIGNED( "adjustRTC", 1 ),
|
||||
YAML_UNSIGNED( "inactivityTimer", 8 ),
|
||||
YAML_UNSIGNED( "telemetryBaudrate", 3 ),
|
||||
YAML_SIGNED( "splashMode", 3 ),
|
||||
YAML_SIGNED_CUST( "hapticMode", 2, r_beeperMode, w_beeperMode ),
|
||||
YAML_SIGNED( "switchesDelay", 8 ),
|
||||
YAML_UNSIGNED( "lightAutoOff", 8 ),
|
||||
YAML_UNSIGNED( "templateSetup", 8 ),
|
||||
YAML_SIGNED( "PPM_Multiplier", 8 ),
|
||||
YAML_SIGNED_CUST( "hapticLength", 8, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "beepLength", 3, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "hapticStrength", 3, r_5pos, w_5pos ),
|
||||
YAML_UNSIGNED( "gpsFormat", 1 ),
|
||||
YAML_UNSIGNED( "unexpectedShutdown", 1 ),
|
||||
YAML_UNSIGNED_CUST( "speakerPitch", 8, r_spPitch, w_spPitch ),
|
||||
YAML_SIGNED_CUST( "speakerVolume", 8, r_vol, w_vol ),
|
||||
YAML_SIGNED_CUST( "vBatMin", 8, r_vbat_min, w_vbat_min ),
|
||||
YAML_SIGNED_CUST( "vBatMax", 8, r_vbat_max, w_vbat_max ),
|
||||
YAML_UNSIGNED( "backlightBright", 8 ),
|
||||
YAML_UNSIGNED( "globalTimer", 32 ),
|
||||
YAML_UNSIGNED( "bluetoothBaudrate", 4 ),
|
||||
YAML_ENUM("bluetoothMode", 4, enum_BluetoothModes),
|
||||
YAML_UNSIGNED( "countryCode", 2 ),
|
||||
YAML_SIGNED( "pwrOnSpeed", 3 ),
|
||||
YAML_SIGNED( "pwrOffSpeed", 3 ),
|
||||
YAML_UNSIGNED( "imperial", 1 ),
|
||||
YAML_UNSIGNED( "jitterFilter", 1 ),
|
||||
YAML_UNSIGNED( "disableRssiPoweroffAlarm", 1 ),
|
||||
YAML_UNSIGNED( "USBMode", 2 ),
|
||||
YAML_UNSIGNED( "jackMode", 2 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("ttsLanguage", 2),
|
||||
YAML_SIGNED_CUST( "beepVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "wavVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "backgroundVolume", 4, r_5pos, w_5pos ),
|
||||
YAML_SIGNED_CUST( "varioPitch", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED_CUST( "varioRange", 8, r_vPitch, w_vPitch ),
|
||||
YAML_SIGNED( "varioRepeat", 8 ),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_ENUM("auxSerialMode", 4, enum_UartModes),
|
||||
YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr),
|
||||
YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr),
|
||||
YAML_UNSIGNED( "backlightColor", 8 ),
|
||||
YAML_UNSIGNED( "switchUnlockStates", 16 ),
|
||||
YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid),
|
||||
YAML_ARRAY("switchConfig", 2, 8, struct_switchConfig, nullptr),
|
||||
YAML_PADDING( 192 ),
|
||||
YAML_PADDING( 144 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_STRING("bluetoothName", 10),
|
||||
YAML_STRING("ownerRegistrationID", 8),
|
||||
YAML_SIGNED( "uartSampleMode", 2 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_unsigned_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelHeader[] = {
|
||||
YAML_STRING("name", 10),
|
||||
YAML_ARRAY("modelId", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "start", 22 ),
|
||||
YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_SIGNED( "value", 22 ),
|
||||
YAML_ENUM("mode", 3, enum_TimerModes),
|
||||
YAML_UNSIGNED( "countdownBeep", 2 ),
|
||||
YAML_UNSIGNED( "minuteBeep", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveRef[] = {
|
||||
YAML_UNSIGNED( "type", 8 ),
|
||||
YAML_SIGNED_CUST( "value", 8, in_read_weight, in_write_weight ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_MixData[] = {
|
||||
YAML_SIGNED_CUST( "weight", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "destCh", 5 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED( "carryTrim", 1 ),
|
||||
YAML_UNSIGNED( "mixWarn", 2 ),
|
||||
YAML_ENUM("mltpx", 2, enum_MixerMultiplex),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED_CUST( "offset", 14, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_UNSIGNED( "delayUp", 8 ),
|
||||
YAML_UNSIGNED( "delayDown", 8 ),
|
||||
YAML_UNSIGNED( "speedUp", 8 ),
|
||||
YAML_UNSIGNED( "speedDown", 8 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LimitData[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED_CUST( "min", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED_CUST( "max", 11, in_read_weight, in_write_weight ),
|
||||
YAML_SIGNED( "ppmCenter", 10 ),
|
||||
YAML_SIGNED_CUST( "offset", 11, in_read_weight, in_write_weight ),
|
||||
YAML_UNSIGNED( "symetrical", 1 ),
|
||||
YAML_UNSIGNED( "revert", 1 ),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_SIGNED( "curve", 8 ),
|
||||
YAML_STRING("name", 4),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ExpoData[] = {
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "scale", 14 ),
|
||||
YAML_UNSIGNED_CUST( "srcRaw", 10, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "carryTrim", 6 ),
|
||||
YAML_UNSIGNED( "chn", 5 ),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ),
|
||||
YAML_SIGNED_CUST( "weight", 8, in_read_weight, in_write_weight ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "offset", 8, in_read_weight, in_write_weight ),
|
||||
YAML_STRUCT("curve", 16, struct_CurveRef, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_CurveHeader[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED( "type", 1 ),
|
||||
YAML_UNSIGNED( "smooth", 1 ),
|
||||
YAML_SIGNED( "points", 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_signed_8[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "val", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_SwashRingData[] = {
|
||||
YAML_ENUM("type", 8, enum_SwashType),
|
||||
YAML_UNSIGNED( "value", 8 ),
|
||||
YAML_UNSIGNED_CUST( "collectiveSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "aileronSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_UNSIGNED_CUST( "elevatorSource", 8, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "collectiveWeight", 8 ),
|
||||
YAML_SIGNED( "aileronWeight", 8 ),
|
||||
YAML_SIGNED( "elevatorWeight", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_trim_t[] = {
|
||||
YAML_IDX,
|
||||
YAML_SIGNED( "value", 11 ),
|
||||
YAML_UNSIGNED( "mode", 5 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FlightModeData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("trim", 16, 4, struct_trim_t, NULL),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_SIGNED_CUST( "swtch", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "fadeIn", 8 ),
|
||||
YAML_UNSIGNED( "fadeOut", 8 ),
|
||||
YAML_ARRAY("gvars", 16, 9, struct_signed_16, gvar_is_active),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_GVarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("name", 3),
|
||||
YAML_UNSIGNED( "min", 12 ),
|
||||
YAML_UNSIGNED( "max", 12 ),
|
||||
YAML_UNSIGNED( "popup", 1 ),
|
||||
YAML_UNSIGNED( "prec", 1 ),
|
||||
YAML_UNSIGNED( "unit", 2 ),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_VarioData[] = {
|
||||
YAML_UNSIGNED_CUST( "source", 7, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_UNSIGNED( "centerSilent", 1 ),
|
||||
YAML_SIGNED( "centerMax", 8 ),
|
||||
YAML_SIGNED( "centerMin", 8 ),
|
||||
YAML_SIGNED( "min", 8 ),
|
||||
YAML_SIGNED( "max", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_RssiAlarmData[] = {
|
||||
YAML_SIGNED( "disabled", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "warning", 6 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "critical", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_5[] = {
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_UNSIGNED( "outputType", 1 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_6[] = {
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "disableTelemetry", 1 ),
|
||||
YAML_UNSIGNED( "disableMapping", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "autoBindMode", 1 ),
|
||||
YAML_UNSIGNED( "lowPowerMode", 1 ),
|
||||
YAML_SIGNED( "optionValue", 8 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_7[] = {
|
||||
YAML_UNSIGNED( "power", 2 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_UNSIGNED( "receiverTelemetryOff", 1 ),
|
||||
YAML_UNSIGNED( "receiverHigherChannels", 1 ),
|
||||
YAML_SIGNED( "antennaMode", 2 ),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_8[] = {
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_UNSIGNED( "noninverted", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_SIGNED( "refreshRate", 8 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_string_64[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("val", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_9[] = {
|
||||
YAML_UNSIGNED( "receivers", 7 ),
|
||||
YAML_UNSIGNED( "racingMode", 1 ),
|
||||
YAML_ARRAY("receiverName", 64, 3, struct_string_64, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_10[] = {
|
||||
YAML_ARRAY("rx_id", 8, 4, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 3 ),
|
||||
YAML_UNSIGNED( "rfPower", 1 ),
|
||||
YAML_UNSIGNED( "reserved", 4 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_11[] = {
|
||||
YAML_UNSIGNED( "bindPower", 3 ),
|
||||
YAML_UNSIGNED( "runPower", 3 ),
|
||||
YAML_UNSIGNED( "emi", 1 ),
|
||||
YAML_UNSIGNED( "telemetry", 1 ),
|
||||
YAML_UNSIGNED( "failsafeTimeout", 16 ),
|
||||
YAML_ARRAY("rx_freq", 8, 2, struct_unsigned_8, NULL),
|
||||
YAML_UNSIGNED( "mode", 2 ),
|
||||
YAML_UNSIGNED( "reserved", 6 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_4_elmts[] = {
|
||||
YAML_ARRAY("raw", 8, 25, struct_unsigned_8, NULL),
|
||||
YAML_STRUCT("ppm", 16, struct_anonymous_5, NULL),
|
||||
YAML_STRUCT("multi", 24, struct_anonymous_6, NULL),
|
||||
YAML_STRUCT("pxx", 16, struct_anonymous_7, NULL),
|
||||
YAML_STRUCT("sbus", 16, struct_anonymous_8, NULL),
|
||||
YAML_STRUCT("pxx2", 200, struct_anonymous_9, NULL),
|
||||
YAML_STRUCT("flysky", 56, struct_anonymous_10, NULL),
|
||||
YAML_STRUCT("afhds3", 64, struct_anonymous_11, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModuleData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("type", 4, enum_ModuleType),
|
||||
YAML_PADDING( 4 ),
|
||||
YAML_CUSTOM("subType",r_modSubtype,w_modSubtype),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED_CUST( "channelsCount", 8, r_channelsCount, w_channelsCount ),
|
||||
YAML_ENUM("failsafeMode", 4, enum_FailsafeModes),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("mod", 200, union_anonymous_4_elmts, select_mod_type),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TrainerModuleData[] = {
|
||||
YAML_UNSIGNED_CUST( "mode", 8, r_trainerMode, w_trainerMode ),
|
||||
YAML_UNSIGNED( "channelsStart", 8 ),
|
||||
YAML_SIGNED( "channelsCount", 8 ),
|
||||
YAML_SIGNED( "frameLength", 8 ),
|
||||
YAML_SIGNED( "delay", 6 ),
|
||||
YAML_UNSIGNED( "pulsePol", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput_elmts[] = {
|
||||
YAML_SIGNED( "value", 16 ),
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_ScriptDataInput[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("u", 16, union_ScriptDataInput_elmts, select_script_input),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ScriptData[] = {
|
||||
YAML_IDX,
|
||||
YAML_STRING("file", 6),
|
||||
YAML_STRING("name", 6),
|
||||
YAML_ARRAY("inputs", 16, 6, union_ScriptDataInput, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_12_elmts[] = {
|
||||
YAML_UNSIGNED( "id", 16 ),
|
||||
YAML_UNSIGNED( "persistentValue", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_14[] = {
|
||||
YAML_UNSIGNED( "physID", 5 ),
|
||||
YAML_UNSIGNED( "rxIndex", 3 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_13_elmts[] = {
|
||||
YAML_STRUCT("frskyInstance", 8, struct_anonymous_14, NULL),
|
||||
YAML_UNSIGNED( "instance", 8 ),
|
||||
YAML_ENUM("formula", 8, enum_TelemetrySensorFormula),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_16[] = {
|
||||
YAML_UNSIGNED( "ratio", 16 ),
|
||||
YAML_SIGNED( "offset", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_17[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_UNSIGNED( "index", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_18[] = {
|
||||
YAML_ARRAY("sources", 8, 4, struct_signed_8, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_19[] = {
|
||||
YAML_UNSIGNED( "source", 8 ),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_anonymous_20[] = {
|
||||
YAML_UNSIGNED( "gps", 8 ),
|
||||
YAML_UNSIGNED( "alt", 8 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_anonymous_15_elmts[] = {
|
||||
YAML_STRUCT("custom", 32, struct_anonymous_16, NULL),
|
||||
YAML_STRUCT("cell", 32, struct_anonymous_17, NULL),
|
||||
YAML_STRUCT("calc", 32, struct_anonymous_18, NULL),
|
||||
YAML_STRUCT("consumption", 32, struct_anonymous_19, NULL),
|
||||
YAML_STRUCT("dist", 32, struct_anonymous_20, NULL),
|
||||
YAML_UNSIGNED( "param", 32 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetrySensor[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNION("id1", 16, union_anonymous_12_elmts, select_id1),
|
||||
YAML_UNION("id2", 8, union_anonymous_13_elmts, select_id2),
|
||||
YAML_STRING("label", 4),
|
||||
YAML_UNSIGNED( "subId", 8 ),
|
||||
YAML_ENUM("type", 1, enum_TelemetrySensorType),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNSIGNED( "unit", 6 ),
|
||||
YAML_UNSIGNED( "prec", 2 ),
|
||||
YAML_UNSIGNED( "autoOffset", 1 ),
|
||||
YAML_UNSIGNED( "filter", 1 ),
|
||||
YAML_UNSIGNED( "logs", 1 ),
|
||||
YAML_UNSIGNED( "persistent", 1 ),
|
||||
YAML_UNSIGNED( "onlyPositive", 1 ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_UNION("cfg", 32, union_anonymous_15_elmts, select_sensor_cfg),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyBarData[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "source", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_SIGNED( "barMin", 16 ),
|
||||
YAML_SIGNED( "barMax", 16 ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_LineDataSource[] = {
|
||||
YAML_IDX,
|
||||
YAML_UNSIGNED_CUST( "val", 16, r_mixSrcRaw, w_mixSrcRaw ),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_FrSkyLineData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ARRAY("sources", 16, 2, struct_LineDataSource, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScriptData[] = {
|
||||
YAML_STRING("file", 6),
|
||||
YAML_ARRAY("inputs", 16, 8, struct_signed_16, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode union_TelemetryScreenData_u_elmts[] = {
|
||||
YAML_ARRAY("bars", 48, 4, struct_FrSkyBarData, NULL),
|
||||
YAML_ARRAY("lines", 32, 4, struct_FrSkyLineData, NULL),
|
||||
YAML_STRUCT("script", 176, struct_TelemetryScriptData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_TelemetryScreenData[] = {
|
||||
YAML_IDX,
|
||||
YAML_CUSTOM("type",r_tele_screen_type,w_tele_screen_type),
|
||||
YAML_UNION("u", 192, union_TelemetryScreenData_u_elmts, select_tele_screen_data),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_ModelData[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_UNSIGNED( "telemetryProtocol", 3 ),
|
||||
YAML_UNSIGNED( "thrTrim", 1 ),
|
||||
YAML_UNSIGNED( "noGlobalFunctions", 1 ),
|
||||
YAML_UNSIGNED( "displayTrims", 2 ),
|
||||
YAML_UNSIGNED( "ignoreSensorIds", 1 ),
|
||||
YAML_SIGNED( "trimInc", 3 ),
|
||||
YAML_UNSIGNED( "disableThrottleWarning", 1 ),
|
||||
YAML_UNSIGNED( "displayChecklist", 1 ),
|
||||
YAML_UNSIGNED( "extendedLimits", 1 ),
|
||||
YAML_UNSIGNED( "extendedTrims", 1 ),
|
||||
YAML_UNSIGNED( "throttleReversed", 1 ),
|
||||
YAML_UNSIGNED( "beepANACenter", 16 ),
|
||||
YAML_ARRAY("mixData", 160, 64, struct_MixData, NULL),
|
||||
YAML_ARRAY("limitData", 88, 32, struct_LimitData, NULL),
|
||||
YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL),
|
||||
YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL),
|
||||
YAML_ARRAY("points", 8, 512, struct_signed_8, NULL),
|
||||
YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL),
|
||||
YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active),
|
||||
YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active),
|
||||
YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active),
|
||||
YAML_UNSIGNED_CUST( "thrTraceSrc", 8, r_thrSrc, w_thrSrc ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 24 ),
|
||||
YAML_ARRAY("gvars", 56, 9, struct_GVarData, NULL),
|
||||
YAML_STRUCT("varioData", 40, struct_VarioData, NULL),
|
||||
YAML_UNSIGNED_CUST( "rssiSource", 8, r_tele_sensor, w_tele_sensor ),
|
||||
YAML_STRUCT("rssiAlarms", 16, struct_RssiAlarmData, NULL),
|
||||
YAML_PADDING( 3 ),
|
||||
YAML_UNSIGNED( "thrTrimSw", 3 ),
|
||||
YAML_ENUM("potsWarnMode", 2, enum_PotsWarnMode),
|
||||
YAML_ARRAY("moduleData", 232, 2, struct_ModuleData, NULL),
|
||||
YAML_ARRAY("failsafeChannels", 16, 32, struct_signed_16, NULL),
|
||||
YAML_STRUCT("trainerData", 40, struct_TrainerModuleData, NULL),
|
||||
YAML_ARRAY("scriptsData", 192, 7, struct_ScriptData, NULL),
|
||||
YAML_ARRAY("inputNames", 24, 32, struct_string_24, NULL),
|
||||
YAML_UNSIGNED( "potsWarnEnabled", 8 ),
|
||||
YAML_ARRAY("potsWarnPosition", 8, 2, struct_signed_8, NULL),
|
||||
YAML_ARRAY("telemetrySensors", 112, 40, struct_TelemetrySensor, NULL),
|
||||
YAML_PADDING( 8 ),
|
||||
YAML_ARRAY("screens", 192, 4, struct_TelemetryScreenData, NULL),
|
||||
YAML_UNSIGNED( "view", 8 ),
|
||||
YAML_STRING("modelRegistrationID", 8),
|
||||
YAML_END
|
||||
};
|
||||
static const struct YamlNode struct_PartialModel[] = {
|
||||
YAML_STRUCT("header", 96, struct_ModelHeader, NULL),
|
||||
YAML_ARRAY("timers", 88, 3, struct_TimerData, NULL),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
#define MAX_RADIODATA_MODELDATA_PARTIALMODEL_STR_LEN 24
|
||||
|
||||
static const struct YamlNode __RadioData_root_node = YAML_ROOT( struct_RadioData );
|
||||
|
||||
const YamlNode* get_radiodata_nodes()
|
||||
{
|
||||
return &__RadioData_root_node;
|
||||
}
|
||||
static const struct YamlNode __ModelData_root_node = YAML_ROOT( struct_ModelData );
|
||||
|
||||
const YamlNode* get_modeldata_nodes()
|
||||
{
|
||||
return &__ModelData_root_node;
|
||||
}
|
||||
static const struct YamlNode __PartialModel_root_node = YAML_ROOT( struct_PartialModel );
|
||||
|
||||
const YamlNode* get_partialmodel_nodes()
|
||||
{
|
||||
return &__PartialModel_root_node;
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define LEN_ZONE_OPTION_STRING 8
|
||||
|
||||
union ZoneOptionValue
|
||||
{
|
||||
uint32_t unsignedValue;
|
||||
int32_t signedValue;
|
||||
uint32_t boolValue;
|
||||
char stringValue[LEN_ZONE_OPTION_STRING];
|
||||
};
|
||||
|
||||
enum ZoneOptionValueEnum {
|
||||
ZOV_Unsigned=0,
|
||||
ZOV_Signed,
|
||||
ZOV_Bool,
|
||||
ZOV_String,
|
||||
// added for conversion:
|
||||
ZOV_Source,
|
||||
ZOV_Color
|
||||
};
|
||||
|
||||
struct ZoneOption
|
||||
{
|
||||
enum Type {
|
||||
Integer,
|
||||
Source,
|
||||
Bool,
|
||||
String,
|
||||
File,
|
||||
TextSize,
|
||||
Timer,
|
||||
Switch,
|
||||
Color
|
||||
};
|
||||
|
||||
const char * name;
|
||||
Type type;
|
||||
ZoneOptionValue deflt;
|
||||
ZoneOptionValue min;
|
||||
ZoneOptionValue max;
|
||||
};
|
||||
|
||||
struct ZoneOptionValueTyped
|
||||
{
|
||||
ZoneOptionValueEnum type;
|
||||
ZoneOptionValue value;
|
||||
};
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include "opentx.h"
|
||||
#include "../timers.h"
|
||||
#include "model_init.h"
|
||||
|
||||
void eeLoadModel(uint8_t index)
|
||||
{
|
||||
if (index < MAX_MODELS) {
|
||||
preModelLoad();
|
||||
|
||||
uint16_t size = eeLoadModelData(index);
|
||||
|
||||
#if defined(SIMU) && defined(EEPROM_ZONE_SIZE)
|
||||
if (sizeof(uint16_t) + sizeof(g_model) > EEPROM_ZONE_SIZE) {
|
||||
TRACE("Model data size can't exceed %d bytes (%d bytes)", int(EEPROM_ZONE_SIZE-sizeof(uint16_t)), (int)sizeof(g_model));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
if (size > 0 && size != sizeof(g_model)) {
|
||||
TRACE("Model data read=%d bytes vs %d bytes\n", size, (int)sizeof(ModelData));
|
||||
}
|
||||
#endif
|
||||
|
||||
bool alarms = true;
|
||||
if (size < EEPROM_MIN_MODEL_SIZE) { // if not loaded a fair amount
|
||||
setModelDefaults(index);
|
||||
storageCheck(true);
|
||||
alarms = false;
|
||||
}
|
||||
|
||||
postModelLoad(alarms);
|
||||
}
|
||||
}
|
||||
|
||||
void storageClearRadioSettings()
|
||||
{
|
||||
memclear(&g_eeGeneral, sizeof(RadioData));
|
||||
}
|
||||
|
||||
bool storageReadRadioSettings(bool allowFixes)
|
||||
{
|
||||
if (!eepromOpen() || !eeLoadGeneral(allowFixes)) {
|
||||
if (!allowFixes) {
|
||||
storageClearRadioSettings();
|
||||
return false;
|
||||
}
|
||||
storageEraseAll(true);
|
||||
}
|
||||
else {
|
||||
loadModelHeaders();
|
||||
}
|
||||
|
||||
for (uint8_t i=0; languagePacks[i]; i++) {
|
||||
if (!strncmp(g_eeGeneral.ttsLanguage, languagePacks[i]->id, 2)) {
|
||||
currentLanguagePackIdx = i;
|
||||
currentLanguagePack = languagePacks[i];
|
||||
}
|
||||
}
|
||||
|
||||
postRadioSettingsLoad();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void storageReadCurrentModel()
|
||||
{
|
||||
eeLoadModel(g_eeGeneral.currModel);
|
||||
}
|
||||
|
||||
void storageReadAll()
|
||||
{
|
||||
storageReadRadioSettings();
|
||||
storageReadCurrentModel();
|
||||
}
|
||||
|
||||
void storageEraseAll(bool warn)
|
||||
{
|
||||
TRACE("storageEraseAll");
|
||||
|
||||
generalDefault();
|
||||
setModelDefaults();
|
||||
|
||||
if (warn) {
|
||||
ALERT(STR_STORAGE_WARNING, STR_BAD_RADIO_DATA, AU_BAD_RADIODATA);
|
||||
}
|
||||
|
||||
RAISE_ALERT(STR_STORAGE_WARNING, STR_STORAGE_FORMAT, nullptr, AU_NONE);
|
||||
|
||||
storageFormat();
|
||||
storageDirty(EE_GENERAL|EE_MODEL);
|
||||
storageCheck(true);
|
||||
}
|
||||
|
||||
void checkModelIdUnique(uint8_t index, uint8_t module)
|
||||
{
|
||||
if (isModuleXJTD8(module))
|
||||
return;
|
||||
|
||||
uint8_t modelId = g_model.header.modelId[module];
|
||||
uint8_t additionalOnes = 0;
|
||||
char * name = reusableBuffer.moduleSetup.msg;
|
||||
|
||||
memset(reusableBuffer.moduleSetup.msg, 0, sizeof(reusableBuffer.moduleSetup.msg));
|
||||
|
||||
if (modelId != 0) {
|
||||
for (uint8_t i = 0; i < MAX_MODELS; i++) {
|
||||
if (i != index) {
|
||||
if (modelId == modelHeaders[i].modelId[module]) {
|
||||
if ((WARNING_LINE_LEN - 4 - (name - reusableBuffer.moduleSetup.msg)) > (signed)(modelHeaders[i].name[0] ? zlen(modelHeaders[i].name, LEN_MODEL_NAME) : sizeof(TR_MODEL) + 2)) { // you cannot rely exactly on WARNING_LINE_LEN so using WARNING_LINE_LEN-2 (-2 for the ",")
|
||||
if (reusableBuffer.moduleSetup.msg[0] != '\0') {
|
||||
name = strAppend(name, ", ");
|
||||
}
|
||||
if (modelHeaders[i].name[0] == 0) {
|
||||
name = strAppend(name, STR_MODEL);
|
||||
name = strAppendUnsigned(name+strlen(name), i + 1, 2);
|
||||
}
|
||||
else {
|
||||
name = strAppend(name, modelHeaders[i].name, LEN_MODEL_NAME);
|
||||
}
|
||||
}
|
||||
else {
|
||||
additionalOnes++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (additionalOnes) {
|
||||
name = strAppend(name, " (+");
|
||||
name = strAppendUnsigned(name, additionalOnes);
|
||||
strAppend(name, ")");
|
||||
}
|
||||
|
||||
if (reusableBuffer.moduleSetup.msg[0]) {
|
||||
POPUP_WARNING(STR_MODELIDUSED, reusableBuffer.moduleSetup.msg);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _EEPROM_COMMON_H_
|
||||
#define _EEPROM_COMMON_H_
|
||||
|
||||
#define EEPROM_MIN_MODEL_SIZE 256
|
||||
|
||||
uint16_t eeLoadModelData(uint8_t id);
|
||||
uint16_t eeLoadModelData(uint8_t index, uint8_t* data, unsigned size);
|
||||
void eeWriteModelData(uint8_t index, uint8_t* data, unsigned size, bool immediately);
|
||||
|
||||
uint16_t eeLoadGeneralSettingsData();
|
||||
uint16_t eeLoadGeneralSettingsData(uint8_t* data, unsigned size);
|
||||
void eeWriteGeneralSettingData(uint8_t* data, unsigned size, bool immediately);
|
||||
|
||||
bool eeModelExists(uint8_t id);
|
||||
void eeLoadModel(uint8_t id);
|
||||
uint8_t eeFindEmptyModel(uint8_t id, bool down);
|
||||
void selectModel(uint8_t sub);
|
||||
|
||||
void storageClearRadioSettings();
|
||||
bool storageReadRadioSettings(bool allowFixes = true);
|
||||
void storageReadCurrentModel();
|
||||
|
||||
void checkModelIdUnique(uint8_t index, uint8_t module);
|
||||
|
||||
#if defined(EEPROM_RLC)
|
||||
#include "eeprom_rlc.h"
|
||||
#else
|
||||
#include "eeprom_raw.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
//#include "eeprom_common.h"
|
||||
|
||||
void eepromCheck()
|
||||
{
|
||||
}
|
||||
|
||||
void storageFormat()
|
||||
{
|
||||
}
|
||||
|
||||
bool eepromOpen()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16_t eeLoadModelData(uint8_t index)
|
||||
{
|
||||
modelDefault(index);
|
||||
return sizeof(g_model);
|
||||
}
|
||||
|
||||
bool eeLoadGeneral()
|
||||
{
|
||||
generalDefault();
|
||||
return true;
|
||||
}
|
||||
|
||||
void eeLoadModelName(uint8_t id, char *name)
|
||||
{
|
||||
memclear(name, sizeof(g_model.header.name));
|
||||
}
|
||||
|
||||
bool eeModelExists(uint8_t id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void storageCheck(bool immediately)
|
||||
{
|
||||
}
|
||||
|
||||
void eeLoadModelHeader(uint8_t id, ModelHeader * header)
|
||||
{
|
||||
memclear(header, sizeof(ModelHeader));
|
||||
}
|
||||
|
||||
bool eeCopyModel(uint8_t dst, uint8_t src)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void eeSwapModels(uint8_t id1, uint8_t id2)
|
||||
{
|
||||
}
|
||||
|
||||
void eeDeleteModel(uint8_t idx)
|
||||
{
|
||||
}
|
||||
@@ -1,581 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include "opentx.h"
|
||||
#include "timers.h"
|
||||
#include "conversions/conversions.h"
|
||||
|
||||
#define EEPROM_MARK 0x84697771 /* thanks ;) */
|
||||
#define EEPROM_ZONE_SIZE (8*1024)
|
||||
#define EEPROM_BUFFER_SIZE 256
|
||||
#define EEPROM_FAT_SIZE 128
|
||||
#define EEPROM_MAX_ZONES (EEPROM_SIZE / EEPROM_ZONE_SIZE)
|
||||
#define EEPROM_MAX_FILES (EEPROM_MAX_ZONES - 1)
|
||||
#define FIRST_FILE_AVAILABLE (1+MAX_MODELS)
|
||||
|
||||
PACK(struct EepromHeaderFile
|
||||
{
|
||||
uint8_t zoneIndex:7;
|
||||
uint8_t exists:1;
|
||||
});
|
||||
|
||||
PACK(struct EepromHeader
|
||||
{
|
||||
uint32_t mark;
|
||||
uint32_t index;
|
||||
EepromHeaderFile files[EEPROM_MAX_FILES];
|
||||
});
|
||||
|
||||
PACK(struct EepromFileHeader
|
||||
{
|
||||
uint16_t fileIndex;
|
||||
uint16_t size;
|
||||
});
|
||||
|
||||
EepromHeader eepromHeader __DMA;
|
||||
volatile EepromWriteState eepromWriteState = EEPROM_IDLE;
|
||||
uint8_t eepromWriteZoneIndex = FIRST_FILE_AVAILABLE;
|
||||
uint8_t eepromWriteFileIndex;
|
||||
uint16_t eepromWriteSize;
|
||||
uint8_t * eepromWriteSourceAddr;
|
||||
uint32_t eepromWriteDestinationAddr;
|
||||
uint16_t eepromFatAddr = 0;
|
||||
uint8_t eepromWriteBuffer[EEPROM_BUFFER_SIZE] __DMA;
|
||||
|
||||
void eepromWaitReadStatus()
|
||||
{
|
||||
while (!eepromReadStatus()) { }
|
||||
}
|
||||
|
||||
void eepromWaitTransferComplete()
|
||||
{
|
||||
while (!eepromIsTransferComplete()) { }
|
||||
}
|
||||
|
||||
void eepromEraseBlock(uint32_t address, bool blocking=true)
|
||||
{
|
||||
// TRACE("eepromEraseBlock(%d)", address);
|
||||
|
||||
eepromBlockErase(address);
|
||||
|
||||
if (blocking) {
|
||||
eepromWaitTransferComplete();
|
||||
eepromWaitReadStatus();
|
||||
}
|
||||
}
|
||||
|
||||
void eepromRead(uint8_t * buffer, size_t address, size_t size)
|
||||
{
|
||||
// TRACE("eepromRead(%p, %d, %d)", buffer, address, size);
|
||||
|
||||
eepromStartRead(buffer, address, size);
|
||||
eepromWaitTransferComplete();
|
||||
}
|
||||
|
||||
void eepromWrite(uint8_t * buffer, size_t address, size_t size, bool blocking=true)
|
||||
{
|
||||
// TRACE("eepromWrite(%p, %d, %d)", buffer, address, size);
|
||||
|
||||
eepromStartWrite(buffer, address, size);
|
||||
|
||||
if (blocking) {
|
||||
eepromWaitTransferComplete();
|
||||
eepromWaitReadStatus();
|
||||
}
|
||||
}
|
||||
|
||||
bool eepromOpen()
|
||||
{
|
||||
TRACE("eepromOpen");
|
||||
|
||||
int32_t bestFatAddr = -1;
|
||||
uint32_t bestFatIndex = 0;
|
||||
eepromFatAddr = 0;
|
||||
while (eepromFatAddr < EEPROM_ZONE_SIZE) {
|
||||
eepromRead((uint8_t *)&eepromHeader, eepromFatAddr, sizeof(eepromHeader.mark) + sizeof(eepromHeader.index));
|
||||
if (eepromHeader.mark == EEPROM_MARK && eepromHeader.index >= bestFatIndex) {
|
||||
bestFatAddr = eepromFatAddr;
|
||||
bestFatIndex = eepromHeader.index;
|
||||
}
|
||||
eepromFatAddr += EEPROM_FAT_SIZE;
|
||||
}
|
||||
if (bestFatAddr >= 0) {
|
||||
eepromFatAddr = bestFatAddr;
|
||||
eepromRead((uint8_t *)&eepromHeader, eepromFatAddr, sizeof(eepromHeader));
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t readFile(int index, uint8_t * data, uint32_t size)
|
||||
{
|
||||
if (eepromHeader.files[index].exists) {
|
||||
EepromFileHeader header;
|
||||
uint32_t address = eepromHeader.files[index].zoneIndex * EEPROM_ZONE_SIZE;
|
||||
eepromRead((uint8_t *)&header, address, sizeof(header));
|
||||
if (size < header.size) {
|
||||
header.size = size;
|
||||
}
|
||||
if (header.size > 0) {
|
||||
eepromRead(data, address + sizeof(header), header.size);
|
||||
size -= header.size;
|
||||
}
|
||||
if (size > 0) {
|
||||
memset(data + header.size, 0, size);
|
||||
}
|
||||
return header.size;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void eepromIncFatAddr()
|
||||
{
|
||||
eepromHeader.index += 1;
|
||||
eepromFatAddr += EEPROM_FAT_SIZE;
|
||||
if (eepromFatAddr >= EEPROM_ZONE_SIZE) {
|
||||
eepromFatAddr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void writeFile(int index, uint8_t * data, uint32_t size)
|
||||
{
|
||||
uint32_t zoneIndex = eepromHeader.files[eepromWriteZoneIndex].zoneIndex;
|
||||
eepromHeader.files[eepromWriteZoneIndex].exists = 0;
|
||||
eepromHeader.files[eepromWriteZoneIndex].zoneIndex = eepromHeader.files[index].zoneIndex;
|
||||
eepromHeader.files[index].exists = (size > 0);
|
||||
eepromHeader.files[index].zoneIndex = zoneIndex;
|
||||
eepromWriteFileIndex = index;
|
||||
eepromWriteSourceAddr = data;
|
||||
eepromWriteSize = size;
|
||||
eepromWriteDestinationAddr = zoneIndex * EEPROM_ZONE_SIZE;
|
||||
eepromWriteState = EEPROM_START_WRITE;
|
||||
eepromWriteZoneIndex += 1;
|
||||
if (eepromWriteZoneIndex >= EEPROM_MAX_FILES) {
|
||||
eepromWriteZoneIndex = FIRST_FILE_AVAILABLE;
|
||||
}
|
||||
eepromIncFatAddr();
|
||||
}
|
||||
|
||||
void eeDeleteModel(uint8_t index)
|
||||
{
|
||||
storageCheck(true);
|
||||
memclear(&modelHeaders[index], sizeof(ModelHeader));
|
||||
writeFile(index+1, (uint8_t *)&g_model, 0);
|
||||
eepromWriteWait();
|
||||
}
|
||||
|
||||
bool eeCopyModel(uint8_t dst, uint8_t src)
|
||||
{
|
||||
storageCheck(true);
|
||||
|
||||
uint32_t eepromWriteSourceAddr = eepromHeader.files[src+1].zoneIndex * EEPROM_ZONE_SIZE;
|
||||
uint32_t eepromWriteDestinationAddr = eepromHeader.files[dst+1].zoneIndex * EEPROM_ZONE_SIZE;
|
||||
|
||||
// erase blocks
|
||||
eepromEraseBlock(eepromWriteDestinationAddr);
|
||||
eepromEraseBlock(eepromWriteDestinationAddr+EEPROM_BLOCK_SIZE);
|
||||
|
||||
// write model
|
||||
for (int pos=0; pos<EEPROM_ZONE_SIZE; pos+=EEPROM_BUFFER_SIZE) {
|
||||
eepromRead(eepromWriteBuffer, eepromWriteSourceAddr+pos, EEPROM_BUFFER_SIZE);
|
||||
eepromWrite(eepromWriteBuffer, eepromWriteDestinationAddr+pos, EEPROM_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
// write FAT
|
||||
eepromHeader.files[dst+1].exists = 1;
|
||||
eepromIncFatAddr();
|
||||
eepromWriteState = EEPROM_WRITE_NEW_FAT;
|
||||
eepromWriteWait();
|
||||
|
||||
modelHeaders[dst] = modelHeaders[src];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void eeSwapModels(uint8_t id1, uint8_t id2)
|
||||
{
|
||||
storageCheck(true);
|
||||
{
|
||||
EepromHeaderFile tmp = eepromHeader.files[id1+1];
|
||||
eepromHeader.files[id1+1] = eepromHeader.files[id2+1];
|
||||
eepromHeader.files[id2+1] = tmp;
|
||||
}
|
||||
eepromIncFatAddr();
|
||||
eepromWriteState = EEPROM_WRITE_NEW_FAT;
|
||||
eepromWriteWait();
|
||||
|
||||
{
|
||||
ModelHeader tmp = modelHeaders[id1];
|
||||
modelHeaders[id1] = modelHeaders[id2];
|
||||
modelHeaders[id2] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
// For conversions ...
|
||||
uint16_t eeLoadGeneralSettingsData()
|
||||
{
|
||||
return readFile(0, (uint8_t *)&g_eeGeneral, sizeof(g_eeGeneral));
|
||||
}
|
||||
|
||||
uint16_t eeLoadModelData(uint8_t index)
|
||||
{
|
||||
return readFile(index+1, (uint8_t *)&g_model, sizeof(g_model));
|
||||
}
|
||||
|
||||
void writeGeneralSettings()
|
||||
{
|
||||
writeFile(0, (uint8_t *)&g_eeGeneral, sizeof(g_eeGeneral));
|
||||
}
|
||||
|
||||
void writeModel(int index)
|
||||
{
|
||||
writeFile(index+1, (uint8_t *)&g_model, sizeof(g_model));
|
||||
}
|
||||
|
||||
bool eeLoadGeneral(bool allowFixes)
|
||||
{
|
||||
eeLoadGeneralSettingsData();
|
||||
|
||||
if (g_eeGeneral.version != EEPROM_VER) {
|
||||
TRACE("EEPROM version %d instead of %d", g_eeGeneral.version, EEPROM_VER);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool eeModelExists(uint8_t id)
|
||||
{
|
||||
return (eepromHeader.files[id+1].exists);
|
||||
}
|
||||
|
||||
void eeLoadModelHeader(uint8_t id, ModelHeader * header)
|
||||
{
|
||||
readFile(id+1, (uint8_t *)header, sizeof(ModelHeader));
|
||||
}
|
||||
|
||||
void storageFormat()
|
||||
{
|
||||
eepromFatAddr = 0;
|
||||
eepromHeader.mark = EEPROM_MARK;
|
||||
eepromHeader.index = 0;
|
||||
for (int i=0; i<EEPROM_MAX_FILES; i++) {
|
||||
eepromHeader.files[i].exists = 0;
|
||||
eepromHeader.files[i].zoneIndex = i+1;
|
||||
}
|
||||
eepromEraseBlock(0);
|
||||
eepromEraseBlock(EEPROM_BLOCK_SIZE);
|
||||
eepromWrite((uint8_t *)&eepromHeader, 0, sizeof(eepromHeader));
|
||||
}
|
||||
|
||||
void eepromWriteWait(EepromWriteState state/* = EEPROM_IDLE*/)
|
||||
{
|
||||
while (eepromWriteState != state) {
|
||||
// Waits a little bit for CS transitions
|
||||
RTOS_WAIT_MS(2);
|
||||
eepromWriteProcess();
|
||||
#ifdef SIMU
|
||||
sleep(5/*ms*/);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void storageCheck(bool immediately)
|
||||
{
|
||||
if (immediately) {
|
||||
eepromWriteWait();
|
||||
}
|
||||
|
||||
assert(eepromWriteState == EEPROM_IDLE);
|
||||
|
||||
if (storageDirtyMsk & EE_GENERAL) {
|
||||
TRACE("eeprom write general");
|
||||
storageDirtyMsk -= EE_GENERAL;
|
||||
writeGeneralSettings();
|
||||
if (immediately)
|
||||
eepromWriteWait();
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
if (storageDirtyMsk & EE_MODEL) {
|
||||
TRACE("eeprom write model");
|
||||
storageDirtyMsk -= EE_MODEL;
|
||||
writeModel(g_eeGeneral.currModel);
|
||||
if (immediately)
|
||||
eepromWriteWait();
|
||||
}
|
||||
}
|
||||
|
||||
void eepromWriteProcess()
|
||||
{
|
||||
// TRACE("eepromWriteProcess(state=%d)", eepromWriteState);
|
||||
|
||||
switch (eepromWriteState) {
|
||||
case EEPROM_ERASING_FILE_BLOCK1:
|
||||
case EEPROM_ERASING_FILE_BLOCK2:
|
||||
case EEPROM_WRITING_BUFFER:
|
||||
case EEPROM_ERASING_FAT_BLOCK:
|
||||
case EEPROM_WRITING_NEW_FAT:
|
||||
if (eepromIsTransferComplete()) {
|
||||
eepromWriteState = EepromWriteState(eepromWriteState + 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case EEPROM_ERASING_FILE_BLOCK1_WAIT:
|
||||
case EEPROM_ERASING_FILE_BLOCK2_WAIT:
|
||||
case EEPROM_WRITING_BUFFER_WAIT:
|
||||
case EEPROM_ERASING_FAT_BLOCK_WAIT:
|
||||
case EEPROM_WRITING_NEW_FAT_WAIT:
|
||||
if (eepromReadStatus()) {
|
||||
eepromWriteState = EepromWriteState(eepromWriteState + 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case EEPROM_START_WRITE:
|
||||
eepromWriteState = EEPROM_ERASING_FILE_BLOCK1;
|
||||
eepromEraseBlock(eepromWriteDestinationAddr, false);
|
||||
break;
|
||||
|
||||
case EEPROM_ERASE_FILE_BLOCK2:
|
||||
eepromWriteState = EEPROM_ERASING_FILE_BLOCK2;
|
||||
eepromEraseBlock(eepromWriteDestinationAddr + EEPROM_BLOCK_SIZE, false);
|
||||
break;
|
||||
|
||||
case EEPROM_WRITE_BUFFER:
|
||||
{
|
||||
EepromFileHeader * header = (EepromFileHeader *)eepromWriteBuffer;
|
||||
header->fileIndex = eepromWriteFileIndex;
|
||||
header->size = eepromWriteSize;
|
||||
uint32_t size = min<uint32_t>(EEPROM_BUFFER_SIZE-sizeof(EepromFileHeader), eepromWriteSize);
|
||||
memcpy(eepromWriteBuffer+sizeof(EepromFileHeader), eepromWriteSourceAddr, size);
|
||||
eepromWriteState = EEPROM_WRITING_BUFFER;
|
||||
eepromWrite(eepromWriteBuffer, eepromWriteDestinationAddr, sizeof(EepromFileHeader)+size, false);
|
||||
eepromWriteSourceAddr += size;
|
||||
eepromWriteDestinationAddr += sizeof(EepromFileHeader)+size;
|
||||
eepromWriteSize -= size;
|
||||
break;
|
||||
}
|
||||
|
||||
case EEPROM_WRITE_NEXT_BUFFER:
|
||||
{
|
||||
uint32_t size = min<uint32_t>(EEPROM_BUFFER_SIZE, eepromWriteSize);
|
||||
if (size > 0) {
|
||||
memcpy(eepromWriteBuffer, eepromWriteSourceAddr, size);
|
||||
eepromWriteState = EEPROM_WRITING_BUFFER;
|
||||
eepromWrite(eepromWriteBuffer, eepromWriteDestinationAddr, size, false);
|
||||
eepromWriteSourceAddr += size;
|
||||
eepromWriteDestinationAddr += size;
|
||||
eepromWriteSize -= size;
|
||||
break;
|
||||
}
|
||||
else if (eepromFatAddr == 0 || eepromFatAddr == EEPROM_BLOCK_SIZE) {
|
||||
eepromWriteState = EEPROM_ERASING_FAT_BLOCK;
|
||||
eepromEraseBlock(eepromFatAddr, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* no break */
|
||||
|
||||
case EEPROM_WRITE_NEW_FAT:
|
||||
eepromWriteState = EEPROM_WRITING_NEW_FAT;
|
||||
eepromWrite((uint8_t *)&eepromHeader, eepromFatAddr, sizeof(eepromHeader), false);
|
||||
break;
|
||||
|
||||
case EEPROM_END_WRITE:
|
||||
eepromWriteState = EEPROM_IDLE;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t eeModelSize(uint8_t index)
|
||||
{
|
||||
uint16_t result = 0;
|
||||
|
||||
if (eepromHeader.files[index+1].exists) {
|
||||
uint32_t address = eepromHeader.files[index+1].zoneIndex * EEPROM_ZONE_SIZE;
|
||||
EepromFileHeader header;
|
||||
eepromRead((uint8_t *)&header, address, sizeof(header));
|
||||
result = header.size;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
FIL archiveFile;
|
||||
UINT written;
|
||||
|
||||
storageCheck(true);
|
||||
|
||||
if (!sdMounted()) {
|
||||
return STR_NO_SDCARD;
|
||||
}
|
||||
|
||||
// check and create folder here
|
||||
strcpy(buf, STR_MODELS_PATH);
|
||||
const char * error = sdCheckAndCreateDirectory(buf);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
|
||||
buf[sizeof(MODELS_PATH)-1] = '/';
|
||||
strcpy(strcat_modelname(&buf[sizeof(MODELS_PATH)], i_fileSrc, 0), STR_MODELS_EXT);
|
||||
|
||||
FRESULT result = f_open(&archiveFile, buf, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
|
||||
uint16_t size = eeModelSize(i_fileSrc);
|
||||
|
||||
*(uint32_t*)&buf[0] = ETX_FOURCC;
|
||||
buf[4] = g_eeGeneral.version;
|
||||
buf[5] = 'M';
|
||||
*(uint16_t*)&buf[6] = size;
|
||||
|
||||
result = f_write(&archiveFile, buf, 8, &written);
|
||||
if (result != FR_OK || written != 8) {
|
||||
f_close(&archiveFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
uint32_t address = eepromHeader.files[i_fileSrc+1].zoneIndex * EEPROM_ZONE_SIZE + sizeof(EepromFileHeader);
|
||||
while (size > 0) {
|
||||
uint16_t blockSize = min<uint16_t>(size, EEPROM_BUFFER_SIZE);
|
||||
eepromRead(eepromWriteBuffer, address, blockSize);
|
||||
result = f_write(&archiveFile, eepromWriteBuffer, blockSize, &written);
|
||||
if (result != FR_OK || written != blockSize) {
|
||||
f_close(&archiveFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
size -= blockSize;
|
||||
address += blockSize;
|
||||
}
|
||||
|
||||
f_close(&archiveFile);
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
FIL restoreFile;
|
||||
UINT read;
|
||||
|
||||
storageCheck(true);
|
||||
|
||||
if (!sdMounted()) {
|
||||
return STR_NO_SDCARD;
|
||||
}
|
||||
|
||||
strcpy(buf, STR_MODELS_PATH);
|
||||
buf[sizeof(MODELS_PATH)-1] = '/';
|
||||
strcpy(&buf[sizeof(MODELS_PATH)], model_name);
|
||||
strcpy(&buf[strlen(buf)], STR_MODELS_EXT);
|
||||
|
||||
FRESULT result = f_open(&restoreFile, buf, FA_OPEN_EXISTING | FA_READ);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
if (f_size(&restoreFile) < 8) {
|
||||
f_close(&restoreFile);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
result = f_read(&restoreFile, (uint8_t *)buf, 8, &read);
|
||||
if (result != FR_OK || read != 8) {
|
||||
f_close(&restoreFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
uint8_t version = (uint8_t)buf[4];
|
||||
if (*(uint32_t*)&buf[0] != ETX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
|
||||
f_close(&restoreFile);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
if (eeModelExists(i_fileDst)) {
|
||||
eeDeleteModel(i_fileDst);
|
||||
}
|
||||
|
||||
uint16_t size = min<uint16_t>(sizeof(g_model), *(uint16_t*)&buf[6]);
|
||||
uint32_t address = eepromHeader.files[i_fileDst+1].zoneIndex * EEPROM_ZONE_SIZE;
|
||||
|
||||
// erase blocks
|
||||
eepromEraseBlock(address);
|
||||
eepromEraseBlock(address+EEPROM_BLOCK_SIZE);
|
||||
|
||||
// write header
|
||||
EepromFileHeader * header = (EepromFileHeader *)eepromWriteBuffer;
|
||||
header->fileIndex = i_fileDst+1;
|
||||
header->size = size;
|
||||
|
||||
int offset = 4;
|
||||
|
||||
// write model
|
||||
do {
|
||||
uint16_t blockSize = min<uint16_t>(size, EEPROM_BUFFER_SIZE-offset);
|
||||
result = f_read(&restoreFile, eepromWriteBuffer+offset, blockSize, &read);
|
||||
if (result != FR_OK || read != blockSize) {
|
||||
f_close(&g_oLogFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
eepromWrite(eepromWriteBuffer, address, blockSize+offset);
|
||||
size -= blockSize;
|
||||
address += EEPROM_BUFFER_SIZE;
|
||||
offset = 0;
|
||||
} while (size > 0);
|
||||
|
||||
// write FAT
|
||||
eepromHeader.files[i_fileDst+1].exists = 1;
|
||||
eepromIncFatAddr();
|
||||
eepromWriteState = EEPROM_WRITE_NEW_FAT;
|
||||
eepromWriteWait();
|
||||
|
||||
eeLoadModelHeader(i_fileDst, &modelHeaders[i_fileDst]);
|
||||
|
||||
#if defined(STORAGE_CONVERSIONS)
|
||||
if (version < EEPROM_VER) {
|
||||
eeConvertModel(i_fileDst, version);
|
||||
eeLoadModel(g_eeGeneral.currModel);
|
||||
}
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
@@ -1,950 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include "opentx.h"
|
||||
#include "../timers.h"
|
||||
|
||||
#include "hal/eeprom_driver.h"
|
||||
#include "storage/eeprom_common.h"
|
||||
#include "storage/eeprom_rlc.h"
|
||||
#include "conversions/conversions.h"
|
||||
|
||||
uint8_t s_write_err = 0; // error reasons
|
||||
RlcFile theFile; //used for any file operation
|
||||
EeFs eeFs;
|
||||
|
||||
blkid_t freeBlocks = 0;
|
||||
|
||||
uint8_t s_sync_write = false;
|
||||
|
||||
static uint8_t EeFsRead(blkid_t blk, uint8_t ofs)
|
||||
{
|
||||
uint8_t byte;
|
||||
eepromReadBlock(&byte, (size_t)(blk*BS+ofs+BLOCKS_OFFSET), 1);
|
||||
return byte;
|
||||
}
|
||||
|
||||
static blkid_t EeFsGetLink(blkid_t blk)
|
||||
{
|
||||
blkid_t ret;
|
||||
eepromReadBlock((uint8_t *)&ret, blk*BS+BLOCKS_OFFSET, sizeof(blkid_t));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void EeFsSetLink(blkid_t blk, blkid_t val)
|
||||
{
|
||||
static blkid_t s_link; // we write asynchronously, then nothing on the stack!
|
||||
s_link = val;
|
||||
eepromWriteBlock((uint8_t *)&s_link, (blk*BS)+BLOCKS_OFFSET, sizeof(blkid_t));
|
||||
}
|
||||
|
||||
static uint8_t EeFsGetDat(blkid_t blk, uint8_t ofs)
|
||||
{
|
||||
return EeFsRead(blk, ofs+sizeof(blkid_t));
|
||||
}
|
||||
|
||||
static void EeFsSetDat(blkid_t blk, uint8_t ofs, uint8_t *buf, uint8_t len)
|
||||
{
|
||||
eepromWriteBlock(buf, (blk*BS)+ofs+sizeof(blkid_t)+BLOCKS_OFFSET, len);
|
||||
}
|
||||
|
||||
static void EeFsFlushFreelist()
|
||||
{
|
||||
eepromWriteBlock((uint8_t *)&eeFs.freeList, offsetof(EeFs, freeList), sizeof(eeFs.freeList));
|
||||
}
|
||||
|
||||
static void EeFsFlushDirEnt(uint8_t i_fileId)
|
||||
{
|
||||
eepromWriteBlock((uint8_t *)&eeFs.files[i_fileId], offsetof(EeFs, files) + sizeof(DirEnt)*i_fileId, sizeof(DirEnt));
|
||||
}
|
||||
|
||||
static void EeFsFlush()
|
||||
{
|
||||
eepromWriteBlock((uint8_t *)&eeFs, 0, sizeof(eeFs));
|
||||
}
|
||||
|
||||
uint16_t EeFsGetFree()
|
||||
{
|
||||
int32_t ret = freeBlocks * (BS-sizeof(blkid_t));
|
||||
ret += eeFs.files[FILE_TMP].size;
|
||||
ret -= eeFs.files[FILE_MODEL(g_eeGeneral.currModel)].size;
|
||||
return (ret > 0 ? ret : 0);
|
||||
}
|
||||
|
||||
/// free one or more blocks
|
||||
static void EeFsFree(blkid_t blk)
|
||||
{
|
||||
blkid_t i = blk;
|
||||
blkid_t tmp;
|
||||
|
||||
freeBlocks++;
|
||||
|
||||
while ((tmp=EeFsGetLink(i))) {
|
||||
i = tmp;
|
||||
freeBlocks++;
|
||||
}
|
||||
|
||||
EeFsSetLink(i, eeFs.freeList);
|
||||
eeFs.freeList = blk; //chain in front
|
||||
EeFsFlushFreelist();
|
||||
}
|
||||
|
||||
void eepromCheck()
|
||||
{
|
||||
ENABLE_SYNC_WRITE(true);
|
||||
|
||||
uint8_t *bufp = (uint8_t *)&g_model;
|
||||
memclear(bufp, BLOCKS);
|
||||
blkid_t blk ;
|
||||
|
||||
blkid_t blocksCount;
|
||||
for (uint8_t i=0; i<=MAXFILES; i++) {
|
||||
blocksCount = 0;
|
||||
blkid_t blk = (i==MAXFILES ? eeFs.freeList : eeFs.files[i].startBlk);
|
||||
blkid_t lastBlk = 0;
|
||||
while (blk) {
|
||||
if (blk < FIRSTBLK || // bad blk index
|
||||
blk >= BLOCKS || // bad blk indexchan
|
||||
bufp[blk]) // blk double usage
|
||||
{
|
||||
if (lastBlk) {
|
||||
EeFsSetLink(lastBlk, 0);
|
||||
}
|
||||
else {
|
||||
EeFsFlush();
|
||||
}
|
||||
blk = 0; // abort
|
||||
}
|
||||
else {
|
||||
blocksCount++;
|
||||
bufp[blk] = i+1;
|
||||
lastBlk = blk;
|
||||
blk = EeFsGetLink(blk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
freeBlocks = blocksCount;
|
||||
|
||||
for (blk=FIRSTBLK; blk<BLOCKS; blk++) {
|
||||
if (!bufp[blk]) { // unused block
|
||||
freeBlocks++;
|
||||
EeFsSetLink(blk, eeFs.freeList);
|
||||
eeFs.freeList = blk; // chain in front
|
||||
EeFsFlushFreelist();
|
||||
}
|
||||
}
|
||||
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
}
|
||||
|
||||
#if !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
|
||||
void storageFormat()
|
||||
{
|
||||
ENABLE_SYNC_WRITE(true);
|
||||
|
||||
#if defined(SIMU)
|
||||
// write zero to the end of the new EEPROM file to set it's proper size
|
||||
static uint8_t dummy = 0;
|
||||
eepromWriteBlock(&dummy, EEPROM_SIZE-1, 1);
|
||||
#endif
|
||||
|
||||
memclear(&eeFs, sizeof(eeFs));
|
||||
eeFs.version = EEFS_VERS;
|
||||
eeFs.mySize = sizeof(eeFs);
|
||||
eeFs.freeList = 0;
|
||||
eeFs.bs = BS;
|
||||
for (blkid_t i=FIRSTBLK; i<BLOCKS-1; i++) {
|
||||
EeFsSetLink(i, i+1);
|
||||
}
|
||||
EeFsSetLink(BLOCKS-1, 0);
|
||||
eeFs.freeList = FIRSTBLK;
|
||||
freeBlocks = BLOCKS;
|
||||
EeFsFlush();
|
||||
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool eepromOpen()
|
||||
{
|
||||
eepromReadBlock((uint8_t *)&eeFs, 0, sizeof(eeFs));
|
||||
|
||||
#if defined(SIMU)
|
||||
if (eeFs.version != EEFS_VERS) {
|
||||
TRACE("bad eeFs.version (%d instead of %d)", eeFs.version, EEFS_VERS);
|
||||
}
|
||||
if (eeFs.mySize != sizeof(eeFs)) {
|
||||
TRACE("bad eeFs.mySize (%d instead of %d)", (int)eeFs.mySize, (int)sizeof(eeFs));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (eeFs.version != EEFS_VERS || eeFs.mySize != sizeof(eeFs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
eepromCheck();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EFile::exists(uint8_t i_fileId)
|
||||
{
|
||||
return eeFs.files[i_fileId].startBlk;
|
||||
}
|
||||
|
||||
/*
|
||||
* Swap two files in eeprom
|
||||
*/
|
||||
void EFile::swap(uint8_t i_fileId1, uint8_t i_fileId2)
|
||||
{
|
||||
DirEnt tmp = eeFs.files[i_fileId1];
|
||||
eeFs.files[i_fileId1] = eeFs.files[i_fileId2];
|
||||
eeFs.files[i_fileId2] = tmp;
|
||||
|
||||
ENABLE_SYNC_WRITE(true);
|
||||
EeFsFlushDirEnt(i_fileId1);
|
||||
EeFsFlushDirEnt(i_fileId2);
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
}
|
||||
|
||||
void EFile::rm(uint8_t i_fileId)
|
||||
{
|
||||
blkid_t i = eeFs.files[i_fileId].startBlk;
|
||||
memclear(&eeFs.files[i_fileId], sizeof(eeFs.files[i_fileId]));
|
||||
ENABLE_SYNC_WRITE(true);
|
||||
EeFsFlushDirEnt(i_fileId);
|
||||
if (i) EeFsFree(i); //chain in
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open file i_fileId for reading.
|
||||
* Return the file's type
|
||||
*/
|
||||
void EFile::openRd(uint8_t i_fileId)
|
||||
{
|
||||
m_fileId = i_fileId;
|
||||
m_pos = 0;
|
||||
m_currBlk = eeFs.files[m_fileId].startBlk;
|
||||
m_ofs = 0;
|
||||
s_write_err = ERR_NONE; // error reasons */
|
||||
}
|
||||
|
||||
void RlcFile::openRlc(uint8_t i_fileId)
|
||||
{
|
||||
EFile::openRd(i_fileId);
|
||||
m_zeroes = 0;
|
||||
m_bRlc = 0;
|
||||
}
|
||||
|
||||
uint8_t EFile::read(uint8_t *buf, uint8_t i_len)
|
||||
{
|
||||
uint16_t len = eeFs.files[m_fileId].size - m_pos;
|
||||
if (i_len > len) i_len = len;
|
||||
|
||||
uint8_t remaining = i_len;
|
||||
while (remaining) {
|
||||
if (!m_currBlk) break;
|
||||
|
||||
*buf++ = EeFsGetDat(m_currBlk, m_ofs++);
|
||||
if (m_ofs >= BS-sizeof(blkid_t)) {
|
||||
m_ofs = 0;
|
||||
m_currBlk = EeFsGetLink(m_currBlk);
|
||||
}
|
||||
remaining--;
|
||||
}
|
||||
|
||||
i_len -= remaining;
|
||||
m_pos += i_len;
|
||||
return i_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read runlength (RLE) compressed bytes into buf.
|
||||
*/
|
||||
uint16_t RlcFile::readRlc(uint8_t *buf, uint16_t i_len)
|
||||
{
|
||||
uint16_t i = 0;
|
||||
for( ; 1; ) {
|
||||
uint8_t ln = min<uint16_t>(m_zeroes, i_len-i);
|
||||
memclear(&buf[i], ln);
|
||||
i += ln;
|
||||
m_zeroes -= ln;
|
||||
if (m_zeroes)
|
||||
break;
|
||||
|
||||
ln = min<uint16_t>(m_bRlc, i_len-i);
|
||||
uint8_t lr = read(&buf[i], ln);
|
||||
i += lr ;
|
||||
m_bRlc -= lr;
|
||||
if (m_bRlc) break;
|
||||
|
||||
if (read(&m_bRlc, 1) != 1)
|
||||
break; // read how many bytes to read
|
||||
|
||||
assert(m_bRlc & 0x7f);
|
||||
|
||||
if (m_bRlc&0x80) { // if contains high byte
|
||||
m_zeroes =(m_bRlc>>4) & 0x7;
|
||||
m_bRlc = m_bRlc & 0x0f;
|
||||
}
|
||||
else if (m_bRlc&0x40) {
|
||||
m_zeroes = m_bRlc & 0x3f;
|
||||
m_bRlc = 0;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
void RlcFile::write1(uint8_t b)
|
||||
{
|
||||
m_write1_byte = b;
|
||||
write(&m_write1_byte, 1);
|
||||
}
|
||||
|
||||
void RlcFile::write(uint8_t *buf, uint8_t i_len)
|
||||
{
|
||||
m_write_len = i_len;
|
||||
m_write_buf = buf;
|
||||
|
||||
do {
|
||||
nextWriteStep();
|
||||
} while (IS_SYNC_WRITE_ENABLE() && m_write_len && !s_write_err);
|
||||
}
|
||||
|
||||
void RlcFile::nextWriteStep()
|
||||
{
|
||||
if (!m_currBlk && m_pos==0) {
|
||||
eeFs.files[FILE_TMP].startBlk = m_currBlk = eeFs.freeList;
|
||||
if (m_currBlk) {
|
||||
freeBlocks--;
|
||||
eeFs.freeList = EeFsGetLink(m_currBlk);
|
||||
m_write_step |= WRITE_FIRST_LINK;
|
||||
EeFsFlushFreelist();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_write_step & 0x0f) == WRITE_FIRST_LINK) {
|
||||
m_write_step -= WRITE_FIRST_LINK;
|
||||
EeFsSetLink(m_currBlk, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
while (m_write_len) {
|
||||
if (!m_currBlk) {
|
||||
s_write_err = ERR_FULL;
|
||||
break;
|
||||
}
|
||||
if (m_ofs >= (BS-sizeof(blkid_t))) {
|
||||
m_ofs = 0;
|
||||
blkid_t nextBlk = EeFsGetLink(m_currBlk);
|
||||
if (!nextBlk) {
|
||||
if (!eeFs.freeList) {
|
||||
s_write_err = ERR_FULL;
|
||||
break;
|
||||
}
|
||||
m_write_step += WRITE_NEXT_LINK_1;
|
||||
EeFsSetLink(m_currBlk, eeFs.freeList);
|
||||
// TODO not good
|
||||
return;
|
||||
}
|
||||
m_currBlk = nextBlk;
|
||||
}
|
||||
switch (m_write_step & 0x0f) {
|
||||
case WRITE_NEXT_LINK_1:
|
||||
m_currBlk = eeFs.freeList;
|
||||
freeBlocks--;
|
||||
eeFs.freeList = EeFsGetLink(eeFs.freeList);
|
||||
m_write_step += 1;
|
||||
EeFsFlushFreelist();
|
||||
return;
|
||||
case WRITE_NEXT_LINK_2:
|
||||
m_write_step -= WRITE_NEXT_LINK_2;
|
||||
EeFsSetLink(m_currBlk, 0);
|
||||
return;
|
||||
}
|
||||
uint8_t tmp = BS-sizeof(blkid_t)-m_ofs; if(tmp>m_write_len) tmp = m_write_len;
|
||||
m_write_buf += tmp;
|
||||
m_write_len -= tmp;
|
||||
m_ofs += tmp;
|
||||
m_pos += tmp;
|
||||
EeFsSetDat(m_currBlk, m_ofs-tmp, m_write_buf-tmp, tmp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (s_write_err == ERR_FULL) {
|
||||
POPUP_WARNING(STR_EEPROMOVERFLOW);
|
||||
m_write_step = 0;
|
||||
m_write_len = 0;
|
||||
m_cur_rlc_len = 0;
|
||||
}
|
||||
else if (!IS_SYNC_WRITE_ENABLE()) {
|
||||
nextRlcWriteStep();
|
||||
}
|
||||
}
|
||||
|
||||
void RlcFile::create(uint8_t i_fileId, uint8_t typ, uint8_t sync_write)
|
||||
{
|
||||
// all write operations will be executed on FILE_TMP
|
||||
openRlc(FILE_TMP); // internal use
|
||||
eeFs.files[FILE_TMP].typ = typ;
|
||||
eeFs.files[FILE_TMP].size = 0;
|
||||
m_fileId = i_fileId;
|
||||
ENABLE_SYNC_WRITE(sync_write);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy file src to dst
|
||||
*/
|
||||
bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc)
|
||||
{
|
||||
EFile theFile2;
|
||||
theFile2.openRd(i_fileSrc);
|
||||
|
||||
create(i_fileDst, FILE_TYP_MODEL/*optimization, only model files are copied. should be eeFs.files[i_fileSrc].typ*/, true);
|
||||
|
||||
uint8_t buf[BS-sizeof(blkid_t)];
|
||||
uint8_t len;
|
||||
while ((len=theFile2.read(buf, sizeof(buf))))
|
||||
{
|
||||
write(buf, len);
|
||||
if (write_errno() != 0) {
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
blkid_t fri=0;
|
||||
if (m_currBlk && (fri=EeFsGetLink(m_currBlk)))
|
||||
EeFsSetLink(m_currBlk, 0);
|
||||
|
||||
if (fri) EeFsFree(fri); //chain in
|
||||
|
||||
eeFs.files[FILE_TMP].size = m_pos;
|
||||
EFile::swap(m_fileId, FILE_TMP);
|
||||
|
||||
assert(!m_write_step);
|
||||
|
||||
// s_sync_write is set to false in swap();
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(SDCARD) && !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
|
||||
const char * eeBackupModel(uint8_t i_fileSrc)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
UINT written;
|
||||
|
||||
// we must close the logs as we reuse the same FIL structure
|
||||
logsClose();
|
||||
|
||||
// check and create folder here
|
||||
strcpy(buf, STR_MODELS_PATH);
|
||||
const char * error = sdCheckAndCreateDirectory(buf);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
|
||||
buf[sizeof(MODELS_PATH)-1] = '/';
|
||||
eeLoadModelName(i_fileSrc, &buf[sizeof(MODELS_PATH)]);
|
||||
buf[sizeof(MODELS_PATH)+sizeof(g_model.header.name)] = '\0';
|
||||
|
||||
uint8_t i = sizeof(MODELS_PATH)+sizeof(g_model.header.name)-1;
|
||||
uint8_t len = 0;
|
||||
while (i > sizeof(MODELS_PATH)-1) {
|
||||
if (!len && buf[i])
|
||||
len = i+1;
|
||||
if (len) {
|
||||
if (!buf[i])
|
||||
buf[i] = '_';
|
||||
}
|
||||
i--;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
uint8_t num = i_fileSrc + 1;
|
||||
strcpy(&buf[sizeof(MODELS_PATH)], STR_MODEL);
|
||||
buf[sizeof(MODELS_PATH) + PSIZE(TR_MODEL)] = (char)((num / 10) + '0');
|
||||
buf[sizeof(MODELS_PATH) + PSIZE(TR_MODEL) + 1] = (char)((num % 10) + '0');
|
||||
len = sizeof(MODELS_PATH) + PSIZE(TR_MODEL) + 2;
|
||||
}
|
||||
|
||||
#if defined(RTCLOCK)
|
||||
char * tmp = strAppendDate(&buf[len]);
|
||||
len = tmp - buf;
|
||||
#endif
|
||||
|
||||
strcpy(&buf[len], STR_MODELS_EXT);
|
||||
|
||||
#ifdef SIMU
|
||||
TRACE("SD-card backup filename=%s", buf);
|
||||
#endif
|
||||
|
||||
FRESULT result = f_open(&g_oLogFile, buf, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
EFile theFile2;
|
||||
theFile2.openRd(FILE_MODEL(i_fileSrc));
|
||||
|
||||
*(uint32_t*)&buf[0] = ETX_FOURCC;
|
||||
buf[4] = g_eeGeneral.version;
|
||||
buf[5] = 'M';
|
||||
*(uint16_t*)&buf[6] = eeModelSize(i_fileSrc);
|
||||
|
||||
result = f_write(&g_oLogFile, buf, 8, &written);
|
||||
if (result != FR_OK || written != 8) {
|
||||
f_close(&g_oLogFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
while ((len=theFile2.read((uint8_t *)buf, 15))) {
|
||||
result = f_write(&g_oLogFile, (uint8_t *)buf, len, &written);
|
||||
if (result != FR_OK || written != len) {
|
||||
f_close(&g_oLogFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
}
|
||||
|
||||
f_close(&g_oLogFile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name)
|
||||
{
|
||||
char * buf = reusableBuffer.modelsel.mainname;
|
||||
UINT read;
|
||||
|
||||
// we must close the logs as we reuse the same FIL structure
|
||||
logsClose();
|
||||
|
||||
strcpy(buf, STR_MODELS_PATH);
|
||||
buf[sizeof(MODELS_PATH)-1] = '/';
|
||||
strcpy(&buf[sizeof(MODELS_PATH)], model_name);
|
||||
strcpy(&buf[strlen(buf)], STR_MODELS_EXT);
|
||||
|
||||
FRESULT result = f_open(&g_oLogFile, buf, FA_OPEN_EXISTING | FA_READ);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
if (f_size(&g_oLogFile) < 8) {
|
||||
f_close(&g_oLogFile);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
result = f_read(&g_oLogFile, (uint8_t *)buf, 8, &read);
|
||||
if (result != FR_OK || read != 8) {
|
||||
f_close(&g_oLogFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
uint8_t version = (uint8_t)buf[4];
|
||||
if (*(uint32_t*)&buf[0] != ETX_FOURCC || version < FIRST_CONV_EEPROM_VER || version > EEPROM_VER || buf[5] != 'M') {
|
||||
f_close(&g_oLogFile);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
if (eeModelExists(i_fileDst)) {
|
||||
eeDeleteModel(i_fileDst);
|
||||
}
|
||||
|
||||
theFile.create(FILE_MODEL(i_fileDst), FILE_TYP_MODEL, true);
|
||||
|
||||
do {
|
||||
result = f_read(&g_oLogFile, (uint8_t *)buf, 15, &read);
|
||||
if (result != FR_OK) {
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
f_close(&g_oLogFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
if (read > 0) {
|
||||
theFile.write((uint8_t *)buf, read);
|
||||
if (write_errno() != 0) {
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
f_close(&g_oLogFile);
|
||||
return STR_EEPROMOVERFLOW;
|
||||
}
|
||||
}
|
||||
} while (read == 15);
|
||||
|
||||
blkid_t fri=0;
|
||||
if (theFile.m_currBlk && (fri=EeFsGetLink(theFile.m_currBlk)))
|
||||
EeFsSetLink(theFile.m_currBlk, 0);
|
||||
|
||||
if (fri) EeFsFree(fri); //chain in
|
||||
|
||||
eeFs.files[FILE_TMP].size = theFile.m_pos;
|
||||
EFile::swap(theFile.m_fileId, FILE_TMP); // s_sync_write is set to false in swap();
|
||||
|
||||
f_close(&g_oLogFile);
|
||||
|
||||
#if defined(STORAGE_CONVERSIONS)
|
||||
if (version < EEPROM_VER) {
|
||||
storageCheck(true);
|
||||
eeConvertModel(i_fileDst, version);
|
||||
eeLoadModel(g_eeGeneral.currModel);
|
||||
}
|
||||
#endif
|
||||
|
||||
eeLoadModelHeader(i_fileDst, &modelHeaders[i_fileDst]);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
void RlcFile::writeRlc(uint8_t i_fileId, uint8_t typ, uint8_t *buf, uint16_t i_len, uint8_t sync_write)
|
||||
{
|
||||
create(i_fileId, typ, sync_write);
|
||||
|
||||
m_write_step = WRITE_START_STEP;
|
||||
m_rlc_buf = buf;
|
||||
m_rlc_len = i_len;
|
||||
m_cur_rlc_len = 0;
|
||||
|
||||
do {
|
||||
nextRlcWriteStep();
|
||||
} while (IS_SYNC_WRITE_ENABLE() && m_write_step && !s_write_err);
|
||||
}
|
||||
|
||||
void RlcFile::nextRlcWriteStep()
|
||||
{
|
||||
uint8_t cnt = 1;
|
||||
uint8_t cnt0 = 0;
|
||||
uint16_t i = 0;
|
||||
|
||||
if (m_cur_rlc_len) {
|
||||
uint8_t tmp1 = m_cur_rlc_len;
|
||||
uint8_t *tmp2 = m_rlc_buf;
|
||||
m_rlc_buf += m_cur_rlc_len;
|
||||
m_cur_rlc_len = 0;
|
||||
write(tmp2, tmp1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_rlc_len>0) {
|
||||
|
||||
bool run0 = (m_rlc_buf[0] == 0);
|
||||
|
||||
for (i=1; 1; i++) {
|
||||
bool cur0 = (i<m_rlc_len) ? (m_rlc_buf[i] == 0) : false;
|
||||
if (cur0 != run0 || cnt==0x3f || (cnt0 && cnt==0x0f) || i==m_rlc_len) {
|
||||
if (run0) {
|
||||
assert(cnt0==0);
|
||||
if (cnt<8 && i!=m_rlc_len)
|
||||
cnt0 = cnt; //aufbew fuer spaeter
|
||||
else {
|
||||
m_rlc_buf+=cnt;
|
||||
m_rlc_len-=cnt;
|
||||
write1(cnt|0x40);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_rlc_buf+=cnt0;
|
||||
m_rlc_len-=cnt0+cnt;
|
||||
m_cur_rlc_len=cnt;
|
||||
if(cnt0){
|
||||
write1(0x80 | (cnt0<<4) | cnt);
|
||||
}
|
||||
else{
|
||||
write1(cnt);
|
||||
}
|
||||
return;
|
||||
}
|
||||
cnt=0;
|
||||
if (i==m_rlc_len) break;
|
||||
run0 = cur0;
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
switch(m_write_step) {
|
||||
case WRITE_START_STEP: {
|
||||
blkid_t fri = 0;
|
||||
|
||||
if (m_currBlk && (fri = EeFsGetLink(m_currBlk))) {
|
||||
// TODO reuse EeFsFree!!!
|
||||
blkid_t prev_freeList = eeFs.freeList;
|
||||
eeFs.freeList = fri;
|
||||
freeBlocks++;
|
||||
while (EeFsGetLink(fri)) {
|
||||
fri = EeFsGetLink(fri);
|
||||
freeBlocks++;
|
||||
}
|
||||
m_write_step = WRITE_FREE_UNUSED_BLOCKS_STEP1;
|
||||
EeFsSetLink(fri, prev_freeList);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
case WRITE_FINAL_DIRENT_STEP: {
|
||||
m_currBlk = eeFs.files[FILE_TMP].startBlk;
|
||||
DirEnt & f = eeFs.files[m_fileId];
|
||||
eeFs.files[FILE_TMP].startBlk = f.startBlk;
|
||||
eeFs.files[FILE_TMP].size = f.size;
|
||||
f.startBlk = m_currBlk;
|
||||
f.size = m_pos;
|
||||
f.typ = eeFs.files[FILE_TMP].typ;
|
||||
m_write_step = WRITE_TMP_DIRENT_STEP;
|
||||
EeFsFlushDirEnt(m_fileId);
|
||||
return;
|
||||
}
|
||||
|
||||
case WRITE_TMP_DIRENT_STEP:
|
||||
m_write_step = 0;
|
||||
EeFsFlushDirEnt(FILE_TMP);
|
||||
return;
|
||||
|
||||
case WRITE_FREE_UNUSED_BLOCKS_STEP1:
|
||||
m_write_step = WRITE_FREE_UNUSED_BLOCKS_STEP2;
|
||||
EeFsSetLink(m_currBlk, 0);
|
||||
return;
|
||||
|
||||
case WRITE_FREE_UNUSED_BLOCKS_STEP2:
|
||||
m_write_step = WRITE_FINAL_DIRENT_STEP;
|
||||
EeFsFlushFreelist();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void RlcFile::flush()
|
||||
{
|
||||
while (!eepromIsTransferComplete())
|
||||
WDG_RESET();
|
||||
|
||||
ENABLE_SYNC_WRITE(true);
|
||||
|
||||
while (m_write_len && !s_write_err)
|
||||
nextWriteStep();
|
||||
|
||||
while (isWriting() && !s_write_err)
|
||||
nextRlcWriteStep();
|
||||
|
||||
ENABLE_SYNC_WRITE(false);
|
||||
}
|
||||
|
||||
static uint16_t eeLoadData(uint8_t idx, uint8_t* data, unsigned size)
|
||||
{
|
||||
memset(data, 0, size);
|
||||
theFile.openRlc(idx);
|
||||
return theFile.readRlc(data, size);
|
||||
}
|
||||
|
||||
static void eeWriteData(uint8_t idx, uint8_t typ, uint8_t* data,
|
||||
unsigned size, bool immediately)
|
||||
{
|
||||
theFile.writeRlc(idx, typ, data, size, immediately);
|
||||
}
|
||||
|
||||
// For conversions ...
|
||||
void eeWriteGeneralSettingData(uint8_t* data, unsigned size, bool immediately)
|
||||
{
|
||||
eeWriteData(FILE_GENERAL, FILE_TYP_GENERAL, data, size, immediately);
|
||||
}
|
||||
|
||||
uint16_t eeLoadGeneralSettingsData(uint8_t* data, unsigned size)
|
||||
{
|
||||
return eeLoadData(FILE_GENERAL, data, size);
|
||||
}
|
||||
|
||||
uint16_t eeLoadGeneralSettingsData()
|
||||
{
|
||||
return eeLoadGeneralSettingsData((uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral));
|
||||
}
|
||||
|
||||
void eeWriteModelData(uint8_t index, uint8_t* data, unsigned size, bool immediately)
|
||||
{
|
||||
eeWriteData(FILE_MODEL(index), FILE_TYP_MODEL, data, size, immediately);
|
||||
}
|
||||
|
||||
uint16_t eeLoadModelData(uint8_t index, uint8_t* data, unsigned size)
|
||||
{
|
||||
return eeLoadData(FILE_MODEL(index), data, size);
|
||||
}
|
||||
|
||||
uint16_t eeLoadModelData(uint8_t index)
|
||||
{
|
||||
return eeLoadModelData(index, (uint8_t*)&g_model, sizeof(g_model));
|
||||
}
|
||||
|
||||
bool eeLoadGeneral(bool allowFixes)
|
||||
{
|
||||
theFile.openRlc(FILE_GENERAL);
|
||||
|
||||
uint8_t versions[3];
|
||||
uint16_t* variant = (uint16_t*)&versions[1];
|
||||
|
||||
if (theFile.readRlc(versions, 3) == 3 && versions[0] == EEPROM_VER) {
|
||||
theFile.openRlc(FILE_GENERAL);
|
||||
if (theFile.readRlc((uint8_t *)&g_eeGeneral, sizeof(g_eeGeneral)) <=
|
||||
sizeof(g_eeGeneral) &&
|
||||
*variant == EEPROM_VARIANT) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(STORAGE_CONVERSIONS)
|
||||
if (versions[0] != EEPROM_VER) {
|
||||
TRACE("EEPROM version %d instead of %d", versions[0], EEPROM_VER);
|
||||
if (!allowFixes)
|
||||
return false; // prevent eeprom from being wiped
|
||||
if (!eeConvert(versions[0]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
TRACE("EEPROM version %d (%d) instead of %d (%d)", versions[0], *variant,
|
||||
EEPROM_VER, EEPROM_VARIANT);
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void eeLoadModelName(uint8_t id, char *name)
|
||||
{
|
||||
memclear(name, sizeof(g_model.header.name));
|
||||
if (id < MAX_MODELS) {
|
||||
theFile.openRlc(FILE_MODEL(id));
|
||||
theFile.readRlc((uint8_t*)name, sizeof(g_model.header.name));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SDCARD_RAW) || defined(SDCARD_YAML)
|
||||
bool eeModelExistsRlc(uint8_t id)
|
||||
#else
|
||||
bool eeModelExists(uint8_t id)
|
||||
#endif
|
||||
{
|
||||
return EFile::exists(FILE_MODEL(id));
|
||||
}
|
||||
|
||||
#if !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
|
||||
void storageCheck(bool immediately)
|
||||
{
|
||||
if (immediately) {
|
||||
eeFlush();
|
||||
}
|
||||
|
||||
if (storageDirtyMsk & EE_GENERAL) {
|
||||
TRACE("eeprom write general");
|
||||
storageDirtyMsk -= EE_GENERAL;
|
||||
theFile.writeRlc(FILE_GENERAL, FILE_TYP_GENERAL, (uint8_t*)&g_eeGeneral, sizeof(g_eeGeneral), immediately);
|
||||
if (!immediately) return;
|
||||
}
|
||||
|
||||
if (storageDirtyMsk & EE_MODEL) {
|
||||
TRACE("eeprom write model");
|
||||
storageDirtyMsk = 0;
|
||||
theFile.writeRlc(FILE_MODEL(g_eeGeneral.currModel), FILE_TYP_MODEL, (uint8_t*)&g_model, sizeof(g_model), immediately);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void eeLoadModelHeader(uint8_t id, ModelHeader *header)
|
||||
{
|
||||
memclear(header, sizeof(ModelHeader));
|
||||
if (id < MAX_MODELS) {
|
||||
theFile.openRlc(FILE_MODEL(id));
|
||||
theFile.readRlc((uint8_t*)header, sizeof(ModelHeader));
|
||||
}
|
||||
}
|
||||
|
||||
bool eeCopyModel(uint8_t dst, uint8_t src)
|
||||
{
|
||||
if (theFile.copy(FILE_MODEL(dst), FILE_MODEL(src))) {
|
||||
memcpy(&modelHeaders[dst], &modelHeaders[src], sizeof(ModelHeader));
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void eeSwapModels(uint8_t id1, uint8_t id2)
|
||||
{
|
||||
EFile::swap(FILE_MODEL(id1), FILE_MODEL(id2));
|
||||
|
||||
char tmp[sizeof(g_model.header)];
|
||||
memcpy(tmp, &modelHeaders[id1], sizeof(ModelHeader));
|
||||
memcpy(&modelHeaders[id1], &modelHeaders[id2], sizeof(ModelHeader));
|
||||
memcpy(&modelHeaders[id2], tmp, sizeof(ModelHeader));
|
||||
}
|
||||
|
||||
void eeDeleteModel(uint8_t idx)
|
||||
{
|
||||
EFile::rm(FILE_MODEL(idx));
|
||||
memset(&modelHeaders[idx], 0, sizeof(ModelHeader));
|
||||
}
|
||||
|
||||
#if defined(SDCARD)
|
||||
void eepromBackup()
|
||||
{
|
||||
char path[60];
|
||||
uint8_t buffer[1024];
|
||||
FIL file;
|
||||
|
||||
// reset unexpectedShutdown to prevent warning when user restores EEPROM backup
|
||||
g_eeGeneral.unexpectedShutdown = 0;
|
||||
storageDirty(EE_GENERAL);
|
||||
storageCheck(true);
|
||||
|
||||
// create the directory if needed...
|
||||
const char * error = sdCheckAndCreateDirectory(EEPROMS_PATH);
|
||||
if (error) {
|
||||
POPUP_WARNING(error);
|
||||
return;
|
||||
}
|
||||
|
||||
// prepare the filename...
|
||||
char * tmp = strAppend(path, EEPROMS_PATH "/eeprom");
|
||||
#if defined(RTCLOCK)
|
||||
tmp = strAppendDate(tmp, true);
|
||||
#endif
|
||||
strAppend(tmp, EEPROM_EXT);
|
||||
|
||||
// open the file for writing...
|
||||
f_open(&file, path, FA_WRITE | FA_CREATE_ALWAYS);
|
||||
|
||||
for (int i=0; i<EEPROM_SIZE; i+=1024) {
|
||||
UINT count;
|
||||
eepromReadBlock(buffer, i, 1024);
|
||||
f_write(&file, buffer, 1024, &count);
|
||||
drawProgressScreen("EEPROM Backup", STR_WRITING, i, EEPROM_SIZE);
|
||||
#if defined(SIMU)
|
||||
// add an artificial delay and check for simu quit
|
||||
if (SIMU_SLEEP_OR_EXIT_MS(100))
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
f_close(&file);
|
||||
|
||||
//set back unexpectedShutdown
|
||||
g_eeGeneral.unexpectedShutdown = 1;
|
||||
storageDirty(EE_GENERAL);
|
||||
storageCheck(true);
|
||||
}
|
||||
#endif
|
||||
@@ -1,213 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _EEPROM_RLC_H_
|
||||
#define _EEPROM_RLC_H_
|
||||
|
||||
#include "definitions.h"
|
||||
|
||||
#define blkid_t uint16_t
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 62
|
||||
#define BS 64
|
||||
|
||||
PACK(struct DirEnt {
|
||||
blkid_t startBlk;
|
||||
uint16_t size:12;
|
||||
uint16_t typ:4;
|
||||
});
|
||||
|
||||
#define EEFS_EXTRA_FIELDS uint8_t spare[2];
|
||||
|
||||
PACK(struct EeFs {
|
||||
uint8_t version;
|
||||
blkid_t mySize;
|
||||
blkid_t freeList;
|
||||
uint8_t bs;
|
||||
EEFS_EXTRA_FIELDS
|
||||
DirEnt files[MAXFILES];
|
||||
});
|
||||
|
||||
extern EeFs eeFs;
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
|
||||
/// fileId of general file
|
||||
#define FILE_GENERAL 0
|
||||
/// convert model number 0..MAX_MODELS-1 int fileId
|
||||
#define FILE_MODEL(n) (1+(n))
|
||||
#define FILE_TMP (1+MAX_MODELS)
|
||||
|
||||
#define RESV sizeof(EeFs) //reserv for eeprom header with directory (eeFs)
|
||||
|
||||
#define FIRSTBLK 1
|
||||
#define BLOCKS (1+(EEPROM_SIZE-RESV)/BS)
|
||||
#define BLOCKS_OFFSET (RESV-BS)
|
||||
|
||||
uint16_t EeFsGetFree();
|
||||
|
||||
class EFile
|
||||
{
|
||||
public:
|
||||
|
||||
///remove contents of given file
|
||||
static void rm(uint8_t i_fileId);
|
||||
|
||||
///swap contents of file1 with them of file2
|
||||
static void swap(uint8_t i_fileId1, uint8_t i_fileId2);
|
||||
|
||||
///return true if the file with given fileid exists
|
||||
static bool exists(uint8_t i_fileId);
|
||||
|
||||
///open file for reading, no close necessary
|
||||
void openRd(uint8_t i_fileId);
|
||||
|
||||
uint8_t read(uint8_t *buf, uint8_t len);
|
||||
|
||||
// protected:
|
||||
|
||||
uint8_t m_fileId; //index of file in directory = filename
|
||||
uint16_t m_pos; //over all filepos
|
||||
blkid_t m_currBlk; //current block.id
|
||||
uint8_t m_ofs; //offset inside of the current block
|
||||
};
|
||||
|
||||
#define eeFileSize(f) eeFs.files[f].size
|
||||
#define eeModelSize(id) eeFileSize(FILE_MODEL(id))
|
||||
|
||||
#define ERR_NONE 0
|
||||
#define ERR_FULL 1
|
||||
extern uint8_t s_write_err; // error reasons
|
||||
inline uint8_t write_errno() { return s_write_err; }
|
||||
|
||||
extern uint8_t s_sync_write;
|
||||
#define ENABLE_SYNC_WRITE(val) s_sync_write = val;
|
||||
#define IS_SYNC_WRITE_ENABLE() s_sync_write
|
||||
|
||||
class RlcFile: public EFile
|
||||
{
|
||||
uint8_t m_bRlc; // control byte for run length decoder
|
||||
uint8_t m_zeroes;
|
||||
|
||||
#define WRITE_FIRST_LINK 0x01
|
||||
#define WRITE_NEXT_LINK_1 0x02
|
||||
#define WRITE_NEXT_LINK_2 0x03
|
||||
#define WRITE_START_STEP 0x10
|
||||
#define WRITE_FREE_UNUSED_BLOCKS_STEP1 0x20
|
||||
#define WRITE_FREE_UNUSED_BLOCKS_STEP2 0x30
|
||||
#define WRITE_FINAL_DIRENT_STEP 0x40
|
||||
#define WRITE_TMP_DIRENT_STEP 0x50
|
||||
uint8_t m_write_step;
|
||||
uint16_t m_rlc_len;
|
||||
uint8_t * m_rlc_buf;
|
||||
uint8_t m_cur_rlc_len;
|
||||
uint8_t m_write1_byte;
|
||||
uint8_t m_write_len;
|
||||
uint8_t * m_write_buf;
|
||||
|
||||
public:
|
||||
|
||||
void openRlc(uint8_t i_fileId);
|
||||
|
||||
void create(uint8_t i_fileId, uint8_t typ, uint8_t sync_write);
|
||||
|
||||
/// copy contents of i_fileSrc to i_fileDst
|
||||
bool copy(uint8_t i_fileDst, uint8_t i_fileSrc);
|
||||
|
||||
inline bool isWriting() { return m_write_step != 0; }
|
||||
void write(uint8_t *buf, uint8_t i_len);
|
||||
void write1(uint8_t b);
|
||||
void nextWriteStep();
|
||||
void nextRlcWriteStep();
|
||||
void writeRlc(uint8_t i_fileId, uint8_t typ, uint8_t *buf, uint16_t i_len, uint8_t sync_write);
|
||||
|
||||
// flush the current write operation if any
|
||||
void flush();
|
||||
|
||||
// read from opened file and decode rlc-coded data
|
||||
uint16_t readRlc(uint8_t *buf, uint16_t i_len);
|
||||
};
|
||||
|
||||
extern RlcFile theFile; //used for any file operation
|
||||
|
||||
inline void eeFlush()
|
||||
{
|
||||
theFile.flush();
|
||||
}
|
||||
|
||||
inline bool eepromIsWriting()
|
||||
{
|
||||
return theFile.isWriting();
|
||||
}
|
||||
|
||||
inline void eepromWriteProcess()
|
||||
{
|
||||
theFile.nextWriteStep();
|
||||
}
|
||||
|
||||
bool eeCopyModel(uint8_t dst, uint8_t src);
|
||||
void eeSwapModels(uint8_t id1, uint8_t id2);
|
||||
void eeDeleteModel(uint8_t idx);
|
||||
|
||||
#if defined(SDCARD)
|
||||
const char * eeBackupModel(uint8_t i_fileSrc);
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
#endif
|
||||
|
||||
#if !defined(SDCARD_RAW) && !defined(SDCARD_YAML)
|
||||
// For conversions
|
||||
void loadRadioSettings();
|
||||
#endif
|
||||
|
||||
bool eepromOpen();
|
||||
void eeLoadModelName(uint8_t id, char * name);
|
||||
bool eeLoadGeneral(bool allowFixes);
|
||||
|
||||
// For EEPROM backup/restore
|
||||
inline bool isEepromStart(const void * buffer)
|
||||
{
|
||||
// OpenTX EEPROM
|
||||
{
|
||||
const EeFs * eeprom = (const EeFs *)buffer;
|
||||
if (eeprom->version==EEFS_VERS && eeprom->mySize==sizeof(eeFs) && eeprom->bs==BS)
|
||||
return true;
|
||||
}
|
||||
|
||||
// ersky9x EEPROM
|
||||
{
|
||||
const uint8_t * eeprom = (const uint8_t *)buffer;
|
||||
uint8_t size = eeprom[1] ;
|
||||
uint8_t bs = eeprom[3] ;
|
||||
if (size==0x80 && bs==0x80)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void eepromBackup();
|
||||
|
||||
#if defined(SDCARD_RAW) || defined(SDCARD_YAML)
|
||||
bool eeModelExistsRlc(uint8_t id);
|
||||
#endif
|
||||
|
||||
#endif // _EEPROM_RLC_H_
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "storage.h"
|
||||
#include "sdcard_common.h"
|
||||
#include "modelslist.h"
|
||||
#include "conversions/conversions.h"
|
||||
#include "model_init.h"
|
||||
|
||||
void getModelPath(char * path, const char * filename, const char* pathName)
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* 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
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
#include "modelslist.h"
|
||||
#include "conversions/conversions.h"
|
||||
|
||||
const char *writeFileBin(const char *filename, const uint8_t *data,
|
||||
uint16_t size, uint8_t version)
|
||||
{
|
||||
TRACE("writeFileBin(%s)", filename);
|
||||
|
||||
FIL file;
|
||||
unsigned char buf[8];
|
||||
UINT written;
|
||||
|
||||
FRESULT result = f_open(&file, filename, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
*(uint32_t*)&buf[0] = ETX_FOURCC;
|
||||
buf[4] = version;
|
||||
buf[5] = 'M';
|
||||
*(uint16_t*)&buf[6] = size;
|
||||
|
||||
result = f_write(&file, buf, 8, &written);
|
||||
if (result != FR_OK || written != 8) {
|
||||
f_close(&file);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
result = f_write(&file, data, size, &written);
|
||||
if (result != FR_OK || written != size) {
|
||||
f_close(&file);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
f_close(&file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// TODO: move to "common"
|
||||
const char * writeModelBin()
|
||||
{
|
||||
char path[256];
|
||||
getModelPath(path, g_eeGeneral.currModelFilename);
|
||||
|
||||
sdCheckAndCreateDirectory(MODELS_PATH);
|
||||
return writeFileBin(path, (uint8_t *)&g_model, sizeof(g_model));
|
||||
}
|
||||
|
||||
// TODO: move partly to common
|
||||
const char * openFile(const char * fullpath, FIL * file)
|
||||
{
|
||||
FRESULT result = f_open(file, fullpath, FA_OPEN_EXISTING | FA_READ);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* openFileBin(const char * fullpath, FIL * file, uint16_t * size, uint8_t * version)
|
||||
{
|
||||
const char* err = openFile(fullpath, file);
|
||||
if (err) return err;
|
||||
|
||||
if (f_size(file) < 8) {
|
||||
f_close(file);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
UINT read;
|
||||
char buf[8];
|
||||
|
||||
FRESULT result = f_read(file, (uint8_t *)buf, sizeof(buf), &read);
|
||||
if ((result != FR_OK) || (read != sizeof(buf))) {
|
||||
f_close(file);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
*version = (uint8_t)buf[4];
|
||||
if (*(uint32_t *)&buf[0] != ETX_FOURCC || *version < FIRST_CONV_EEPROM_VER ||
|
||||
*version > EEPROM_VER || buf[5] != 'M') {
|
||||
f_close(file);
|
||||
return STR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
*size = *(uint16_t*)&buf[6];
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char *loadFileBin(const char *fullpath, uint8_t *data,
|
||||
uint16_t maxsize, uint8_t *version)
|
||||
{
|
||||
FIL file;
|
||||
UINT read;
|
||||
uint16_t size;
|
||||
|
||||
TRACE("loadFileBin(%s)", fullpath);
|
||||
|
||||
const char * err = openFileBin(fullpath, &file, &size, version);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
size = min<uint16_t>(maxsize, size);
|
||||
FRESULT result = f_read(&file, data, size, &read);
|
||||
if (result != FR_OK || read != size) {
|
||||
f_close(&file);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
f_close(&file);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if defined(SDCARD_RAW)
|
||||
const char* readModel(const char* filename, uint8_t* buffer, uint32_t size)
|
||||
{
|
||||
uint8_t version = 0;
|
||||
// Conversions from EEPROM are done in batch when converting the radio file.
|
||||
// It is not supported on a model by model base when loaded.
|
||||
const char *error = readModelBin(filename, buffer, size, &version);
|
||||
if (error) return error;
|
||||
|
||||
#if defined(STORAGE_CONVERSIONS)
|
||||
if (version < EEPROM_VER) {
|
||||
convertBinModelData(filename, version);
|
||||
error = readModelBin(filename, buffer, size, &version);
|
||||
}
|
||||
#endif
|
||||
|
||||
return error;
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *readModelBin(const char *filename, uint8_t *buffer, uint32_t size,
|
||||
uint8_t *version)
|
||||
{
|
||||
char path[256];
|
||||
getModelPath(path, filename);
|
||||
return loadFileBin(path, buffer, size, version);
|
||||
}
|
||||
|
||||
const char * loadRadioSettingsBin(const char * path)
|
||||
{
|
||||
uint8_t version;
|
||||
const char * error = loadFileBin(path, (uint8_t *)&g_eeGeneral, sizeof(g_eeGeneral), &version);
|
||||
if (error) {
|
||||
TRACE("loadRadioSettings error=%s", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
#if defined(STORAGE_CONVERSIONS)
|
||||
if (version < EEPROM_VER) {
|
||||
convertBinRadioData(path, version);
|
||||
}
|
||||
#endif
|
||||
|
||||
postRadioSettingsLoad();
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char * loadRadioSettingsBin()
|
||||
{
|
||||
return loadRadioSettingsBin(RADIO_SETTINGS_PATH);
|
||||
}
|
||||
|
||||
const char * writeGeneralSettingsBin()
|
||||
{
|
||||
return writeFileBin(RADIO_SETTINGS_PATH, (uint8_t *)&g_eeGeneral, sizeof(g_eeGeneral));
|
||||
}
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
#include "storage/eeprom_rlc.h"
|
||||
#endif
|
||||
|
||||
#include "storage/conversions/conversions.h"
|
||||
|
||||
const char * readYamlFile(const char* fullpath, const YamlParserCalls* calls, void* parser_ctx, ChecksumResult* checksum_result)
|
||||
{
|
||||
FIL file;
|
||||
@@ -177,30 +175,7 @@ const char * loadRadioSettings()
|
||||
if ( (f_stat(RADIO_SETTINGS_YAML_PATH, &fno) != FR_OK) && ((f_stat(RADIO_SETTINGS_TMPFILE_YAML_PATH, &fno) != FR_OK)) ) {
|
||||
// If neither the radio configuraion YAML file or the temporary file generated on write exist, this must be a first run with YAML support.
|
||||
// - thus requiring a conversion from binary to YAML.
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
#if defined(STORAGE_MODELSLIST)
|
||||
uint8_t version;
|
||||
const char* error = loadFileBin(RADIO_SETTINGS_PATH, nullptr, 0, &version);
|
||||
if (error) {
|
||||
TRACE("loadRadioSettings error=%s", error);
|
||||
return error;
|
||||
}
|
||||
convertBinRadioData(RADIO_SETTINGS_PATH, version);
|
||||
#elif defined(EEPROM_RLC)
|
||||
// Load from EEPROM
|
||||
uint8_t versions[3];
|
||||
uint16_t* variant = (uint16_t*)&versions[1];
|
||||
if (!eepromOpen() || (eeLoadGeneralSettingsData(versions, 3) != 3)
|
||||
|| (*variant != EEPROM_VARIANT)) {
|
||||
return "ERROR";
|
||||
}
|
||||
eeConvert(versions[0]);
|
||||
#else
|
||||
#error "Unsupported conversion format"
|
||||
#endif
|
||||
#else
|
||||
return "no radio settings";
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(DEFAULT_INTERNAL_MODULE)
|
||||
|
||||
@@ -26,77 +26,6 @@
|
||||
#include "pulses/multi.h"
|
||||
#include "stamp.h"
|
||||
|
||||
// Use definitions from v220 conversions as long as nothing changes
|
||||
|
||||
namespace yaml_conv_220 {
|
||||
bool w_board(void* user, uint8_t* data, uint32_t bitoffs, yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool in_write_weight(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool output_source_1_param(const char* src_prefix, size_t src_len, uint32_t n,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool w_vbat_min(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
bool w_vbat_max(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
|
||||
uint8_t select_zov(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
uint8_t select_script_input(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
uint8_t select_id1(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
uint8_t select_id2(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
uint8_t select_sensor_cfg(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
|
||||
extern const struct YamlIdStr enum_SwitchConfig[];
|
||||
|
||||
bool cfn_is_active(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
bool gvar_is_active(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
bool fmd_is_active(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
bool swash_is_active(void* user, uint8_t* data, uint32_t bitoffs);
|
||||
|
||||
bool w_5pos(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
bool w_vol(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
bool w_spPitch(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
bool w_vPitch(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque);
|
||||
|
||||
extern const char* _tele_screen_type_lookup[];
|
||||
bool w_tele_screen_type(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool w_tele_sensor(const YamlNode* node, uint32_t val,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool w_flightModes(const YamlNode* node, uint32_t val,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
extern const char* _func_sound_lookup[];
|
||||
extern const uint8_t _func_sound_lookup_size;
|
||||
|
||||
extern const char* _func_reset_param_lookup[];
|
||||
extern const char* _func_failsafe_lookup[];
|
||||
|
||||
extern const char* _adjust_gvar_mode_lookup[];
|
||||
extern const uint8_t _adjust_gvar_mode_lookup_size;
|
||||
|
||||
bool w_zov_source(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool w_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
extern const struct YamlIdStr enum_XJT_Subtypes[];
|
||||
extern const struct YamlIdStr enum_ISRM_Subtypes[];
|
||||
extern const struct YamlIdStr enum_R9M_Subtypes[];
|
||||
extern const struct YamlIdStr enum_FLYSKY_Subtypes[];
|
||||
extern const struct YamlIdStr enum_DSM2_Subtypes[];
|
||||
|
||||
bool w_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool w_channelsCount(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
void* opaque);
|
||||
|
||||
extern const struct YamlIdStr enum_UartModes[];
|
||||
};
|
||||
|
||||
//
|
||||
// WARNING:
|
||||
// ========
|
||||
@@ -142,7 +71,7 @@ static bool w_semver(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
static bool w_board(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_board(user, data, bitoffs, wf, opaque);
|
||||
return wf(opaque, FLAVOUR, sizeof(FLAVOUR)-1);
|
||||
}
|
||||
|
||||
static uint32_t in_read_weight(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
@@ -173,10 +102,22 @@ static uint32_t in_read_weight(const YamlNode* node, const char* val, uint8_t va
|
||||
return (uint32_t)yaml_str2int(val, val_len);
|
||||
}
|
||||
|
||||
static bool in_write_weight(const YamlNode* node, uint32_t val,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
bool in_write_weight(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
void* opaque)
|
||||
{
|
||||
return yaml_conv_220::in_write_weight(node, val, wf, opaque);
|
||||
int32_t sval = yaml_to_signed(val, node->size <= 11 ? node->size : 11);
|
||||
int32_t gvar = (node->size > 8 ? GV1_LARGE : GV1_SMALL);
|
||||
|
||||
if (sval >= gvar - 10 && sval <= gvar) {
|
||||
char n = gvar - sval + '0';
|
||||
return wf(opaque, "-GV", 3) && wf(opaque, &n, 1);
|
||||
} else if (sval <= -gvar + 10 && sval >= -gvar) {
|
||||
char n = val - gvar + '1';
|
||||
return wf(opaque, "GV", 2) && wf(opaque, &n, 1);
|
||||
}
|
||||
|
||||
char* s = yaml_signed2str(sval);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
extern const struct YamlIdStr enum_MixSources[];
|
||||
@@ -274,6 +215,15 @@ static uint32_t r_mixSrcRaw(const YamlNode* node, const char* val, uint8_t val_l
|
||||
|
||||
static constexpr char closing_parenthesis[] = ")";
|
||||
|
||||
bool output_source_1_param(const char* src_prefix, size_t src_len, uint32_t n,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
if (!wf(opaque, src_prefix, src_len)) return false;
|
||||
const char* str = yaml_unsigned2str(n);
|
||||
if (!wf(opaque, str, strlen(str))) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
const char* str = nullptr;
|
||||
@@ -293,8 +243,7 @@ static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
val -= MIXSRC_FIRST_LUA;
|
||||
uint32_t script = val / MAX_SCRIPT_OUTPUTS;
|
||||
|
||||
if (!yaml_conv_220::output_source_1_param("lua(", 4, script, wf,
|
||||
opaque))
|
||||
if (!output_source_1_param("lua(", 4, script, wf, opaque))
|
||||
return false;
|
||||
if (!wf(opaque, ",", 1)) return false;
|
||||
|
||||
@@ -309,7 +258,7 @@ static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
&& val <= MIXSRC_LAST_LOGICAL_SWITCH) {
|
||||
|
||||
val -= MIXSRC_FIRST_LOGICAL_SWITCH;
|
||||
if (!yaml_conv_220::output_source_1_param("ls(", 3, val + 1, wf, opaque))
|
||||
if (!output_source_1_param("ls(", 3, val + 1, wf, opaque))
|
||||
return false;
|
||||
str = closing_parenthesis;
|
||||
}
|
||||
@@ -317,7 +266,7 @@ static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
&& val <= MIXSRC_LAST_TRAINER) {
|
||||
|
||||
val -= MIXSRC_FIRST_TRAINER;
|
||||
if (!yaml_conv_220::output_source_1_param("tr(", 3, val, wf, opaque))
|
||||
if (!output_source_1_param("tr(", 3, val, wf, opaque))
|
||||
return false;
|
||||
str = closing_parenthesis;
|
||||
}
|
||||
@@ -325,7 +274,7 @@ static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
&& val <= MIXSRC_LAST_CH) {
|
||||
|
||||
val -= MIXSRC_FIRST_CH;
|
||||
if (!yaml_conv_220::output_source_1_param("ch(", 3, val, wf, opaque))
|
||||
if (!output_source_1_param("ch(", 3, val, wf, opaque))
|
||||
return false;
|
||||
str = closing_parenthesis;
|
||||
}
|
||||
@@ -333,7 +282,7 @@ static bool w_mixSrcRaw(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
&& val <= MIXSRC_LAST_GVAR) {
|
||||
|
||||
val -= MIXSRC_FIRST_GVAR;
|
||||
if (!yaml_conv_220::output_source_1_param("gv(", 3, val, wf, opaque))
|
||||
if (!output_source_1_param("gv(", 3, val, wf, opaque))
|
||||
return false;
|
||||
str = closing_parenthesis;
|
||||
}
|
||||
@@ -397,7 +346,8 @@ static uint32_t r_vbat_min(const YamlNode* node, const char* val, uint8_t val_le
|
||||
|
||||
static bool w_vbat_min(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_vbat_min(node, val, wf, opaque);
|
||||
char* s = yaml_signed2str(yaml_to_signed(val,node->size) + 90);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
static uint32_t r_vbat_max(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
@@ -408,13 +358,18 @@ static uint32_t r_vbat_max(const YamlNode* node, const char* val, uint8_t val_le
|
||||
|
||||
static bool w_vbat_max(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_vbat_max(node, val, wf, opaque);
|
||||
char* s = yaml_signed2str(yaml_to_signed(val,node->size) + 120);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
#if defined(COLORLCD)
|
||||
static uint8_t select_zov(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::select_zov(user, data, bitoffs);
|
||||
data += bitoffs >> 3UL;
|
||||
data -= offsetof(ZoneOptionValueTyped, value);
|
||||
ZoneOptionValueEnum* p_zovt = (ZoneOptionValueEnum*)data;
|
||||
if (*p_zovt > ZOV_Color) return 0;
|
||||
return *p_zovt;
|
||||
}
|
||||
|
||||
void r_zov_source(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
@@ -454,7 +409,15 @@ void r_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
bool w_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_zov_color(user, data, bitoffs, wf, opaque);
|
||||
data += bitoffs >> 3UL;
|
||||
auto p_val = reinterpret_cast<ZoneOptionValue*>(data);
|
||||
|
||||
uint32_t color = (uint32_t)GET_RED(p_val->unsignedValue) << 16 |
|
||||
(uint32_t)GET_GREEN(p_val->unsignedValue) << 8 |
|
||||
(uint32_t)GET_BLUE(p_val->unsignedValue);
|
||||
|
||||
if (!wf(opaque, "0x", 2)) return false;
|
||||
return wf(opaque, yaml_rgb2hex(color), 3 * 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -499,22 +462,55 @@ static uint8_t select_mod_type(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
|
||||
static uint8_t select_script_input(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::select_script_input(user, data, bitoffs);
|
||||
// always use 'value'
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t select_id1(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::select_id1(user, data, bitoffs);
|
||||
data += bitoffs >> 3UL;
|
||||
const TelemetrySensor* sensor = (const TelemetrySensor*)data;
|
||||
|
||||
if (sensor->type == TELEM_TYPE_CALCULATED
|
||||
&& sensor->persistent)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t select_id2(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::select_id2(user, data, bitoffs);
|
||||
data += bitoffs >> 3UL;
|
||||
data -= 2 /* size of id1 union */;
|
||||
const TelemetrySensor* sensor = (const TelemetrySensor*)data;
|
||||
|
||||
if (sensor->type == TELEM_TYPE_CALCULATED)
|
||||
return 2; // formula
|
||||
|
||||
return 1; // instance
|
||||
}
|
||||
|
||||
static uint8_t select_sensor_cfg(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::select_sensor_cfg(user, data, bitoffs);
|
||||
data += bitoffs >> 3UL;
|
||||
data -= offsetof(TelemetrySensor, param);
|
||||
const TelemetrySensor* sensor = (const TelemetrySensor*)data;
|
||||
|
||||
if (sensor->unit < UNIT_FIRST_VIRTUAL) {
|
||||
if (sensor->type == TELEM_TYPE_CALCULATED) {
|
||||
switch(sensor->formula) {
|
||||
case TELEM_FORMULA_CELL: return 1; // cell
|
||||
case TELEM_FORMULA_DIST: return 4; // dist
|
||||
case TELEM_FORMULA_CONSUMPTION: return 3; // consumption
|
||||
case TELEM_FORMULA_TOTALIZE: return 3; // consumption
|
||||
default: return 2; // calc
|
||||
}
|
||||
} else {
|
||||
return 0; // custom
|
||||
}
|
||||
}
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
static uint32_t r_calib(void* user, const char* val, uint8_t val_len)
|
||||
@@ -635,9 +631,17 @@ static bool sw_name_write(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
return wf(opaque, "\"", 1);
|
||||
}
|
||||
|
||||
static const struct YamlIdStr enum_SwitchConfig[] = {
|
||||
{ SWITCH_NONE, "none" },
|
||||
{ SWITCH_TOGGLE, "toggle" },
|
||||
{ SWITCH_2POS, "2pos" },
|
||||
{ SWITCH_3POS, "3pos" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const struct YamlNode struct_switchConfig[] = {
|
||||
YAML_IDX_CUST( "sw", sw_read, sw_write),
|
||||
YAML_ENUM( "type", 2, yaml_conv_220::enum_SwitchConfig),
|
||||
YAML_ENUM( "type", 2, enum_SwitchConfig),
|
||||
YAML_CUSTOM( "name", sw_name_read, sw_name_write),
|
||||
YAML_END
|
||||
};
|
||||
@@ -905,22 +909,43 @@ bool w_swtchSrc(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* o
|
||||
|
||||
bool cfn_is_active(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::cfn_is_active(user, data, bitoffs);
|
||||
data += bitoffs >> 3UL;
|
||||
return ((CustomFunctionData*)data)->swtch;
|
||||
}
|
||||
|
||||
static bool gvar_is_active(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::gvar_is_active(user, data, bitoffs);
|
||||
// TODO: no need to output 0 values for FM0
|
||||
gvar_t* gvar = (gvar_t*)(data + (bitoffs>>3UL));
|
||||
return *gvar != GVAR_MAX+1;
|
||||
}
|
||||
|
||||
static bool fmd_is_active(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::fmd_is_active(user, data, bitoffs);
|
||||
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
|
||||
uint16_t idx = tw->getElmts();
|
||||
|
||||
// FM0 defaults to all 0
|
||||
if (idx == 0) {
|
||||
return !yaml_is_zero(data, bitoffs, sizeof(FlightModeData) << 3UL);
|
||||
}
|
||||
|
||||
// assumes gvars array is last
|
||||
bool is_active = !yaml_is_zero(data, bitoffs, offsetof(FlightModeData, gvars) << 3UL);
|
||||
|
||||
data += bitoffs >> 3UL;
|
||||
FlightModeData* fmd = (FlightModeData*)(data);
|
||||
for (uint8_t i=0; i<MAX_GVARS; i++) {
|
||||
is_active |= fmd->gvars[i] != GVAR_MAX+1; // FM0 -> default
|
||||
}
|
||||
|
||||
return is_active;
|
||||
}
|
||||
|
||||
static bool swash_is_active(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
{
|
||||
return yaml_conv_220::swash_is_active(user, data, bitoffs);
|
||||
auto swashR = reinterpret_cast<SwashRingData*>(data + (bitoffs >> 3UL));
|
||||
return swashR->type | swashR->value;
|
||||
}
|
||||
|
||||
static void r_swtchWarn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
@@ -1034,17 +1059,21 @@ static uint32_t r_5pos(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
|
||||
static bool w_5pos(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_5pos(node, val, wf, opaque);
|
||||
int32_t sval = yaml_to_signed(val,node->size);
|
||||
char* s = yaml_signed2str(sval + 2);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
static uint32_t r_vol(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
{
|
||||
return (uint32_t)(yaml_str2int(val, val_len) - VOLUME_LEVEL_DEF);
|
||||
return (uint32_t)(yaml_str2int(val, val_len) - VOLUME_LEVEL_DEF);
|
||||
}
|
||||
|
||||
static bool w_vol(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_vol(node, val, wf, opaque);
|
||||
int32_t sval = yaml_to_signed(val,node->size);
|
||||
char* s = yaml_signed2str(sval + VOLUME_LEVEL_DEF);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
static uint32_t r_spPitch(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
@@ -1054,7 +1083,8 @@ static uint32_t r_spPitch(const YamlNode* node, const char* val, uint8_t val_len
|
||||
|
||||
static bool w_spPitch(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_spPitch(node, val, wf, opaque);
|
||||
char* s = yaml_signed2str(val * 15);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
static uint32_t r_vPitch(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
@@ -1064,7 +1094,9 @@ static uint32_t r_vPitch(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
|
||||
static bool w_vPitch(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_vPitch(node, val, wf, opaque);
|
||||
int32_t sval = yaml_to_signed(val,node->size);
|
||||
char* s = yaml_signed2str(sval * 10);
|
||||
return wf(opaque, s, strlen(s));
|
||||
}
|
||||
|
||||
static const struct YamlIdStr enum_TrainerMode[] = {
|
||||
@@ -1101,12 +1133,19 @@ static bool w_trainerMode(const YamlNode* node, uint32_t val,
|
||||
|
||||
#if !defined(COLORLCD)
|
||||
|
||||
const char* _tele_screen_type_lookup[] = {
|
||||
"NONE",
|
||||
"VALUES",
|
||||
"BARS",
|
||||
"SCRIPT",
|
||||
};
|
||||
|
||||
static void r_tele_screen_type(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
const char* val, uint8_t val_len)
|
||||
{
|
||||
uint8_t type = 0;
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
if (!strncmp(val, yaml_conv_220::_tele_screen_type_lookup[i], val_len)) {
|
||||
if (!strncmp(val, _tele_screen_type_lookup[i], val_len)) {
|
||||
type = i;
|
||||
break;
|
||||
}
|
||||
@@ -1124,7 +1163,14 @@ static void r_tele_screen_type(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
static bool w_tele_screen_type(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_tele_screen_type(user, data, bitoffs, wf, opaque);
|
||||
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
|
||||
uint16_t idx = tw->getElmts(1);
|
||||
|
||||
data -= sizeof(TelemetryScreenData) * idx + 1;
|
||||
uint8_t type = ((*data) >> (2 * idx)) & 0x03;
|
||||
|
||||
const char* str = _tele_screen_type_lookup[type];
|
||||
return wf(opaque, str, strlen(str));
|
||||
}
|
||||
|
||||
static uint8_t select_tele_screen_data(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
@@ -1159,7 +1205,12 @@ static uint32_t r_tele_sensor(const YamlNode* node, const char* val, uint8_t val
|
||||
static bool w_tele_sensor(const YamlNode* node, uint32_t val,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_tele_sensor(node, val, wf, opaque);
|
||||
if (!val) {
|
||||
return wf(opaque, "none", 4);
|
||||
}
|
||||
|
||||
const char* str = yaml_unsigned2str(val-1);
|
||||
return wf(opaque, str, strlen(str));
|
||||
}
|
||||
|
||||
static uint32_t r_flightModes(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
@@ -1178,9 +1229,31 @@ static uint32_t r_flightModes(const YamlNode* node, const char* val, uint8_t val
|
||||
static bool w_flightModes(const YamlNode* node, uint32_t val,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_flightModes(node, val, wf, opaque);
|
||||
for (uint32_t i = 0; i < node->size; i++) {
|
||||
uint32_t bit = (val >> i) & 1;
|
||||
if (!wf(opaque, bit ? "1" : "0", 1)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char* _func_reset_param_lookup[] = {
|
||||
"Tmr1","Tmr2","Tmr3","All","Tele"
|
||||
};
|
||||
|
||||
static const char* _func_failsafe_lookup[] = {
|
||||
"Int","Ext"
|
||||
};
|
||||
|
||||
static const char* _func_sound_lookup[] = {
|
||||
"Bp1","Bp2","Bp3","Wrn1","Wrn2",
|
||||
"Chee","Rata","Tick","Sirn","Ring",
|
||||
"SciF","Robt","Chrp","Tada","Crck","Alrm"
|
||||
};
|
||||
|
||||
static const char* _adjust_gvar_mode_lookup[] = {
|
||||
"Cst", "Src", "GVar", "IncDec"
|
||||
};
|
||||
|
||||
static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
const char* val, uint8_t val_len)
|
||||
{
|
||||
@@ -1269,8 +1342,8 @@ static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
|
||||
case FUNC_PLAY_SOUND:
|
||||
// find "," and cut val_len
|
||||
for (int i=0; i < yaml_conv_220::_func_sound_lookup_size; i++) {
|
||||
if (!strncmp(yaml_conv_220::_func_sound_lookup[i],val,l_sep)) {
|
||||
for (unsigned i=0; i < DIM(_func_sound_lookup); i++) {
|
||||
if (!strncmp(_func_sound_lookup[i],val,l_sep)) {
|
||||
CFN_PARAM(cfn) = i;
|
||||
break;
|
||||
}
|
||||
@@ -1342,8 +1415,8 @@ static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
l_sep = sep ? sep - val : val_len;
|
||||
|
||||
// parse CFN_GVAR_MODE
|
||||
for (int i=0; i < yaml_conv_220::_adjust_gvar_mode_lookup_size; i++) {
|
||||
if (!strncmp(yaml_conv_220::_adjust_gvar_mode_lookup[i],val,l_sep)) {
|
||||
for (unsigned i=0; i < DIM(_adjust_gvar_mode_lookup); i++) {
|
||||
if (!strncmp(_adjust_gvar_mode_lookup[i],val,l_sep)) {
|
||||
CFN_GVAR_MODE(cfn) = i;
|
||||
break;
|
||||
}
|
||||
@@ -1458,7 +1531,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
case FUNC_RESET:
|
||||
if (CFN_PARAM(cfn) < FUNC_RESET_PARAM_FIRST_TELEM) {
|
||||
// Tmr1,Tmr2,Tmr3,All
|
||||
str = yaml_conv_220::_func_reset_param_lookup[CFN_PARAM(cfn)];
|
||||
str = _func_reset_param_lookup[CFN_PARAM(cfn)];
|
||||
} else {
|
||||
// sensor index
|
||||
str = yaml_unsigned2str(CFN_PARAM(cfn) - FUNC_RESET_PARAM_FIRST_TELEM);
|
||||
@@ -1474,7 +1547,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
|
||||
case FUNC_PLAY_SOUND:
|
||||
// Bp1,Bp2,Bp3,Wrn1,Wrn2,Chee,Rata,Tick,Sirn,Ring,SciF,Robt,Chrp,Tada,Crck,Alrm
|
||||
str = yaml_conv_220::_func_sound_lookup[CFN_PARAM(cfn)];
|
||||
str = _func_sound_lookup[CFN_PARAM(cfn)];
|
||||
if (!wf(opaque, str, strlen(str))) return false;
|
||||
break;
|
||||
|
||||
@@ -1487,7 +1560,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
|
||||
case FUNC_SET_TIMER:
|
||||
// Tmr1,Tmr2,Tmr3
|
||||
str = yaml_conv_220::_func_reset_param_lookup[CFN_TIMER_INDEX(cfn)];
|
||||
str = _func_reset_param_lookup[CFN_TIMER_INDEX(cfn)];
|
||||
if (!wf(opaque, str, strlen(str))) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
str = yaml_unsigned2str(CFN_PARAM(cfn));
|
||||
@@ -1496,7 +1569,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
|
||||
case FUNC_SET_FAILSAFE:
|
||||
// Int,Ext
|
||||
str = yaml_conv_220::_func_failsafe_lookup[CFN_PARAM(cfn)];
|
||||
str = _func_failsafe_lookup[CFN_PARAM(cfn)];
|
||||
if (!wf(opaque, str, strlen(str))) return false;
|
||||
break;
|
||||
|
||||
@@ -1515,7 +1588,7 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
|
||||
// output CFN_GVAR_MODE
|
||||
str = yaml_conv_220::_adjust_gvar_mode_lookup[CFN_GVAR_MODE(cfn)];
|
||||
str = _adjust_gvar_mode_lookup[CFN_GVAR_MODE(cfn)];
|
||||
if (!wf(opaque, str, strlen(str))) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
|
||||
@@ -1731,6 +1804,43 @@ static bool w_thrSrc(const YamlNode* node, uint32_t val, yaml_writer_func wf,
|
||||
return w_mixSrcRaw(nullptr, src, wf, opaque);
|
||||
}
|
||||
|
||||
static const struct YamlIdStr enum_XJT_Subtypes[] = {
|
||||
{ MODULE_SUBTYPE_PXX1_ACCST_D16, "D16" },
|
||||
{ MODULE_SUBTYPE_PXX1_ACCST_D8, "D8" },
|
||||
{ MODULE_SUBTYPE_PXX1_ACCST_LR12, "LR12" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const struct YamlIdStr enum_ISRM_Subtypes[] = {
|
||||
{ MODULE_SUBTYPE_ISRM_PXX2_ACCESS, "ACCESS" },
|
||||
{ MODULE_SUBTYPE_ISRM_PXX2_ACCST_D16, "D16" },
|
||||
// unused !!!
|
||||
// { MODULE_SUBTYPE_ISRM_PXX2_ACCST_LR12, "LR12" },
|
||||
// { MODULE_SUBTYPE_ISRM_PXX2_ACCST_D8, "D8" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const struct YamlIdStr enum_R9M_Subtypes[] = {
|
||||
{ MODULE_SUBTYPE_R9M_FCC, "FCC" },
|
||||
{ MODULE_SUBTYPE_R9M_EU, "EU" },
|
||||
{ MODULE_SUBTYPE_R9M_EUPLUS, "EUPLUS" },
|
||||
{ MODULE_SUBTYPE_R9M_AUPLUS, "AUPLUS" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const struct YamlIdStr enum_FLYSKY_Subtypes[] = {
|
||||
{ FLYSKY_SUBTYPE_AFHDS3, "AFHDS3" },
|
||||
{ FLYSKY_SUBTYPE_AFHDS2A, "AFHDS2A" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static const struct YamlIdStr enum_DSM2_Subtypes[] = {
|
||||
{ 0, "LP45" },
|
||||
{ 1, "DSM2" },
|
||||
{ 2, "DSMX" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static void r_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
const char* val, uint8_t val_len)
|
||||
{
|
||||
@@ -1739,13 +1849,13 @@ static void r_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
|
||||
auto md = reinterpret_cast<ModuleData*>(data);
|
||||
if (isModuleTypeXJT(md->type)) {
|
||||
md->subType = yaml_parse_enum(yaml_conv_220::enum_XJT_Subtypes, val, val_len);
|
||||
md->subType = yaml_parse_enum(enum_XJT_Subtypes, val, val_len);
|
||||
} else if (isModuleTypeISRM(md->type)) {
|
||||
md->subType = yaml_parse_enum(yaml_conv_220::enum_ISRM_Subtypes, val, val_len);
|
||||
md->subType = yaml_parse_enum(enum_ISRM_Subtypes, val, val_len);
|
||||
} else if (isModuleTypeR9MNonAccess(md->type)) {
|
||||
md->subType = yaml_parse_enum(yaml_conv_220::enum_R9M_Subtypes, val, val_len);
|
||||
md->subType = yaml_parse_enum(enum_R9M_Subtypes, val, val_len);
|
||||
} else if (md->type == MODULE_TYPE_FLYSKY) {
|
||||
md->subType = yaml_parse_enum(yaml_conv_220::enum_FLYSKY_Subtypes, val, val_len);
|
||||
md->subType = yaml_parse_enum(enum_FLYSKY_Subtypes, val, val_len);
|
||||
} else if (md->type == MODULE_TYPE_MULTIMODULE) {
|
||||
#if defined(MULTIMODULE)
|
||||
// Read type/subType by the book (see MPM documentation)
|
||||
@@ -1770,7 +1880,7 @@ static void r_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
}
|
||||
#endif
|
||||
} else if (md->type == MODULE_TYPE_DSM2) {
|
||||
md->subType = yaml_parse_enum(yaml_conv_220::enum_DSM2_Subtypes, val, val_len);
|
||||
md->subType = yaml_parse_enum(enum_DSM2_Subtypes, val, val_len);
|
||||
} else {
|
||||
md->subType = yaml_str2uint(val, val_len);
|
||||
}
|
||||
@@ -1787,13 +1897,13 @@ static bool w_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
auto md = reinterpret_cast<ModuleData*>(data);
|
||||
int32_t val = md->subType;
|
||||
if (md->type == MODULE_TYPE_XJT_PXX1 || md->type == MODULE_TYPE_XJT_LITE_PXX2) {
|
||||
str = yaml_output_enum(val, yaml_conv_220::enum_XJT_Subtypes);
|
||||
str = yaml_output_enum(val, enum_XJT_Subtypes);
|
||||
} else if (md->type == MODULE_TYPE_ISRM_PXX2) {
|
||||
str = yaml_output_enum(val, yaml_conv_220::enum_ISRM_Subtypes);
|
||||
str = yaml_output_enum(val, enum_ISRM_Subtypes);
|
||||
} else if (md->type == MODULE_TYPE_R9M_PXX1 || md->type == MODULE_TYPE_R9M_LITE_PXX1) {
|
||||
str = yaml_output_enum(val, yaml_conv_220::enum_R9M_Subtypes);
|
||||
str = yaml_output_enum(val, enum_R9M_Subtypes);
|
||||
} else if (md->type == MODULE_TYPE_FLYSKY) {
|
||||
str = yaml_output_enum(val, yaml_conv_220::enum_FLYSKY_Subtypes);
|
||||
str = yaml_output_enum(val, enum_FLYSKY_Subtypes);
|
||||
} else if (md->type == MODULE_TYPE_MULTIMODULE) {
|
||||
#if defined(MULTIMODULE)
|
||||
// Use type/subType by the book (see MPM documentation)
|
||||
@@ -1810,7 +1920,7 @@ static bool w_modSubtype(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
str = yaml_unsigned2str(subtype);
|
||||
#endif
|
||||
} else if (md->type == MODULE_TYPE_DSM2) {
|
||||
str = yaml_output_enum(md->subType, yaml_conv_220::enum_DSM2_Subtypes);
|
||||
str = yaml_output_enum(md->subType, enum_DSM2_Subtypes);
|
||||
} else {
|
||||
str = yaml_unsigned2str(val);
|
||||
}
|
||||
@@ -1828,7 +1938,10 @@ static uint32_t r_channelsCount(const YamlNode* node, const char* val, uint8_t v
|
||||
|
||||
bool w_channelsCount(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_channelsCount(node, val, wf, opaque);
|
||||
// offset 8
|
||||
int32_t sval = yaml_to_signed(val, node->size) + 8;
|
||||
const char* str = yaml_signed2str(sval);
|
||||
return wf(opaque,str,strlen(str));
|
||||
}
|
||||
|
||||
static void r_jitterFilter(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
@@ -1860,7 +1973,6 @@ static const struct YamlIdStr enum_SerialPort[] = {
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
#if STORAGE_CONVERSIONS >= 221
|
||||
const struct YamlIdStr _old_enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "MODE_NONE" },
|
||||
{ UART_MODE_TELEMETRY_MIRROR, "MODE_TELEMETRY_MIRROR" },
|
||||
@@ -1869,7 +1981,6 @@ const struct YamlIdStr _old_enum_UartModes[] = {
|
||||
{ UART_MODE_LUA, "MODE_LUA" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
#endif
|
||||
|
||||
static const struct YamlIdStr enum_UartModes[] = {
|
||||
{ UART_MODE_NONE, "NONE" },
|
||||
@@ -1927,11 +2038,7 @@ static void r_serialMode(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
else
|
||||
return;
|
||||
|
||||
#if STORAGE_CONVERSIONS < 221
|
||||
auto m = yaml_parse_enum(yaml_conv_220::enum_UartModes, val, val_len);
|
||||
#else
|
||||
auto m = yaml_parse_enum(_old_enum_UartModes, val, val_len);
|
||||
#endif
|
||||
if (!m) return;
|
||||
|
||||
auto serialPort = reinterpret_cast<uint32_t*>(data);
|
||||
|
||||
@@ -13,8 +13,6 @@ set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(HSE_VALUE 12000000)
|
||||
set(SDCARD YES)
|
||||
set(STORAGE SDCARD)
|
||||
set(STORAGE_FORMAT RAW)
|
||||
set(STORAGE_MODELSLIST YES)
|
||||
set(HAPTIC YES)
|
||||
set(GUI_DIR colorlcd)
|
||||
@@ -34,11 +32,6 @@ else()
|
||||
set(LINKER_SCRIPT targets/horus/stm32f4_flash.ld)
|
||||
endif()
|
||||
|
||||
if(YAML_STORAGE)
|
||||
set(STORAGE_CONVERT RAW)
|
||||
set(STORAGE_FORMAT YAML)
|
||||
endif()
|
||||
|
||||
# for size report script
|
||||
set(CPU_TYPE_FULL STM32F429xI)
|
||||
set(SIZE_TARGET_MEM_DEFINE "MEM_SIZE_SDRAM2=8192")
|
||||
|
||||
@@ -11,8 +11,6 @@ set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(HSE_VALUE 12000000)
|
||||
set(SDCARD YES)
|
||||
set(STORAGE SDCARD)
|
||||
set(STORAGE_FORMAT RAW)
|
||||
set(STORAGE_MODELSLIST YES)
|
||||
set(HAPTIC YES)
|
||||
set(GUI_DIR colorlcd)
|
||||
|
||||
@@ -520,14 +520,6 @@ endif()
|
||||
|
||||
set(HSE_VALUE 12000000)
|
||||
set(SDCARD YES)
|
||||
if(YAML_STORAGE)
|
||||
set(STORAGE SDCARD)
|
||||
set(STORAGE_FORMAT YAML)
|
||||
set(STORAGE_CONVERT EEPROM_RLC)
|
||||
else()
|
||||
set(STORAGE EEPROM)
|
||||
set(STORAGE_FORMAT RLC)
|
||||
endif()
|
||||
set(TARGET_DIR taranis)
|
||||
set(PPM_LIMITS_SYMETRICAL YES)
|
||||
|
||||
|
||||
@@ -20,25 +20,14 @@
|
||||
*/
|
||||
|
||||
#include "gtests.h"
|
||||
#include "storage/conversions/conversions.h"
|
||||
#include "location.h"
|
||||
|
||||
#if defined(EEPROM) || defined(EEPROM_RLC)
|
||||
#include <storage/eeprom_common.h>
|
||||
#endif
|
||||
#if 0
|
||||
|
||||
#if defined(SDCARD_YAML)
|
||||
#include <storage/sdcard_yaml.h>
|
||||
#endif
|
||||
|
||||
#if defined(EEPROM_SIZE)
|
||||
void loadEEPROMFile(const char * filename)
|
||||
{
|
||||
FILE * f = fopen(filename, "rb");
|
||||
assert(fread(eeprom, 1, EEPROM_SIZE, f) == EEPROM_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCBX9DP)
|
||||
TEST(Conversions, ConversionX9DPFrom23)
|
||||
{
|
||||
@@ -544,3 +533,4 @@ TEST(Conversions, ConversionTX16SFrom25)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user