Bugfix: serial power state executed on power-up irrespective of the serial mode selected.
This commit is contained in:
@@ -243,8 +243,8 @@ class SerialConfigWindow : public FormGroup
|
||||
new CheckBox(
|
||||
this, grid.getFieldSlot(1, 0),
|
||||
[=] { return serialGetPower(port_nr); },
|
||||
[=](int32_t newValue) {
|
||||
serialSetPower(port_nr, newValue);
|
||||
[=](int8_t newValue) {
|
||||
serialSetPower(port_nr, (bool)newValue);
|
||||
SET_DIRTY();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -321,7 +321,13 @@ void serialInit(uint8_t port_nr, int mode)
|
||||
};
|
||||
|
||||
serialSetupPort(mode, params);
|
||||
|
||||
|
||||
#if defined(SWSERIALPOWER)
|
||||
// Set power on/off
|
||||
if (port_nr < SP_VCP)
|
||||
serialSetPowerState(port_nr);
|
||||
#endif
|
||||
|
||||
if (params.baudrate != 0) {
|
||||
state->mode = mode;
|
||||
state->port = port;
|
||||
@@ -329,12 +335,6 @@ void serialInit(uint8_t port_nr, int mode)
|
||||
if (port) {
|
||||
if (port->uart && port->uart->init)
|
||||
state->usart_ctx = port->uart->init(¶ms);
|
||||
|
||||
#if defined(SWSERIALPOWER)
|
||||
// Set power on/off
|
||||
if (port_nr < SP_VCP)
|
||||
serialSetPowerState(port_nr);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Update callbacks once the port is setup
|
||||
|
||||
Reference in New Issue
Block a user