Browse Source

Fix nRF52 RS232 bridge baud initialization

pull/3018/head
Alexander Hoffer 1 week ago
parent
commit
3d16883807
  1. 6
      src/helpers/bridges/RS232Bridge.cpp

6
src/helpers/bridges/RS232Bridge.cpp

@ -17,7 +17,11 @@ void RS232Bridge::begin() {
((HardwareSerial *)_serial)->setPins(WITH_RS232_BRIDGE_RX, WITH_RS232_BRIDGE_TX);
#elif defined(NRF52_PLATFORM)
// Tested with RAK_4631 and T114
((Uart *)_serial)->setPins(WITH_RS232_BRIDGE_RX, WITH_RS232_BRIDGE_TX);
Uart *uart = (Uart *)_serial;
if (*uart) {
uart->end(); // nRF52 begin() ignores baud and pin changes while already started
}
uart->setPins(WITH_RS232_BRIDGE_RX, WITH_RS232_BRIDGE_TX);
#elif defined(RP2040_PLATFORM)
((SerialUART *)_serial)->setRX(WITH_RS232_BRIDGE_RX);
((SerialUART *)_serial)->setTX(WITH_RS232_BRIDGE_TX);

Loading…
Cancel
Save