|
@@ -327,7 +327,11 @@ static millis_t max_inactive_time = 0;
|
327
|
327
|
static millis_t stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
|
328
|
328
|
|
329
|
329
|
// Print Job Timer
|
330
|
|
-Stopwatch print_job_timer = Stopwatch();
|
|
330
|
+#if ENABLED(PRINTCOUNTER)
|
|
331
|
+ PrintCounter print_job_timer = PrintCounter();
|
|
332
|
+#else
|
|
333
|
+ Stopwatch print_job_timer = Stopwatch();
|
|
334
|
+#endif
|
331
|
335
|
|
332
|
336
|
static uint8_t target_extruder;
|
333
|
337
|
|
|
@@ -4252,6 +4256,15 @@ inline void gcode_M77() {
|
4252
|
4256
|
print_job_timer.stop();
|
4253
|
4257
|
}
|
4254
|
4258
|
|
|
4259
|
+#if ENABLED(PRINTCOUNTER)
|
|
4260
|
+ /*+
|
|
4261
|
+ * M78: Show print statistics
|
|
4262
|
+ */
|
|
4263
|
+ inline void gcode_M78() {
|
|
4264
|
+ print_job_timer.showStats();
|
|
4265
|
+ }
|
|
4266
|
+#endif
|
|
4267
|
+
|
4255
|
4268
|
/**
|
4256
|
4269
|
* M104: Set hot end temperature
|
4257
|
4270
|
*/
|
|
@@ -6636,6 +6649,12 @@ void process_next_command() {
|
6636
|
6649
|
gcode_M77();
|
6637
|
6650
|
break;
|
6638
|
6651
|
|
|
6652
|
+ #if ENABLED(PRINTCOUNTER)
|
|
6653
|
+ case 78: // Show print statistics
|
|
6654
|
+ gcode_M78();
|
|
6655
|
+ break;
|
|
6656
|
+ #endif
|
|
6657
|
+
|
6639
|
6658
|
#if ENABLED(M100_FREE_MEMORY_WATCHER)
|
6640
|
6659
|
case 100:
|
6641
|
6660
|
gcode_M100();
|
|
@@ -7750,6 +7769,9 @@ void idle(
|
7750
|
7769
|
);
|
7751
|
7770
|
host_keepalive();
|
7752
|
7771
|
lcd_update();
|
|
7772
|
+ #if ENABLED(PRINTCOUNTER)
|
|
7773
|
+ print_job_timer.tick();
|
|
7774
|
+ #endif
|
7753
|
7775
|
}
|
7754
|
7776
|
|
7755
|
7777
|
/**
|