From c51335a1df6a2cee39e4f5c7cc36b58c9e069106 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 11 Oct 2024 14:46:03 +0200 Subject: [PATCH] Cleanup --- Utilities.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Utilities.h b/Utilities.h index 6cc69c3..29523cf 100644 --- a/Utilities.h +++ b/Utilities.h @@ -668,19 +668,17 @@ void serial_write(uint8_t byte) { Serial.write(byte); } else { SerialBT.write(byte); - - #if MCU_VARIANT == MCU_NRF52 && HAS_BLE - // 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 - if (serial_in_frame && byte == FEND) { - SerialBT.flushTXD(); - serial_in_frame = false; - } - else if (!serial_in_frame && byte == FEND) { - serial_in_frame = true; - } - #endif - + #if MCU_VARIANT == MCU_NRF52 && HAS_BLE + // 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 + if (serial_in_frame && byte == FEND) { + SerialBT.flushTXD(); + serial_in_frame = false; + } + else if (!serial_in_frame && byte == FEND) { + serial_in_frame = true; + } + #endif } #else Serial.write(byte);