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 <algernon@keyboard.io>
pull/549/head
Gergely Nagy 6 years ago
parent 5fe12de4dd
commit 623dde5045
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -56,7 +56,8 @@ EventHandlerResult CycleTimeReport::afterEachCycle() {
} }
__attribute__((weak)) void cycleTimeReport(void) { __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; kaleidoscope::plugin::CycleTimeReport CycleTimeReport;

@ -82,6 +82,7 @@ class FocusSerial : public kaleidoscope::Plugin {
static constexpr char COMMENT = '#'; static constexpr char COMMENT = '#';
static constexpr char SEPARATOR = ' '; static constexpr char SEPARATOR = ' ';
static constexpr char NEWLINE = '\n';
/* Hooks */ /* Hooks */
EventHandlerResult beforeReportingState(); EventHandlerResult beforeReportingState();

Loading…
Cancel
Save