Cleanup
This commit is contained in:
parent
2e6db2f818
commit
c51335a1df
24
Utilities.h
24
Utilities.h
|
@ -668,19 +668,17 @@ void serial_write(uint8_t byte) {
|
||||||
Serial.write(byte);
|
Serial.write(byte);
|
||||||
} else {
|
} else {
|
||||||
SerialBT.write(byte);
|
SerialBT.write(byte);
|
||||||
|
#if MCU_VARIANT == MCU_NRF52 && HAS_BLE
|
||||||
#if MCU_VARIANT == MCU_NRF52 && HAS_BLE
|
// This ensures that the TX buffer is flushed after a frame is queued in serial.
|
||||||
// This ensures that the TX buffer is flushed after a frame is queued in serial.
|
// serial_in_frame is used to ensure that the flush only happens at the end of the frame
|
||||||
// serial_in_frame is used to ensure that the flush only happens at the end of the frame
|
if (serial_in_frame && byte == FEND) {
|
||||||
if (serial_in_frame && byte == FEND) {
|
SerialBT.flushTXD();
|
||||||
SerialBT.flushTXD();
|
serial_in_frame = false;
|
||||||
serial_in_frame = false;
|
}
|
||||||
}
|
else if (!serial_in_frame && byte == FEND) {
|
||||||
else if (!serial_in_frame && byte == FEND) {
|
serial_in_frame = true;
|
||||||
serial_in_frame = true;
|
}
|
||||||
}
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Serial.write(byte);
|
Serial.write(byte);
|
||||||
|
|
Loading…
Reference in New Issue