diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 051750385..f66bd4822 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -116,33 +116,33 @@ static inline void check_struct() CHKSIZE(TrainerData, 16); #if defined(PCBXLITES) - CHKSIZE(RadioData, 859); + CHKSIZE(RadioData, 861); CHKSIZE(ModelData, 6161); #elif defined(PCBXLITE) - CHKSIZE(RadioData, 857); + CHKSIZE(RadioData, 859); CHKSIZE(ModelData, 6161); #elif defined(RADIO_TPRO) - CHKSIZE(RadioData, 840); + CHKSIZE(RadioData, 842); CHKSIZE(ModelData, 6186); #elif defined(PCBX7) - CHKSIZE(RadioData, 863); + CHKSIZE(RadioData, 865); CHKSIZE(ModelData, 6161); #elif defined(PCBX9E) - CHKSIZE(RadioData, 953); + CHKSIZE(RadioData, 955); CHKSIZE(ModelData, 6613); #elif defined(PCBX9D) || defined(PCBX9DP) - CHKSIZE(RadioData, 895); + CHKSIZE(RadioData, 897); CHKSIZE(ModelData, 6605); #elif defined(PCBHORUS) #if defined(PCBX10) - CHKSIZE(RadioData, 919); + CHKSIZE(RadioData, 921); CHKSIZE(ModelData, 11025); #else - CHKSIZE(RadioData, 901); + CHKSIZE(RadioData, 903); CHKSIZE(ModelData, 11023); #endif #elif defined(PCBNV14) - CHKSIZE(RadioData, 849); + CHKSIZE(RadioData, 851); CHKSIZE(ModelData, 10839); #endif diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index 0be20cbeb..eb064ae8d 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -902,7 +902,7 @@ PACK(struct RadioData { CUST_ATTR(auxSerialMode, r_serialMode, nullptr); CUST_ATTR(aux2SerialMode, r_serialMode, nullptr); - NOBACKUP(uint16_t serialPort ARRAY(STORAGE_SERIAL_PORTS,struct_serialConfig,nullptr)); + NOBACKUP(uint32_t serialPort ARRAY(SERIAL_CONF_BITS_PER_PORT,struct_serialConfig,nullptr)); EXTRA_GENERAL_FIELDS diff --git a/radio/src/gui/colorlcd/radio_hardware.cpp b/radio/src/gui/colorlcd/radio_hardware.cpp index 4446a6799..ad22367d1 100644 --- a/radio/src/gui/colorlcd/radio_hardware.cpp +++ b/radio/src/gui/colorlcd/radio_hardware.cpp @@ -235,6 +235,20 @@ class SerialConfigWindow : public FormGroup aux->setAvailableHandler( [=](int value) { return isSerialModeAvailable(port_nr, value); }); grid.nextLine(); + + if (port_nr < SP_VCP) + { + new StaticText(this, grid.getLabelSlot(), "Port power:", 0, COLOR_THEME_PRIMARY1); + new CheckBox( + this, grid.getFieldSlot(1, 0), + [=] { return serialGetPower(port_nr); }, + [=](int32_t newValue) { + serialSetPower(port_nr, newValue); + SET_DIRTY(); + } + ); + grid.nextLine(); + } } if (display_ttl_warning) { diff --git a/radio/src/serial.cpp b/radio/src/serial.cpp index 6006ec144..4eb047246 100644 --- a/radio/src/serial.cpp +++ b/radio/src/serial.cpp @@ -86,17 +86,31 @@ int8_t getSerialPortMode(uint8_t port_nr) #if !defined(BOOT) if (port_nr < MAX_SERIAL_PORTS) { auto cfg = g_eeGeneral.serialPort; - cfg >>= port_nr * 4; // 4 bits per port - return cfg & 0xF; + cfg >>= port_nr * SERIAL_CONF_BITS_PER_PORT; + return cfg & SERIAL_CONF_MODE_MASK; } #endif return UART_MODE_NONE; } +static bool getSerialPower(uint8_t port_nr) +{ +#if !defined(BOOT) + if (port_nr < MAX_SERIAL_PORTS) { + auto cfg = g_eeGeneral.serialPort; + cfg >>= (port_nr * SERIAL_CONF_BITS_PER_PORT); + return cfg & (1 << SERIAL_CONF_POWER_BIT); + } +#endif + + return false; +} + struct SerialPortState { uint8_t mode; + bool power; const etx_serial_port_t* port; void* usart_ctx; }; @@ -189,7 +203,7 @@ static void serialSetCallBacks(int mode, void* ctx, const etx_serial_port_t* por } } -static void serialSetupPort(int mode, etx_serial_init& params, bool& power_required) +static void serialSetupPort(int mode, etx_serial_init& params) { switch (mode) { @@ -203,7 +217,6 @@ static void serialSetupPort(int mode, etx_serial_init& params, bool& power_requi #if !defined(BOOT) case UART_MODE_TELEMETRY_MIRROR: // TODO: query telemetry baudrate / add setting for module - power_required = true; #if defined(CROSSFIRE) if (modelTelemetryProtocol() == PROTOCOL_TELEMETRY_CROSSFIRE) { params.baudrate = CROSSFIRE_TELEM_MIRROR_BAUDRATE; @@ -217,7 +230,6 @@ static void serialSetupPort(int mode, etx_serial_init& params, bool& power_requi if (modelTelemetryProtocol() == PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY) { params.baudrate = FRSKY_D_BAUDRATE; params.rx_enable = true; - power_required = true; } break; @@ -227,14 +239,12 @@ static void serialSetupPort(int mode, etx_serial_init& params, bool& power_requi params.parity = ETX_Parity_Even; params.stop_bits = ETX_StopBits_Two; params.rx_enable = true; - power_required = true; break; #if defined(LUA) case UART_MODE_LUA: params.baudrate = LUA_DEFAULT_BAUDRATE; params.rx_enable = true; - power_required = true; break; #endif @@ -242,7 +252,6 @@ static void serialSetupPort(int mode, etx_serial_init& params, bool& power_requi case UART_MODE_GPS: params.baudrate = GPS_USART_BAUDRATE; params.rx_enable = true; - power_required = true; break; #endif #endif @@ -263,6 +272,26 @@ const etx_serial_port_t* serialGetPort(uint8_t port_nr) return port; } +static void serialSetPowerState(uint8_t port_nr) +{ + const etx_serial_port_t* port = serialGetPort(port_nr); + if (!port) return; + + if (port->set_pwr) { + port->set_pwr(getSerialPower(port_nr)); + } +} + +void serialSetPower(uint8_t port_nr, bool enabled) +{ + if (port_nr >= MAX_SERIAL_PORTS) return; + uint32_t pwr = (enabled ? 1 : 0) << SERIAL_CONF_POWER_BIT; + uint32_t pwr_mask = (1 << SERIAL_CONF_POWER_BIT) << port_nr * SERIAL_CONF_BITS_PER_PORT; + g_eeGeneral.serialPort = (g_eeGeneral.serialPort & ~pwr_mask) | + (pwr << port_nr * SERIAL_CONF_BITS_PER_PORT); + + serialSetPowerState(port_nr); +} void serialInit(uint8_t port_nr, int mode) { @@ -292,8 +321,7 @@ void serialInit(uint8_t port_nr, int mode) .rx_enable = false, }; - bool power_required = false; - serialSetupPort(mode, params, power_required); + serialSetupPort(mode, params); if (params.baudrate != 0) { state->mode = mode; @@ -304,9 +332,8 @@ void serialInit(uint8_t port_nr, int mode) state->usart_ctx = port->uart->init(¶ms); // Set power on/off - if (port->set_pwr) { - port->set_pwr(power_required); - } + if (port_nr < SP_VCP) + serialSetPowerState(port_nr); } // Update callbacks once the port is setup @@ -329,12 +356,19 @@ int serialGetMode(uint8_t port_nr) return getSerialPortMode(port_nr); } +bool serialGetPower(uint8_t port_nr) +{ + return getSerialPower(port_nr); +} + void serialSetMode(uint8_t port_nr, int mode) { if (port_nr >= MAX_SERIAL_PORTS) return; - uint16_t m = mode & 0xF; + uint16_t m = mode & SERIAL_CONF_MODE_MASK; g_eeGeneral.serialPort = - (g_eeGeneral.serialPort & ~(0xF << port_nr * 4)) | (m << port_nr * 4); + (g_eeGeneral.serialPort & + ~(SERIAL_CONF_MODE_MASK << port_nr * SERIAL_CONF_BITS_PER_PORT)) | + (m << port_nr * SERIAL_CONF_BITS_PER_PORT); } // uint8_t serialTracesEnabled(int port_nr) diff --git a/radio/src/serial.h b/radio/src/serial.h index 5e2bfc0f0..4a8d2a7ff 100644 --- a/radio/src/serial.h +++ b/radio/src/serial.h @@ -25,9 +25,15 @@ #include #include "hal/serial_port.h" +#define SERIAL_CONF_BITS_PER_PORT 8 +#define SERIAL_CONF_MODE_MASK 0x0F +#define SERIAL_CONF_POWER_BIT 4 + const etx_serial_port_t* serialGetPort(uint8_t port_nr); int serialGetMode(uint8_t port_nr); void serialSetMode(uint8_t port_nr, int mode); +bool serialGetPower(uint8_t port_nr); +void serialSetPower(uint8_t port_nr, bool enabled); void initSerialPorts(); void serialInit(uint8_t port_nr, int mode); diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index fd93c4aaa..54e8c8396 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -1854,6 +1854,7 @@ static bool port_write(void* user, yaml_writer_func wf, void* opaque) static const struct YamlNode struct_serialConfig[] = { YAML_IDX_CUST( "port", port_read, port_write), YAML_ENUM( "mode", 4, enum_UartModes), + YAML_UNSIGNED( "power", 1 ), YAML_END }; @@ -1876,6 +1877,7 @@ static void r_serialMode(void* user, uint8_t* data, uint32_t bitoffs, auto m = yaml_parse_enum(yaml_conv_220::enum_UartModes, val, val_len); if (!m) return; - auto serialPort = reinterpret_cast(data); - *serialPort = (*serialPort & ~(0xF << port_nr * 4)) | (m << port_nr * 4); + auto serialPort = reinterpret_cast(data); + *serialPort = (*serialPort & ~(0xF << port_nr * SERIAL_CONF_BITS_PER_PORT)) | + (m << port_nr * SERIAL_CONF_BITS_PER_PORT); } diff --git a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp index 878fa3379..8f7886af3 100644 --- a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp @@ -423,7 +423,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr), @@ -439,7 +439,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), YAML_UNSIGNED( "stickDeadZone", 3 ), - YAML_PADDING( 2 ), + YAML_PADDING( 3 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_t12.cpp b/radio/src/storage/yaml/yaml_datastructs_t12.cpp index 1330d527f..2700c6c8c 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t12.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t12.cpp @@ -394,7 +394,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -407,7 +407,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_t8.cpp b/radio/src/storage/yaml/yaml_datastructs_t8.cpp index 2748ad0c7..6859a558d 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t8.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t8.cpp @@ -394,7 +394,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -407,7 +407,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_tlite.cpp b/radio/src/storage/yaml/yaml_datastructs_tlite.cpp index 2748ad0c7..6859a558d 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tlite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tlite.cpp @@ -394,7 +394,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -407,7 +407,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp index 02a48684c..c09d9b7c1 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp @@ -402,7 +402,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -413,7 +413,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_PADDING( 144 ), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_tx12.cpp b/radio/src/storage/yaml/yaml_datastructs_tx12.cpp index b1d225cd0..638e60cef 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tx12.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tx12.cpp @@ -394,7 +394,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -407,7 +407,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x10.cpp b/radio/src/storage/yaml/yaml_datastructs_x10.cpp index 2d5dac3bf..471464ad5 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x10.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x10.cpp @@ -444,7 +444,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr), @@ -459,7 +459,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x12s.cpp b/radio/src/storage/yaml/yaml_datastructs_x12s.cpp index f9a617778..aa4343d9a 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x12s.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x12s.cpp @@ -442,7 +442,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 72, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("sticksConfig", 0, 4, struct_sticksConfig, stick_name_valid), YAML_ARRAY("switchConfig", 2, 16, struct_switchConfig, nullptr), YAML_ARRAY("potsConfig", 2, 8, struct_potConfig, nullptr), @@ -457,7 +457,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRUCT("themeData", 480, struct_OpenTxTheme__PersistentData, NULL), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x7.cpp b/radio/src/storage/yaml/yaml_datastructs_x7.cpp index 2748ad0c7..6859a558d 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x7.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x7.cpp @@ -394,7 +394,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -407,7 +407,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp index d0a348e38..653bf6a83 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp @@ -401,7 +401,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -414,7 +414,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp index 376191a88..67623a95a 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp @@ -440,7 +440,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -453,7 +453,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp b/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp index 87739b509..adf23742f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp @@ -381,7 +381,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -392,7 +392,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_PADDING( 120 ), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp b/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp index c9220415c..e36f38eff 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp @@ -389,7 +389,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -402,7 +402,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_xlite.cpp b/radio/src/storage/yaml/yaml_datastructs_xlite.cpp index da1da3b80..87cb71577 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlite.cpp @@ -386,7 +386,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -399,7 +399,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp index 81d132563..aa8466ef7 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp @@ -388,7 +388,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -403,7 +403,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_SIGNED( "gyroMax", 8 ), YAML_SIGNED( "gyroOffset", 8 ), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = { diff --git a/radio/src/storage/yaml/yaml_datastructs_zorro.cpp b/radio/src/storage/yaml/yaml_datastructs_zorro.cpp index 9df1ea6f9..027a7463c 100644 --- a/radio/src/storage/yaml/yaml_datastructs_zorro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_zorro.cpp @@ -394,7 +394,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_ARRAY("customFn", 88, 64, struct_CustomFunctionData, cfn_is_active), YAML_CUSTOM("auxSerialMode",r_serialMode,nullptr), YAML_CUSTOM("aux2SerialMode",r_serialMode,nullptr), - YAML_ARRAY("serialPort", 4, 4, struct_serialConfig, nullptr), + YAML_ARRAY("serialPort", 8, 4, struct_serialConfig, nullptr), YAML_ARRAY("slidersConfig", 1, 4, struct_sliderConfig, nullptr), YAML_PADDING( 4 ), YAML_ARRAY("potsConfig", 2, 4, struct_potConfig, nullptr), @@ -407,7 +407,7 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("bluetoothName", 10), YAML_STRING("ownerRegistrationID", 8), YAML_SIGNED( "uartSampleMode", 2 ), - YAML_PADDING( 5 ), + YAML_PADDING( 6 ), YAML_END }; static const struct YamlNode struct_unsigned_8[] = {