Improved logical switches
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#include <debug.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "switches.h"
|
||||
|
||||
namespace yaml_conv_220 {
|
||||
|
||||
#include "yaml_datastructs_funcs.cpp"
|
||||
|
||||
@@ -823,3 +823,66 @@ bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#define r_logicSw nullptr
|
||||
|
||||
static const struct YamlNode _ls_node_v1 = YAML_PADDING(10);
|
||||
static const struct YamlNode _ls_node_v2 = YAML_PADDING(16);
|
||||
|
||||
bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
data += bitoffs >> 3UL;
|
||||
data -= sizeof(LogicalSwitchData::func);
|
||||
|
||||
const char* str = nullptr;
|
||||
auto ls = reinterpret_cast<LogicalSwitchData*>(data);
|
||||
switch(lswFamily(ls->func)) {
|
||||
|
||||
case LS_FAMILY_BOOL:
|
||||
case LS_FAMILY_STICKY:
|
||||
if (!w_swtchSrc(&_ls_node_v1, ls->v1, wf, opaque)) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
if (!w_swtchSrc(&_ls_node_v2, ls->v2, wf, opaque)) return false;
|
||||
break;
|
||||
|
||||
case LS_FAMILY_EDGE:
|
||||
if (!w_swtchSrc(&_ls_node_v1, ls->v1, wf, opaque)) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
str = yaml_unsigned2str(lswTimerValue(ls->v2));
|
||||
if (!wf(opaque,str,strlen(str))) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
if (ls->v3 < 0) {
|
||||
if (!wf(opaque,"<",1)) return false;
|
||||
} else if(ls->v3 == 0) {
|
||||
if (!wf(opaque,"-",1)) return false;
|
||||
} else {
|
||||
str = yaml_unsigned2str(lswTimerValue(ls->v2 + ls->v3));
|
||||
}
|
||||
break;
|
||||
|
||||
case LS_FAMILY_COMP:
|
||||
if (!w_mixSrcRaw(nullptr, ls->v1, wf, opaque)) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
if (!w_mixSrcRaw(nullptr, ls->v2, wf, opaque)) return false;
|
||||
break;
|
||||
|
||||
case LS_FAMILY_TIMER:
|
||||
str = yaml_unsigned2str(lswTimerValue(ls->v1));
|
||||
if (!wf(opaque,str,strlen(str))) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
str = yaml_unsigned2str(lswTimerValue(ls->v2));
|
||||
if (!wf(opaque,str,strlen(str))) return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!w_mixSrcRaw(nullptr, ls->v1, wf, opaque)) return false;
|
||||
if (!wf(opaque,",",1)) return false;
|
||||
// TODO?: ls->v1 <= MIXSRC_LAST_CH ? calc100toRESX(ls->v2) : ls->v2
|
||||
str = yaml_signed2str(ls->v2);
|
||||
if (!wf(opaque,str,strlen(str))) return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -522,12 +522,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -539,12 +539,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -66,6 +66,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_TOUCH, "DISABLE_TOUCH" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
@@ -538,12 +539,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -499,12 +499,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -538,12 +538,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -476,12 +476,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -486,12 +486,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -483,12 +483,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -487,12 +487,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -67,6 +67,9 @@ namespace yaml_conv_220 {
|
||||
|
||||
bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
|
||||
bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque);
|
||||
};
|
||||
|
||||
//
|
||||
@@ -1044,3 +1047,91 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
{
|
||||
return yaml_conv_220::w_customFn(user, data, bitoffs, wf, opaque);
|
||||
}
|
||||
|
||||
#include "switches.h"
|
||||
|
||||
static delayval_t timerValue2lsw(uint32_t t)
|
||||
{
|
||||
if (t < 20) {
|
||||
return t - 129;
|
||||
} else if (600) {
|
||||
return t / 5 - 113;
|
||||
} else {
|
||||
return t / 10 - 53;
|
||||
}
|
||||
}
|
||||
|
||||
static void r_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
const char* val, uint8_t val_len)
|
||||
{
|
||||
data += bitoffs >> 3UL;
|
||||
data -= sizeof(LogicalSwitchData::func);
|
||||
|
||||
// find "," and cut val_len
|
||||
const char* sep = (const char *)memchr(val, ',', val_len);
|
||||
uint8_t l_sep = sep ? sep - val : val_len;
|
||||
|
||||
auto ls = reinterpret_cast<LogicalSwitchData*>(data);
|
||||
switch(lswFamily(ls->func)) {
|
||||
|
||||
case LS_FAMILY_BOOL:
|
||||
case LS_FAMILY_STICKY:
|
||||
ls->v1 = r_swtchSrc(nullptr, val, l_sep);
|
||||
val += l_sep; val_len -= l_sep;
|
||||
if (!val_len || val[0] != ',') return;
|
||||
val++; val_len--;
|
||||
ls->v2 = r_swtchSrc(nullptr, val, val_len);
|
||||
break;
|
||||
|
||||
case LS_FAMILY_EDGE:
|
||||
ls->v1 = r_swtchSrc(nullptr, val, l_sep);
|
||||
val += l_sep; val_len -= l_sep;
|
||||
if (!val_len || val[0] != ',') return;
|
||||
val++; val_len--;
|
||||
ls->v2 = timerValue2lsw(yaml_str2uint_ref(val, val_len));
|
||||
if (!val_len || val[0] != ',') return;
|
||||
val++; val_len--;
|
||||
if (val_len == 1) {
|
||||
if (val[0] == '<')
|
||||
ls->v3 = -1;
|
||||
else if (val[0] == '-')
|
||||
ls->v3 = 0;
|
||||
} else {
|
||||
int16_t t = (int16_t)timerValue2lsw(yaml_str2uint_ref(val, val_len));
|
||||
ls->v3 = t - ls->v2;
|
||||
}
|
||||
break;
|
||||
|
||||
case LS_FAMILY_COMP:
|
||||
ls->v1 = r_mixSrcRaw(nullptr, val, l_sep);
|
||||
val += l_sep; val_len -= l_sep;
|
||||
if (!val_len || val[0] != ',') return;
|
||||
val++; val_len--;
|
||||
ls->v2 = r_mixSrcRaw(nullptr, val, val_len);
|
||||
break;
|
||||
|
||||
case LS_FAMILY_TIMER:
|
||||
ls->v1 = timerValue2lsw(yaml_str2uint(val, l_sep));
|
||||
val += l_sep; val_len -= l_sep;
|
||||
if (!val_len || val[0] != ',') return;
|
||||
val++; val_len--;
|
||||
ls->v2 = timerValue2lsw(yaml_str2uint(val, val_len));
|
||||
break;
|
||||
|
||||
default:
|
||||
ls->v1 = r_mixSrcRaw(nullptr, val, l_sep);
|
||||
val += l_sep; val_len -= l_sep;
|
||||
if (!val_len || val[0] != ',') return;
|
||||
val++; val_len--;
|
||||
// TODO?: ls->v1 <= MIXSRC_LAST_CH ? calc100toRESX(ls->v2) : ls->v2
|
||||
ls->v2 = yaml_str2int_ref(val, val_len);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
|
||||
yaml_writer_func wf, void* opaque)
|
||||
{
|
||||
return yaml_conv_220::w_logicSw(user, data, bitoffs, wf, opaque);
|
||||
}
|
||||
|
||||
@@ -522,12 +522,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -539,12 +539,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -66,6 +66,7 @@ const struct YamlIdStr enum_Functions[] = {
|
||||
{ FUNC_BACKLIGHT, "BACKLIGHT" },
|
||||
{ FUNC_SCREENSHOT, "SCREENSHOT" },
|
||||
{ FUNC_RACING_MODE, "RACING_MODE" },
|
||||
{ FUNC_DISABLE_TOUCH, "DISABLE_TOUCH" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
const struct YamlIdStr enum_UartModes[] = {
|
||||
@@ -538,12 +539,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -491,12 +491,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -499,12 +499,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -538,12 +538,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -476,12 +476,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -486,12 +486,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -483,12 +483,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
@@ -487,12 +487,13 @@ static const struct YamlNode struct_signed_8[] = {
|
||||
static const struct YamlNode struct_LogicalSwitchData[] = {
|
||||
YAML_IDX,
|
||||
YAML_ENUM("func", 8, enum_LogicalSwitchesFunctions),
|
||||
YAML_SIGNED( "v1", 10 ),
|
||||
YAML_SIGNED( "v3", 10 ),
|
||||
YAML_CUSTOM("def",r_logicSw,w_logicSw),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_PADDING( 10 ),
|
||||
YAML_SIGNED_CUST( "andsw", 9, r_swtchSrc, w_swtchSrc ),
|
||||
YAML_PADDING( 1 ),
|
||||
YAML_PADDING( 2 ),
|
||||
YAML_SIGNED( "v2", 16 ),
|
||||
YAML_PADDING( 16 ),
|
||||
YAML_UNSIGNED( "delay", 8 ),
|
||||
YAML_UNSIGNED( "duration", 8 ),
|
||||
YAML_END
|
||||
|
||||
Reference in New Issue
Block a user