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