Revamped switch state checking
This commit is contained in:
@@ -525,6 +525,7 @@ bool swash_is_active(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
|
||||
#define r_swtchWarn nullptr
|
||||
|
||||
#if defined(COLORLCD)
|
||||
bool w_swtchWarn(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
for (int i = 0; i < STORAGE_NUM_SWITCHES; i++) {
|
||||
@@ -568,6 +569,58 @@ bool w_swtchWarn(const YamlNode* node, uint32_t val, yaml_writer_func wf, void*
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
bool w_swtchWarn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
data += (bitoffs >> 3UL);
|
||||
|
||||
// switchWarningState
|
||||
swarnstate_t states = *(swarnstate_t*)data;
|
||||
data += sizeof(swarnstate_t);
|
||||
|
||||
// switchWarningEnable
|
||||
swarnenable_t enables = *(swarnenable_t*)data;
|
||||
|
||||
for (int i = 0; i < STORAGE_NUM_SWITCHES; i++) {
|
||||
// decode check state
|
||||
// -> 2 bits per switch + enable
|
||||
swarnenable_t en = (enables >> i) & 0x01;
|
||||
if (en) continue;
|
||||
|
||||
// state == 0 -> no check
|
||||
// state == 1 -> UP
|
||||
// state == 2 -> MIDDLE
|
||||
// state == 3 -> DOWN
|
||||
char swtchWarn[2] = {(char)('A' + i), 0};
|
||||
|
||||
uint8_t state = (states >> (2 * i)) & 0x03;
|
||||
switch (state) {
|
||||
case 0:
|
||||
swtchWarn[1] = 'u';
|
||||
break;
|
||||
case 1:
|
||||
swtchWarn[1] = '-';
|
||||
break;
|
||||
case 2:
|
||||
swtchWarn[1] = 'd';
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
swtchWarn[1] = 'x';
|
||||
break;
|
||||
}
|
||||
|
||||
if (swtchWarn[1] != 0) {
|
||||
if (!wf(opaque, swtchWarn, 2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern const struct YamlIdStr enum_BeeperMode[];
|
||||
|
||||
|
||||
@@ -818,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -818,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -818,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -818,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -818,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -831,8 +831,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED( "switchWarningEnable", 16 ),
|
||||
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 ),
|
||||
|
||||
@@ -870,8 +870,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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", 64, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -803,8 +803,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -813,8 +813,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -810,8 +810,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -814,8 +814,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
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 ),
|
||||
|
||||
@@ -828,89 +828,94 @@ static bool swash_is_active(void* user, uint8_t* data, uint32_t bitoffs)
|
||||
return yaml_conv_220::swash_is_active(user, data, bitoffs);
|
||||
}
|
||||
|
||||
static uint32_t r_swtchWarn(const YamlNode* node, const char* val, uint8_t val_len)
|
||||
static void r_swtchWarn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
const char* val, uint8_t val_len)
|
||||
{
|
||||
// Read from string like 'AdBuC-':
|
||||
//
|
||||
// -> reads:
|
||||
// - Switch A: must be DOWN
|
||||
// - Switch B: must be UP
|
||||
// - Switch C: must be MIDDLE
|
||||
//
|
||||
// -> switches not in the list shall not be checked
|
||||
//
|
||||
swarnstate_t swtchWarn = 0;
|
||||
while(val_len--) {
|
||||
data += (bitoffs >> 3UL);
|
||||
swarnstate_t& swtchWarn = *(swarnstate_t*)data;
|
||||
|
||||
signed swtch = *(val++) - 'A';
|
||||
if (swtch >= NUM_SWITCHES)
|
||||
break;
|
||||
// Read from string like 'AdBuC-':
|
||||
//
|
||||
// -> reads:
|
||||
// - Switch A: must be DOWN
|
||||
// - Switch B: must be UP
|
||||
// - Switch C: must be MIDDLE
|
||||
//
|
||||
// -> switches not in the list shall not be checked
|
||||
//
|
||||
swtchWarn = 0;
|
||||
while (val_len--) {
|
||||
signed swtch = *(val++) - 'A';
|
||||
if (swtch >= NUM_SWITCHES) break;
|
||||
|
||||
unsigned state = 0;
|
||||
switch (*(val++)) {
|
||||
case 'u':
|
||||
state = 1;
|
||||
break;
|
||||
case '-':
|
||||
state = 2;
|
||||
break;
|
||||
case 'd':
|
||||
state = 3;
|
||||
break;
|
||||
default:
|
||||
// no check
|
||||
break;
|
||||
}
|
||||
|
||||
// 3 bits per switch
|
||||
swtchWarn |= (state << (3*swtch));
|
||||
unsigned state = 0;
|
||||
switch (*(val++)) {
|
||||
case 'u':
|
||||
state = 1;
|
||||
break;
|
||||
case '-':
|
||||
state = 2;
|
||||
break;
|
||||
case 'd':
|
||||
state = 3;
|
||||
break;
|
||||
default:
|
||||
// no check
|
||||
break;
|
||||
}
|
||||
|
||||
return swtchWarn;
|
||||
|
||||
// 3 bits per switch
|
||||
swtchWarn |= (state << (3 * swtch));
|
||||
}
|
||||
}
|
||||
|
||||
static bool w_swtchWarn(const YamlNode* node, uint32_t val, yaml_writer_func wf, void* opaque)
|
||||
static bool w_swtchWarn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
for (int i = 0; i < NUM_SWITCHES; i++) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
data += (bitoffs >> 3UL);
|
||||
swarnstate_t states = *(swarnstate_t*)data;
|
||||
|
||||
// decode check state
|
||||
// -> 3 bits per switch
|
||||
auto state = (val >> (3*i)) & 0x07;
|
||||
for (int i = 0; i < NUM_SWITCHES; i++) {
|
||||
// TODO: SWITCH_EXISTS() uses the g_eeGeneral stucture, which might not be
|
||||
// avail
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
// decode check state
|
||||
// -> 3 bits per switch
|
||||
auto state = (states >> (3 * i)) & 0x07;
|
||||
|
||||
// state == 0 -> no check
|
||||
// state == 1 -> UP
|
||||
// state == 2 -> MIDDLE
|
||||
// state == 3 -> DOWN
|
||||
char swtchWarn[2] = {(char)('A' + i), 0};
|
||||
// state == 0 -> no check
|
||||
// state == 1 -> UP
|
||||
// state == 2 -> MIDDLE
|
||||
// state == 3 -> DOWN
|
||||
char swtchWarn[2] = {(char)('A' + i), 0};
|
||||
|
||||
switch (state) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
swtchWarn[1] = 'u';
|
||||
break;
|
||||
case 2:
|
||||
swtchWarn[1] = '-';
|
||||
break;
|
||||
case 3:
|
||||
swtchWarn[1] = 'd';
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
swtchWarn[1] = 'x';
|
||||
break;
|
||||
}
|
||||
switch (state) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
swtchWarn[1] = 'u';
|
||||
break;
|
||||
case 2:
|
||||
swtchWarn[1] = '-';
|
||||
break;
|
||||
case 3:
|
||||
swtchWarn[1] = 'd';
|
||||
break;
|
||||
default:
|
||||
// this should never happen
|
||||
swtchWarn[1] = 'x';
|
||||
break;
|
||||
}
|
||||
|
||||
if (swtchWarn[1] != 0) {
|
||||
if (!wf(opaque, swtchWarn, 2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (swtchWarn[1] != 0) {
|
||||
if (!wf(opaque, swtchWarn, 2)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
extern const struct YamlIdStr enum_BeeperMode[];
|
||||
|
||||
@@ -851,7 +851,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -404,7 +404,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -819,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -404,7 +404,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -819,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -404,7 +404,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -819,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -404,7 +404,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -819,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -870,7 +870,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -868,7 +868,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -404,7 +404,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -819,8 +818,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -411,7 +411,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -832,8 +831,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED( "switchWarningEnable", 16 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -450,7 +450,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -871,8 +870,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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", 64, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 32 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 64 ),
|
||||
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 ),
|
||||
|
||||
@@ -391,7 +391,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -804,8 +803,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -399,7 +399,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -814,8 +813,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -396,7 +396,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -811,8 +810,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
@@ -398,7 +398,6 @@ static const struct YamlNode struct_RadioData[] = {
|
||||
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 ),
|
||||
@@ -815,8 +814,8 @@ static const struct YamlNode struct_ModelData[] = {
|
||||
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_UNSIGNED_CUST( "switchWarningState", 16, r_swtchWarn, w_swtchWarn ),
|
||||
YAML_UNSIGNED( "switchWarningEnable", 8 ),
|
||||
YAML_CUSTOM("switchWarningState",r_swtchWarn,w_swtchWarn),
|
||||
YAML_PADDING( 32 ),
|
||||
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 ),
|
||||
|
||||
Reference in New Issue
Block a user