Fixed serial port YAML writing
This commit is contained in:
@@ -1767,6 +1767,7 @@ static const struct YamlIdStr enum_UartModes[] = {
|
|||||||
{ UART_MODE_SBUS_TRAINER, "SBUS_TRAINER" },
|
{ UART_MODE_SBUS_TRAINER, "SBUS_TRAINER" },
|
||||||
{ UART_MODE_LUA, "LUA" },
|
{ UART_MODE_LUA, "LUA" },
|
||||||
{ UART_MODE_CLI, "CLI" },
|
{ UART_MODE_CLI, "CLI" },
|
||||||
|
{ UART_MODE_GPS, "GPS" },
|
||||||
{ 0, NULL }
|
{ 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1779,7 +1780,7 @@ static uint32_t port_read(void* user, const char* val, uint8_t val_len)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool port_write(void* user, yaml_writer_func wf, void* opaque)
|
static bool port_write(void* user, yaml_writer_func wf, void* opaque)
|
||||||
{
|
{
|
||||||
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
|
auto tw = reinterpret_cast<YamlTreeWalker*>(user);
|
||||||
uint16_t idx = tw->getElmts();
|
uint16_t idx = tw->getElmts();
|
||||||
@@ -1789,7 +1790,7 @@ bool port_write(void* user, yaml_writer_func wf, void* opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct YamlNode struct_serialConfig[] = {
|
static const struct YamlNode struct_serialConfig[] = {
|
||||||
YAML_IDX_CUST( "port", sw_read, sw_write),
|
YAML_IDX_CUST( "port", port_read, port_write),
|
||||||
YAML_ENUM( "mode", 4, enum_UartModes),
|
YAML_ENUM( "mode", 4, enum_UartModes),
|
||||||
YAML_END
|
YAML_END
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user