feat(color): use dynamic memory allocation for screen & widget data (#6782)

This commit is contained in:
philmoz
2025-11-19 13:35:42 +10:00
committed by GitHub
parent 003fcacad0
commit 5c96b1e15c
96 changed files with 2512 additions and 1895 deletions
+3
View File
@@ -343,6 +343,9 @@ const char * readModelYaml(const char * filename, uint8_t * buffer, uint32_t siz
#if defined(FUNCTION_SWITCHES)
extern void initCustomSwitches();
initCustomSwitches();
#endif
#if defined(COLORLCD)
g_model.initScreenData();
#endif
auto md = reinterpret_cast<ModelData*>(buffer);
#if defined(FLIGHT_MODES) && defined(GVARS)
+6 -6
View File
@@ -167,19 +167,19 @@ void postModelLoad(bool alarms)
g_model.topbarWidgetWidth[i] = 1;
// Load 'date time' widget if slot is empty
if (g_model.topbarData.zones[MAX_TOPBAR_ZONES-1].widgetName[0] == 0) {
strAppend(g_model.topbarData.zones[MAX_TOPBAR_ZONES-1].widgetName, "Date Time", WIDGET_NAME_LEN);
if (!g_model.getTopbarData()->hasWidget(MAX_TOPBAR_ZONES-1)) {
g_model.getTopbarData()->setWidgetName(MAX_TOPBAR_ZONES-1, "Date Time");
storageDirty(EE_MODEL);
}
// Load 'radio info' widget if slot is empty
if (g_model.topbarData.zones[MAX_TOPBAR_ZONES-2].widgetName[0] == 0) {
strAppend(g_model.topbarData.zones[MAX_TOPBAR_ZONES-2].widgetName, "Radio Info", WIDGET_NAME_LEN);
if (!g_model.getTopbarData()->hasWidget(MAX_TOPBAR_ZONES-2)) {
g_model.getTopbarData()->setWidgetName(MAX_TOPBAR_ZONES-2, "Radio Info");
storageDirty(EE_MODEL);
}
#if defined(INTERNAL_GPS)
// Load 'internal gps' widget if slot is empty
if (g_model.topbarData.zones[MAX_TOPBAR_ZONES-3].widgetName[0] == 0) {
strAppend(g_model.topbarData.zones[MAX_TOPBAR_ZONES-3].widgetName, "Internal GPS", WIDGET_NAME_LEN);
if (!g_model.getTopbarData()->hasWidget(MAX_TOPBAR_ZONES-3)) {
g_model.getTopbarData()->setWidgetName(MAX_TOPBAR_ZONES-3, "Internal GPS");
storageDirty(EE_MODEL);
}
#endif
@@ -83,6 +83,3 @@
#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");
+32 -30
View File
@@ -209,15 +209,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -786,45 +777,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_USBJoystickChData[] = {
@@ -887,8 +889,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
+344 -46
View File
@@ -551,65 +551,138 @@ static bool w_vbat_max(const YamlNode* node, uint32_t val, yaml_writer_func wf,
}
#if defined(COLORLCD)
static uint8_t select_zov(void* user, uint8_t* data, uint32_t bitoffs)
bool screen_is_active(void* user, uint8_t* data, uint32_t bitoffs)
{
data += bitoffs >> 3UL;
data -= offsetof(ZoneOptionValueTyped, value);
ZoneOptionValueEnum* p_zovt = (ZoneOptionValueEnum*)data;
if (*p_zovt > ZOV_Color) return 0;
return *p_zovt;
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
auto screenData = g_model.getScreenData(tw->getElmts());
return !screenData->LayoutId.empty();
}
void r_zov_source(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
data += bitoffs >> 3UL;
auto p_val = reinterpret_cast<ZoneOptionValue*>(data);
p_val->unsignedValue = r_mixSrcRaw(nullptr, val, val_len);
}
bool w_zov_source(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
data += bitoffs >> 3UL;
auto p_val = reinterpret_cast<ZoneOptionValue*>(data);
return w_mixSrcRaw(nullptr, p_val->unsignedValue, wf, opaque);
}
void r_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
void r_screen_id(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
data += bitoffs >> 3UL;
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
auto screenData = g_model.getScreenData(tw->getElmts(1));
ZoneOptionValue zov;
screenData->LayoutId = val;
}
bool w_screen_id(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
auto screenData = g_model.getScreenData(tw->getElmts(1));
return wf(opaque, screenData->LayoutId.c_str(), screenData->LayoutId.size());
}
static ZonePersistentData* get_zoneData(void* user)
{
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
int lvl = tw->getLevel();
bool topBar = (lvl == 3) || (lvl == 4);
int o = (lvl == 3) || (lvl == 5) ? 0 : 1;
uint16_t zone = tw->getElmts(o);
if (topBar) {
// Top Bar
return &g_model.getTopbarData()->zones[zone];
} else {
// Screen
uint16_t screen = tw->getElmts(o + 3);
return &g_model.getScreenLayoutData(screen)->zones[zone];
}
}
bool widget_is_active(void* user, uint8_t* data, uint32_t bitoffs)
{
auto zoneData = get_zoneData(user);
return zoneData->widgetName[0] != 0;
}
void r_widget_name(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
auto zoneData = get_zoneData(user);
zoneData->widgetName = val;
}
bool w_widget_name(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
auto zoneData = get_zoneData(user);
return wf(opaque, zoneData->widgetName.c_str(), zoneData->widgetName.size());
}
static WidgetPersistentData* get_widgetData(void* user, uint16_t& option)
{
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
int lvl = tw->getLevel();
bool topBar = (lvl == 7) || (lvl == 8);
int o = ((lvl == 7) || (lvl == 9)) ? 1 : 2;
option = tw->getElmts(o);
uint16_t zone = tw->getElmts(o + 3);
if (topBar) {
// Top Bar
return g_model.getTopbarData()->getWidgetData(zone);
} else {
// Screen
uint16_t screen = tw->getElmts(o + 6);
return g_model.getScreenLayoutData(screen)->getWidgetData(zone);
}
}
bool widget_option_is_active(void* user, uint8_t* data, uint32_t bitoffs)
{
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
int lvl = tw->getLevel();
bool topBar = (lvl == 6);
int o = 0;
WidgetPersistentData* widgetData;
uint16_t option = tw->getElmts(o);
uint16_t zone = tw->getElmts(o + 3);
if (topBar) {
// Top Bar
widgetData = g_model.getTopbarData()->getWidgetData(zone);
} else {
// Screen
uint16_t screen = tw->getElmts(o + 6);
widgetData = g_model.getScreenLayoutData(screen)->getWidgetData(zone);
}
return widgetData->hasOption(option);
}
static uint32_t get_color(const char* val, uint8_t val_len)
{
if (strncmp(val, "COLIDX", 6) == 0) {
val += 6; val_len -= 6;
zov.unsignedValue = COLOR2FLAGS(yaml_str2uint(val, val_len));
return COLOR2FLAGS(yaml_str2uint(val, val_len));
} else {
if (val_len < sizeof("0xFFFFFF")-1
|| val[0] != '0'
|| val[1] != 'x')
return;
return 0;
val += 2; val_len -= 2;
auto rgb24 = yaml_hex2uint(val, val_len);
zov.unsignedValue = RGB2FLAGS((rgb24 & 0xFF0000) >> 16,
(rgb24 & 0xFF00) >> 8, rgb24 & 0xFF);
return RGB2FLAGS((rgb24 & 0xFF0000) >> 16, (rgb24 & 0xFF00) >> 8, rgb24 & 0xFF);
}
memcpy(data, &zov, sizeof(ZoneOptionValue));
}
bool w_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
static bool set_color(uint32_t val, yaml_writer_func wf, void* opaque)
{
data += bitoffs >> 3UL;
ZoneOptionValue zov;
memcpy(&zov, data, sizeof(ZoneOptionValue));
uint32_t val = zov.unsignedValue;
if (val & RGB_FLAG) {
val = COLOR_VAL(val);
uint32_t color = (uint32_t)GET_RED(val) << 16 |
@@ -623,6 +696,232 @@ bool w_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
return wf(opaque, str, strlen(str));
}
}
static uint8_t select_wov(void* user, uint8_t* data, uint32_t bitoffs)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
return widgetData->getType(option);
}
const struct YamlIdStr enum_WidgetOptionValueEnum[] = {
{ WOV_Unsigned, "Unsigned" },
{ WOV_Signed, "Signed" },
{ WOV_Bool, "Bool" },
{ WOV_String, "String" },
{ WOV_Source, "Source" },
{ WOV_Color, "Color" },
{ 0, NULL }
};
void r_wov_type(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
widgetData->setType(option, (WidgetOptionValueEnum)yaml_parse_enum(enum_WidgetOptionValueEnum, val, val_len));
}
bool w_wov_type(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
const char* str = yaml_output_enum(widgetData->getType(option), enum_WidgetOptionValueEnum);
return wf(opaque, str, strlen(str));
}
void r_wov_source(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
widgetData->setUnsignedValue(option, r_mixSrcRaw(nullptr, val, val_len));
}
bool w_wov_source(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
return w_mixSrcRaw(nullptr, widgetData->getUnsignedValue(option), wf, opaque);
}
void r_wov_color(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
widgetData->setUnsignedValue(option, get_color(val, val_len));
}
bool w_wov_color(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
return set_color(widgetData->getUnsignedValue(option), wf, opaque);
}
void r_wov_string(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
widgetData->setString(option, val);
}
bool w_wov_string(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
return wf(opaque, widgetData->getString(option).c_str(), widgetData->getString(option).size());
}
void r_wov_unsigned(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
widgetData->setUnsignedValue(option, yaml_str2uint(val, val_len));
}
bool w_wov_unsigned(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
const char* str = yaml_unsigned2str(widgetData->getUnsignedValue(option));
return wf(opaque, str, strlen(str));
}
void r_wov_signed(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
widgetData->setSignedValue(option, yaml_str2int(val, val_len));
}
bool w_wov_signed(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto widgetData = get_widgetData(user, option);
const char* str = yaml_signed2str(widgetData->getSignedValue(option));
return wf(opaque, str, strlen(str));
}
static LayoutPersistentData* get_LayoutData(void* user, uint16_t& option)
{
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
int lvl = tw->getLevel();
int o = (lvl == 6) ? 1 : 2;
option = tw->getElmts(o);
// Screen
uint16_t screen = tw->getElmts(o + 3);
return g_model.getScreenLayoutData(screen);
}
bool layout_option_is_active(void* user, uint8_t* data, uint32_t bitoffs)
{
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
int o = 0;
uint16_t option = tw->getElmts(o);
uint16_t screen = tw->getElmts(o + 3);
auto layoutData = g_model.getScreenLayoutData(screen);
return layoutData->options[option].type != LOV_None || layoutData->options[option].value.unsignedValue != 0;
}
static uint8_t select_lov(void* user, uint8_t* data, uint32_t bitoffs)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
return layoutData->options[option].type;
}
const struct YamlIdStr enum_LayoutOptionValueEnum[] = {
{ LOV_None, "None" },
{ LOV_Bool, "Bool" },
{ LOV_Color, "Color" },
{ 0, NULL }
};
void r_lov_type(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
layoutData->options[option].type = (LayoutOptionValueEnum)yaml_parse_enum(enum_LayoutOptionValueEnum, val, val_len);
}
bool w_lov_type(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
const char* str = yaml_output_enum(layoutData->options[option].type, enum_LayoutOptionValueEnum);
return wf(opaque, str, strlen(str));
}
void r_lov_unsigned(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
layoutData->options[option].value.unsignedValue = yaml_str2uint(val, val_len);
}
bool w_lov_unsigned(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
const char* str = yaml_unsigned2str(layoutData->options[option].value.unsignedValue);
return wf(opaque, str, strlen(str));
}
void r_lov_color(void* user, uint8_t* data, uint32_t bitoffs,
const char* val, uint8_t val_len)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
layoutData->options[option].value.unsignedValue = get_color(val, val_len);
}
bool w_lov_color(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque)
{
uint16_t option;
auto layoutData = get_LayoutData(user, option);
return set_color(layoutData->options[option].value.unsignedValue, wf, opaque);
}
#endif
static uint8_t select_mod_type(void* user, uint8_t* data, uint32_t bitoffs)
@@ -1004,8 +1303,7 @@ static uint32_t r_swtchSrc(const YamlNode* node, const char* val, uint8_t val_le
val_len--;
}
if (val_len > 3
&& ((val[0] == 'S' && val[1] >= 'W')
if (val_len > 3 && ((val[0] == 'S' && val[1] >= 'W')
|| (val[0] == 'F' && val[1] >= 'L'))
&& val[2] >= '0' && val[2] <= '9'
&& val[3] >= '0' && val[3] <= '2') {
@@ -2496,11 +2794,6 @@ bool cfsGroupIsActive(void* user, uint8_t* data, uint32_t bitoffs)
uint16_t idx = tw->getElmts();
return idx > 0 && idx <= NUM_FUNCTIONS_GROUPS;
}
bool isAlwaysActive(void* user, uint8_t* data, uint32_t bitoffs)
{
return true;
}
#endif
bool switchIsActive(void* user, uint8_t* data, uint32_t bitoffs)
@@ -2509,3 +2802,8 @@ bool switchIsActive(void* user, uint8_t* data, uint32_t bitoffs)
uint16_t idx = tw->getElmts();
return idx < switchGetMaxAllSwitches();
}
bool isAlwaysActive(void* user, uint8_t* data, uint32_t bitoffs)
{
return true;
}
@@ -200,15 +200,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -777,45 +768,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 4, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 4, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_USBJoystickChData[] = {
@@ -878,8 +880,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 5888, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 4, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -207,15 +207,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -784,45 +775,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 4, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 4, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_USBJoystickChData[] = {
@@ -886,8 +888,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 5888, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 4, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -221,15 +221,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -809,45 +800,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 5, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 5, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_customSwitch[] = {
@@ -924,8 +926,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 99, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 7328, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 5, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -207,15 +207,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -784,45 +775,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_USBJoystickChData[] = {
@@ -886,8 +888,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -200,15 +200,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -777,45 +768,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_USBJoystickChData[] = {
@@ -878,8 +880,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -221,15 +221,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -809,45 +800,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_customSwitch[] = {
@@ -924,8 +926,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 99, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
+32 -30
View File
@@ -216,15 +216,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -794,45 +785,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_customSwitch[] = {
@@ -904,8 +906,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -221,15 +221,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -809,45 +800,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_customSwitch[] = {
@@ -924,8 +926,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 99, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -221,15 +221,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -809,45 +800,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_customSwitch[] = {
@@ -924,8 +926,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 99, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
+32 -30
View File
@@ -208,15 +208,6 @@ const struct YamlIdStr enum_TelemetrySensorType[] = {
{ TELEM_TYPE_CALCULATED, "TYPE_CALCULATED" },
{ 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_USBJoystickIfMode[] = {
{ USBJOYS_JOYSTICK, "JOYSTICK" },
{ USBJOYS_GAMEPAD, "GAMEPAD" },
@@ -785,45 +776,56 @@ static const struct YamlNode struct_TelemetrySensor[] = {
YAML_UNION("cfg", 32, union_anonymous_17_elmts, select_sensor_cfg),
YAML_END
};
static const struct YamlNode union_ZoneOptionValue_elmts[] = {
YAML_UNSIGNED( "unsignedValue", 32 ),
YAML_SIGNED( "signedValue", 32 ),
YAML_UNSIGNED( "boolValue", 32 ),
YAML_STRING("stringValue", 12),
YAML_CUSTOM("source",r_zov_source,w_zov_source),
YAML_CUSTOM("color",r_zov_color,w_zov_color),
static const struct YamlNode union_WidgetOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("signedValue",r_wov_signed,w_wov_signed),
YAML_CUSTOM("boolValue",r_wov_unsigned,w_wov_unsigned),
YAML_CUSTOM("stringValue",r_wov_string,w_wov_string),
YAML_CUSTOM("source",r_wov_source,w_wov_source),
YAML_CUSTOM("color",r_wov_color,w_wov_color),
YAML_END
};
static const struct YamlNode struct_ZoneOptionValueTyped[] = {
static const struct YamlNode struct_WidgetOptionValueTyped[] = {
YAML_IDX,
YAML_ENUM("type", 32, enum_ZoneOptionValueEnum, NULL),
YAML_UNION("value", 96, union_ZoneOptionValue_elmts, select_zov),
YAML_CUSTOM("type",r_wov_type,w_wov_type),
YAML_UNION("value", 0, union_WidgetOptionValue_elmts, select_wov),
YAML_END
};
static const struct YamlNode struct_WidgetPersistentData[] = {
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("options", 0, 50, struct_WidgetOptionValueTyped, widget_option_is_active),
YAML_END
};
static const struct YamlNode struct_ZonePersistentData[] = {
YAML_IDX,
YAML_STRING("widgetName", 20),
YAML_STRUCT("widgetData", 1280, struct_WidgetPersistentData, NULL),
YAML_CUSTOM("widgetName",r_widget_name,w_widget_name),
YAML_STRUCT("widgetData", 0, struct_WidgetPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode union_LayoutOptionValue_elmts[] = {
YAML_CUSTOM("unsignedValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("boolValue",r_lov_unsigned,w_lov_unsigned),
YAML_CUSTOM("color",r_lov_color,w_lov_color),
YAML_END
};
static const struct YamlNode struct_LayoutOptionValueTyped[] = {
YAML_IDX,
YAML_CUSTOM("type",r_lov_type,w_lov_type),
YAML_UNION("value", 0, union_LayoutOptionValue_elmts, select_lov),
YAML_END
};
static const struct YamlNode struct_LayoutPersistentData[] = {
YAML_ARRAY("zones", 1440, 10, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 10, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 10, struct_ZonePersistentData, widget_is_active),
YAML_ARRAY("options", 0, 10, struct_LayoutOptionValueTyped, layout_option_is_active),
YAML_END
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 15680, struct_LayoutPersistentData, NULL),
YAML_CUSTOM("LayoutId",r_screen_id,w_screen_id),
YAML_STRUCT("layoutData", 0, struct_LayoutPersistentData, isAlwaysActive),
YAML_END
};
static const struct YamlNode struct_TopBarPersistentData[] = {
YAML_ARRAY("zones", 1440, 6, struct_ZonePersistentData, NULL),
YAML_ARRAY("options", 128, 1, struct_ZoneOptionValueTyped, NULL),
YAML_ARRAY("zones", 0, 6, struct_ZonePersistentData, widget_is_active),
YAML_END
};
static const struct YamlNode struct_USBJoystickChData[] = {
@@ -886,8 +888,8 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 16, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 15776, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 8768, struct_TopBarPersistentData, NULL),
YAML_ARRAY("screenData", 0, 10, struct_CustomScreenData, screen_is_active),
YAML_STRUCT("topbarData", 0, struct_TopBarPersistentData, isAlwaysActive),
YAML_ARRAY("topbarWidgetWidth", 8, 6, struct_unsigned_8, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
+2 -2
View File
@@ -107,7 +107,7 @@ static bool to_next_elmt(void* ctx)
return true;
}
static bool find_node(void* ctx, char* buf, uint8_t len)
static bool find_node(void* ctx, const char* buf, uint8_t len)
{
labelslist_iter* mi = (labelslist_iter*)ctx;
@@ -170,7 +170,7 @@ static bool find_node(void* ctx, char* buf, uint8_t len)
return true;
}
static void set_attr(void* ctx, char* buf, uint16_t len)
static void set_attr(void* ctx, const char* buf, uint16_t len)
{
char value[LABELS_LENGTH + 1];
if(len > LABELS_LENGTH) {
+2 -2
View File
@@ -82,7 +82,7 @@ static bool to_next_elmt(void* ctx)
return true;
}
static bool find_node(void* ctx, char* buf, uint8_t len)
static bool find_node(void* ctx, const char* buf, uint8_t len)
{
modelslist_iter* mi = (modelslist_iter*)ctx;
@@ -95,7 +95,7 @@ static bool find_node(void* ctx, char* buf, uint8_t len)
return true;
}
static void set_attr(void* ctx, char* buf, uint16_t len)
static void set_attr(void* ctx, const char* buf, uint16_t len)
{
char fnamebuf[LEN_MODEL_FILENAME + 1];
modelslist_iter* mi = (modelslist_iter*)ctx;
+24 -40
View File
@@ -50,7 +50,8 @@ void YamlParser::reset()
indents[level] = indent;
state = saved_state = ps_Indent;
}
indent = scratch_len = 0;
indent = 0;
scratch_buf.clear();
node_found = false;
}
@@ -79,17 +80,6 @@ uint8_t YamlParser::getLastIndent()
YamlParser::YamlResult
YamlParser::parse(const char* buffer, unsigned int size)
{
#define CONCAT_STR(s,s_len,c) \
{ \
if(s_len < MAX_STR) \
s[s_len++] = c; \
else { \
TRACE_YAML("STRING_OVERFLOW"); \
return STRING_OVERFLOW; \
} \
}
const char* c = buffer;
const char* end = c + size;
@@ -153,7 +143,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_AttrQuo;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
break;
case ps_AttrQuo:
@@ -161,7 +151,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_Attr;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
break;
case ps_Attr:
@@ -170,16 +160,15 @@ YamlParser::parse(const char* buffer, unsigned int size)
break;
}
if ((*c != ':') && (*c != '\r') && (*c != '\n'))
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
// trap
case ps_AttrSP:
if (*c == '\r' || *c == '\n') {
if (state == ps_Attr) {
// TODO: trim spaces at the end?
node_found = calls->find_node(ctx, scratch_buf, scratch_len);
node_found = calls->find_node(ctx, scratch_buf.c_str(), scratch_buf.size());
if (!node_found) {
TRACE_YAML("YAML_PARSER: Could not find node '%.*s' (2)\n",
scratch_len, scratch_buf);
TRACE_YAML("YAML_PARSER: Could not find node '%s' (2)\n", scratch_buf.c_str());
}
}
saved_state = state;
@@ -189,10 +178,9 @@ YamlParser::parse(const char* buffer, unsigned int size)
if (*c == ':') {
if (state == ps_Attr) {
// TODO: trim spaces at the end?
node_found = calls->find_node(ctx, scratch_buf, scratch_len);
node_found = calls->find_node(ctx, scratch_buf.c_str(), scratch_buf.size());
if (!node_found) {
TRACE_YAML("YAML_PARSER: Could not find node '%.*s' (3)\n",
scratch_len, scratch_buf);
TRACE_YAML("YAML_PARSER: Could not find node '%s' (3)\n", scratch_buf.c_str);
}
}
state = ps_Sep;
@@ -209,7 +197,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
continue;
}
state = ps_Val;
scratch_len = 0;
scratch_buf.clear();
if (*c == '\"') {
state = ps_ValQuo;
break;
@@ -218,7 +206,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_ValEsc;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
break;
case ps_ValQuo:
@@ -230,7 +218,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_ValEsc1;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
break;
case ps_ValEsc1:
@@ -238,22 +226,18 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_ValEsc2;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
state = ps_ValQuo;
break;
case ps_ValEsc2:
if(scratch_len >= MAX_STR) {
TRACE_YAML("STRING_OVERFLOW");
return STRING_OVERFLOW;
}
else if (*c >= '0' && *c <= '9') {
scratch_buf[scratch_len] = (*c - '0') << 4;
if (*c >= '0' && *c <= '9') {
escHexVal = (*c - '0') << 4;
state = ps_ValEsc3;
break;
}
else if (*c >= 'A' && *c <= 'F') {
scratch_buf[scratch_len] = (*c - 'A' + 10) << 4;
escHexVal = (*c - 'A' + 10) << 4;
state = ps_ValEsc3;
break;
}
@@ -262,12 +246,14 @@ YamlParser::parse(const char* buffer, unsigned int size)
case ps_ValEsc3:
if (*c >= '0' && *c <= '9') {
scratch_buf[scratch_len++] |= (*c - '0');
escHexVal |= (*c - '0');
scratch_buf += escHexVal;
state = ps_ValQuo;
break;
}
else if (*c >= 'A' && *c <= 'F') {
scratch_buf[scratch_len++] |= (*c - 'A' + 10);
escHexVal |= (*c - 'A' + 10);
scratch_buf += escHexVal;
state = ps_ValQuo;
break;
}
@@ -278,8 +264,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
if (*c == '\r' || *c == '\n') {
// set attribute
if (node_found) {
// TODO: trim spaces at the end?
calls->set_attr(ctx, scratch_buf, scratch_len);
calls->set_attr(ctx, scratch_buf.c_str(), scratch_buf.size());
}
saved_state = state;
state = ps_CRLF;
@@ -289,12 +274,12 @@ YamlParser::parse(const char* buffer, unsigned int size)
state = ps_ValEsc;
break;
}
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
break;
case ps_ValEsc:
state = ps_Val;
CONCAT_STR(scratch_buf, scratch_len, *c);
scratch_buf += *c;
break;
case ps_CRLF:
@@ -311,8 +296,7 @@ YamlParser::parse(const char* buffer, unsigned int size)
} // for each char
if ((state == ps_Val) && eof && node_found) {
// TODO: trim spaces at the end?
calls->set_attr(ctx, scratch_buf, scratch_len);
calls->set_attr(ctx, scratch_buf.c_str(), scratch_buf.size());
}
return CONTINUE_PARSING;
+6 -7
View File
@@ -22,8 +22,8 @@
#pragma once
#include <stdint.h>
#include <string>
#define MAX_STR 256
#define MAX_DEPTH 16 // 12 real + 4 virtual
struct YamlParserCalls
@@ -31,8 +31,8 @@ struct YamlParserCalls
bool (*to_parent) (void* ctx);
bool (*to_child) (void* ctx);
bool (*to_next_elmt) (void* ctx);
bool (*find_node) (void* ctx, char* buf, uint8_t len);
void (*set_attr) (void* ctx, char* buf, uint16_t len);
bool (*find_node) (void* ctx, const char* buf, uint8_t len);
void (*set_attr) (void* ctx, const char* buf, uint16_t len);
};
class YamlParser
@@ -65,11 +65,10 @@ class YamlParser
// parser state
uint8_t state;
uint8_t saved_state;
char escHexVal;
// scratch buffer w/ 16 bytes
// used for attribute and values
char scratch_buf[MAX_STR];
uint16_t scratch_len;
// scratch buffer used for attribute and values
std::string scratch_buf;
bool node_found;
bool eof;
+3 -3
View File
@@ -442,7 +442,7 @@ void YamlTreeWalker::toNextAttr()
}
}
void YamlTreeWalker::setAttrValue(char* buf, uint16_t len)
void YamlTreeWalker::setAttrValue(const char* buf, uint16_t len)
{
if (!buf || !len || isIdxInvalid())
return;
@@ -686,12 +686,12 @@ static bool to_next_elmt(void* ctx)
return ((YamlTreeWalker*)ctx)->toNextElmt();
}
static bool find_node(void* ctx, char* buf, uint8_t len)
static bool find_node(void* ctx, const char* buf, uint8_t len)
{
return ((YamlTreeWalker*)ctx)->findNode(buf,len);
}
static void set_attr(void* ctx, char* buf, uint16_t len)
static void set_attr(void* ctx, const char* buf, uint16_t len)
{
((YamlTreeWalker*)ctx)->setAttrValue(buf,len);
}
+1 -1
View File
@@ -155,7 +155,7 @@ public:
bool isElmtEmpty(uint8_t* data);
void setAttrValue(char* buf, uint16_t len);
void setAttrValue(const char* buf, uint16_t len);
bool generate(yaml_writer_func wf, void* opaque);