From 624b95782ddb183ffcedb86cfe826134e7771f6d Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 2 May 2020 20:21:42 -0700 Subject: [PATCH] fix missing carriage returns. thanks to @gregwalters in #119 --- src/SerialConsole.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SerialConsole.h b/src/SerialConsole.h index 50efb99af..b39eda23b 100644 --- a/src/SerialConsole.h +++ b/src/SerialConsole.h @@ -19,6 +19,13 @@ class SerialConsole : public StreamAPI, public RedirectablePrint * debug serial output. */ virtual void handleToRadio(const uint8_t *buf, size_t len); + + virtual size_t write(uint8_t c) + { + if (c == '\n') // prefix any newlines with carriage return + RedirectablePrint::write('\r'); + return RedirectablePrint::write(c); + } }; extern SerialConsole console;