Procházet zdrojové kódy

Move M75-M78 to cpp

Scott Lahteine před 7 roky
rodič
revize
2c1eda9e00

+ 0
- 8
Marlin/src/Marlin.cpp Zobrazit soubor

@@ -370,14 +370,6 @@ bool pin_is_protected(const int8_t pin) {
370 370
   return false;
371 371
 }
372 372
 
373
-#include "gcode/stats/M75.h"
374
-#include "gcode/stats/M76.h"
375
-#include "gcode/stats/M77.h"
376
-
377
-#if ENABLED(PRINTCOUNTER)
378
-  #include "gcode/stats/M78.h"
379
-#endif
380
-
381 373
 #include "gcode/temperature/M105.h"
382 374
 
383 375
 #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)

+ 4
- 12
Marlin/src/gcode/gcode.cpp Zobrazit soubor

@@ -117,10 +117,6 @@ void GcodeSuite::dwell(millis_t time) {
117 117
 // Placeholders for non-migrated codes
118 118
 //
119 119
 extern void gcode_M18_M84();
120
-extern void gcode_M75();
121
-extern void gcode_M76();
122
-extern void gcode_M77();
123
-extern void gcode_M78();
124 120
 extern void gcode_M80();
125 121
 extern void gcode_M81();
126 122
 extern void gcode_M82();
@@ -444,16 +440,12 @@ void GcodeSuite::process_next_command() {
444 440
         case 49: M49(); break;    // M49: Turn on or off G26 debug flag for verbose output
445 441
       #endif
446 442
 
447
-      case 75: // M75: Start print timer
448
-        gcode_M75(); break;
449
-      case 76: // M76: Pause print timer
450
-        gcode_M76(); break;
451
-      case 77: // M77: Stop print timer
452
-        gcode_M77(); break;
443
+      case 75: M75(); break;      // M75: Start print timer
444
+      case 76: M76(); break;      // M76: Pause print timer
445
+      case 77: M77(); break;      // M77: Stop print timer
453 446
 
454 447
       #if ENABLED(PRINTCOUNTER)
455
-        case 78: // M78: Show print statistics
456
-          gcode_M78(); break;
448
+        case 78: M78(); break;    // M78: Show print statistics
457 449
       #endif
458 450
 
459 451
       #if ENABLED(M100_FREE_MEMORY_WATCHER)

Marlin/src/gcode/stats/M75.h → Marlin/src/gcode/stats/M75-M77.cpp Zobrazit soubor

@@ -20,7 +20,20 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../gcode.h"
24
+#include "../../module/printcounter.h"
25
+
23 26
 /**
24 27
  * M75: Start print timer
25 28
  */
26
-void gcode_M75() { print_job_timer.start(); }
29
+void GcodeSuite::M75() { print_job_timer.start(); }
30
+
31
+/**
32
+ * M76: Pause print timer
33
+ */
34
+void GcodeSuite::M76() { print_job_timer.pause(); }
35
+
36
+/**
37
+ * M77: Stop print timer
38
+ */
39
+void GcodeSuite::M77() { print_job_timer.stop(); }

+ 0
- 26
Marlin/src/gcode/stats/M76.h Zobrazit soubor

@@ -1,26 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * M76: Pause print timer
25
- */
26
-void gcode_M76() { print_job_timer.pause(); }

+ 0
- 26
Marlin/src/gcode/stats/M77.h Zobrazit soubor

@@ -1,26 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * M77: Stop print timer
25
- */
26
-void gcode_M77() { print_job_timer.stop(); }

Marlin/src/gcode/stats/M78.h → Marlin/src/gcode/stats/M78.cpp Zobrazit soubor

@@ -20,12 +20,21 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(PRINTCOUNTER)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/printcounter.h"
29
+
23 30
 /**
24 31
  * M78: Show print statistics
25 32
  */
26
-void gcode_M78() {
33
+void GcodeSuite::M78() {
27 34
   if (parser.intval('S') == 78)   // "M78 S78" will reset the statistics
28 35
     print_job_timer.initStats();
29 36
   else
30 37
     print_job_timer.showStats();
31 38
 }
39
+
40
+#endif // PRINTCOUNTER

Loading…
Zrušit
Uložit