Browse Source

ExtUI Pause/Stop on all Pause/Stop (#15188)

InsanityAutomation 4 years ago
parent
commit
0693767efa
2 changed files with 6 additions and 10 deletions
  1. 0
    10
      Marlin/src/gcode/stats/M75-M78.cpp
  2. 6
    0
      Marlin/src/libs/stopwatch.cpp

+ 0
- 10
Marlin/src/gcode/stats/M75-M78.cpp View File

@@ -24,10 +24,6 @@
24 24
 #include "../../module/printcounter.h"
25 25
 #include "../../lcd/ultralcd.h"
26 26
 
27
-#if ENABLED(EXTENSIBLE_UI)
28
-  #include "../../lcd/extensible_ui/ui_api.h"
29
-#endif
30
-
31 27
 /**
32 28
  * M75: Start print timer
33 29
  */
@@ -40,9 +36,6 @@ void GcodeSuite::M75() {
40 36
  */
41 37
 void GcodeSuite::M76() {
42 38
   print_job_timer.pause();
43
-  #if ENABLED(EXTENSIBLE_UI)
44
-    ExtUI::onPrintTimerPaused();
45
-  #endif
46 39
 }
47 40
 
48 41
 /**
@@ -50,9 +43,6 @@ void GcodeSuite::M76() {
50 43
  */
51 44
 void GcodeSuite::M77() {
52 45
  print_job_timer.stop();
53
- #if ENABLED(EXTENSIBLE_UI)
54
-   ExtUI::onPrintTimerStopped();
55
- #endif
56 46
 }
57 47
 
58 48
 #if ENABLED(PRINTCOUNTER)

+ 6
- 0
Marlin/src/libs/stopwatch.cpp View File

@@ -39,6 +39,9 @@ bool Stopwatch::stop() {
39 39
   #endif
40 40
 
41 41
   if (isRunning() || isPaused()) {
42
+    #if ENABLED(EXTENSIBLE_UI)
43
+      ExtUI::onPrintTimerStopped();
44
+    #endif
42 45
     state = STOPPED;
43 46
     stopTimestamp = millis();
44 47
     return true;
@@ -52,6 +55,9 @@ bool Stopwatch::pause() {
52 55
   #endif
53 56
 
54 57
   if (isRunning()) {
58
+    #if ENABLED(EXTENSIBLE_UI)
59
+      ExtUI::onPrintTimerPaused();
60
+    #endif
55 61
     state = PAUSED;
56 62
     stopTimestamp = millis();
57 63
     return true;

Loading…
Cancel
Save