From 623dde5045dfd054eb2aa5196617a39b383f0c8b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 24 Jan 2019 14:16:07 +0100 Subject: [PATCH] CycleTimeReport: Send a newline after the default report Since `Focus.send()` does not send a newline implicitly, we should do so explicitly. Introduce `Focus.NEWLINE` to help with this, and not have many copies of `'\n'` lying around. Fixes #544. Signed-off-by: Gergely Nagy --- src/kaleidoscope/plugin/CycleTimeReport.cpp | 3 ++- src/kaleidoscope/plugin/FocusSerial.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kaleidoscope/plugin/CycleTimeReport.cpp b/src/kaleidoscope/plugin/CycleTimeReport.cpp index de91df6c..abc4d5a0 100644 --- a/src/kaleidoscope/plugin/CycleTimeReport.cpp +++ b/src/kaleidoscope/plugin/CycleTimeReport.cpp @@ -56,7 +56,8 @@ EventHandlerResult CycleTimeReport::afterEachCycle() { } __attribute__((weak)) void cycleTimeReport(void) { - Focus.send(Focus.COMMENT, F("average loop time:"), CycleTimeReport.average_loop_time); + Focus.send(Focus.COMMENT, F("average loop time:"), CycleTimeReport.average_loop_time, + Focus.NEWLINE); } kaleidoscope::plugin::CycleTimeReport CycleTimeReport; diff --git a/src/kaleidoscope/plugin/FocusSerial.h b/src/kaleidoscope/plugin/FocusSerial.h index 8989478d..86a9621d 100644 --- a/src/kaleidoscope/plugin/FocusSerial.h +++ b/src/kaleidoscope/plugin/FocusSerial.h @@ -82,6 +82,7 @@ class FocusSerial : public kaleidoscope::Plugin { static constexpr char COMMENT = '#'; static constexpr char SEPARATOR = ' '; + static constexpr char NEWLINE = '\n'; /* Hooks */ EventHandlerResult beforeReportingState();