Scott Lahteine пре 7 година
родитељ
комит
a90c7dbf64

+ 0
- 7
Marlin/src/Marlin.cpp Прегледај датотеку

359
   SYNC_PLAN_POSITION_KINEMATIC();
359
   SYNC_PLAN_POSITION_KINEMATIC();
360
 }
360
 }
361
 
361
 
362
-#include "gcode/eeprom/M500.h"
363
-#include "gcode/eeprom/M501.h"
364
-#include "gcode/eeprom/M502.h"
365
-#if DISABLED(DISABLE_M503)
366
-  #include "gcode/eeprom/M503.h"
367
-#endif
368
-
369
 #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
362
 #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
370
   #include "gcode/config/M540.h"
363
   #include "gcode/config/M540.h"
371
 #endif
364
 #endif

Marlin/src/gcode/eeprom/M502.h → Marlin/src/gcode/eeprom/M500-M503.cpp Прегледај датотеку

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../gcode.h"
24
+#include "../../module/configuration_store.h"
25
+#include "../../inc/MarlinConfig.h"
26
+
27
+/**
28
+ * M500: Store settings in EEPROM
29
+ */
30
+void GcodeSuite::M500() {
31
+  (void)settings.save();
32
+}
33
+
34
+/**
35
+ * M501: Read settings from EEPROM
36
+ */
37
+void GcodeSuite::M501() {
38
+  (void)settings.load();
39
+}
40
+
23
 /**
41
 /**
24
  * M502: Revert to default settings
42
  * M502: Revert to default settings
25
  */
43
  */
26
-void gcode_M502() {
44
+void GcodeSuite::M502() {
27
   (void)settings.reset();
45
   (void)settings.reset();
28
 }
46
 }
47
+
48
+#if DISABLED(DISABLE_M503)
49
+
50
+  /**
51
+   * M503: print settings currently in memory
52
+   */
53
+  void GcodeSuite::M503() {
54
+    (void)settings.report(!parser.boolval('S', true));
55
+  }
56
+
57
+#endif // !DISABLE_M503

+ 0
- 28
Marlin/src/gcode/eeprom/M500.h Прегледај датотеку

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
- * M500: Store settings in EEPROM
25
- */
26
-void gcode_M500() {
27
-  (void)settings.save();
28
-}

+ 0
- 28
Marlin/src/gcode/eeprom/M501.h Прегледај датотеку

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
- * M501: Read settings from EEPROM
25
- */
26
-void gcode_M501() {
27
-  (void)settings.load();
28
-}

+ 0
- 28
Marlin/src/gcode/eeprom/M503.h Прегледај датотеку

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
- * M503: print settings currently in memory
25
- */
26
-void gcode_M503() {
27
-  (void)settings.report(!parser.boolval('S', true));
28
-}

+ 4
- 17
Marlin/src/gcode/gcode.cpp Прегледај датотеку

122
 extern void gcode_M350();
122
 extern void gcode_M350();
123
 extern void gcode_M351();
123
 extern void gcode_M351();
124
 extern void gcode_M355();
124
 extern void gcode_M355();
125
-extern void gcode_M500();
126
-extern void gcode_M501();
127
-extern void gcode_M502();
128
-extern void gcode_M503();
129
 extern void gcode_M540();
125
 extern void gcode_M540();
130
 extern void gcode_M605();
126
 extern void gcode_M605();
131
 extern void gcode_M702();
127
 extern void gcode_M702();
633
         case 428: M428(); break;  // M428: Apply current_position to home_offset
629
         case 428: M428(); break;  // M428: Apply current_position to home_offset
634
       #endif
630
       #endif
635
 
631
 
636
-      case 500: // M500: Store settings in EEPROM
637
-        gcode_M500();
638
-        break;
639
-      case 501: // M501: Read settings from EEPROM
640
-        gcode_M501();
641
-        break;
642
-      case 502: // M502: Revert to default settings
643
-        gcode_M502();
644
-        break;
645
-
632
+      case 500: M500(); break;    // M500: Store settings in EEPROM
633
+      case 501: M501(); break;    // M501: Read settings from EEPROM
634
+      case 502: M502(); break;    // M502: Revert to default settings
646
       #if DISABLED(DISABLE_M503)
635
       #if DISABLED(DISABLE_M503)
647
-        case 503: // M503: print settings currently in memory
648
-          gcode_M503();
649
-          break;
636
+        case 503: M503(); break;  // M503: print settings currently in memory
650
       #endif
637
       #endif
651
 
638
 
652
       #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
639
       #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)

Loading…
Откажи
Сачувај