From 0693767efaea6e68fcbd148665a9c00e28c86406 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sun, 8 Sep 2019 02:47:07 -0400 Subject: [PATCH] ExtUI Pause/Stop on all Pause/Stop (#15188) --- Marlin/src/gcode/stats/M75-M78.cpp | 10 ---------- Marlin/src/libs/stopwatch.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index d8589031ed..85d36daa9b 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -24,10 +24,6 @@ #include "../../module/printcounter.h" #include "../../lcd/ultralcd.h" -#if ENABLED(EXTENSIBLE_UI) - #include "../../lcd/extensible_ui/ui_api.h" -#endif - /** * M75: Start print timer */ @@ -40,9 +36,6 @@ void GcodeSuite::M75() { */ void GcodeSuite::M76() { print_job_timer.pause(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerPaused(); - #endif } /** @@ -50,9 +43,6 @@ void GcodeSuite::M76() { */ void GcodeSuite::M77() { print_job_timer.stop(); - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onPrintTimerStopped(); - #endif } #if ENABLED(PRINTCOUNTER) diff --git a/Marlin/src/libs/stopwatch.cpp b/Marlin/src/libs/stopwatch.cpp index e3797c21f3..b80a1597d5 100644 --- a/Marlin/src/libs/stopwatch.cpp +++ b/Marlin/src/libs/stopwatch.cpp @@ -39,6 +39,9 @@ bool Stopwatch::stop() { #endif if (isRunning() || isPaused()) { + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerStopped(); + #endif state = STOPPED; stopTimestamp = millis(); return true; @@ -52,6 +55,9 @@ bool Stopwatch::pause() { #endif if (isRunning()) { + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onPrintTimerPaused(); + #endif state = PAUSED; stopTimestamp = millis(); return true;