From 9c5df517ae764dfc60ab6e7502781f4d66bc394a Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Wed, 1 Jun 2022 10:42:02 -0500 Subject: [PATCH] Update example sketch for CycleTimeReport plugin Signed-off-by: Michael Richters --- examples/Features/CycleTimeReport/CycleTimeReport.ino | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/Features/CycleTimeReport/CycleTimeReport.ino b/examples/Features/CycleTimeReport/CycleTimeReport.ino index be45aebc..e8c9cc33 100644 --- a/examples/Features/CycleTimeReport/CycleTimeReport.ino +++ b/examples/Features/CycleTimeReport/CycleTimeReport.ino @@ -40,11 +40,20 @@ KEYMAPS( ) // clang-format on +// Override CycleTimeReport's reporting function: +void kaleidoscope::plugin::CycleTimeReport::report(uint16_t mean_cycle_time) { + Serial.print(F("average loop time = ")); + Serial.println(mean_cycle_time, DEC); +} + KALEIDOSCOPE_INIT_PLUGINS(CycleTimeReport); void setup() { Kaleidoscope.serialPort().begin(9600); Kaleidoscope.setup(); + + // Change the report interval to 2 seconds: + CycleTimeReport.setReportInterval(2000); } void loop() {