Ver código fonte

Merge pull request #7719 from thinkyhead/bugfix_refactor_work

[2.0.x] Group G-codes to fix command-line overflow
Scott Lahteine 7 anos atrás
pai
commit
6da97ebdd1
55 arquivos alterados com 713 adições e 1726 exclusões
  1. 1
    2
      Marlin/src/feature/caselight.cpp
  2. 1
    1
      Marlin/src/feature/caselight.h
  3. 129
    0
      Marlin/src/gcode/config/M200-M205.cpp
  4. 0
    45
      Marlin/src/gcode/config/M200.cpp
  5. 0
    43
      Marlin/src/gcode/config/M201.cpp
  6. 0
    40
      Marlin/src/gcode/config/M203.cpp
  7. 0
    52
      Marlin/src/gcode/config/M204.cpp
  8. 0
    45
      Marlin/src/gcode/config/M205.cpp
  9. 0
    39
      Marlin/src/gcode/control/M108.cpp
  10. 15
    3
      Marlin/src/gcode/control/M108_M112_M410.cpp
  11. 0
    39
      Marlin/src/gcode/control/M112.cpp
  12. 0
    33
      Marlin/src/gcode/control/M17.cpp
  13. 9
    1
      Marlin/src/gcode/control/M17_M18_M84.cpp
  14. 35
    0
      Marlin/src/gcode/feature/digipot/M907-M910.cpp
  15. 0
    55
      Marlin/src/gcode/feature/digipot/M908.cpp
  16. 0
    36
      Marlin/src/gcode/feature/digipot/M909.cpp
  17. 0
    36
      Marlin/src/gcode/feature/digipot/M910.cpp
  18. 29
    0
      Marlin/src/gcode/feature/fwretract/M207-M209.cpp
  19. 0
    45
      Marlin/src/gcode/feature/fwretract/M207.cpp
  20. 0
    44
      Marlin/src/gcode/feature/fwretract/M209.cpp
  21. 38
    0
      Marlin/src/gcode/feature/mixing/M163-M165.cpp
  22. 0
    45
      Marlin/src/gcode/feature/mixing/M164.cpp
  23. 0
    45
      Marlin/src/gcode/feature/mixing/M165.cpp
  24. 155
    0
      Marlin/src/gcode/feature/trinamic/M911-M914.cpp
  25. 0
    59
      Marlin/src/gcode/feature/trinamic/M911.cpp
  26. 0
    57
      Marlin/src/gcode/feature/trinamic/M912.cpp
  27. 0
    68
      Marlin/src/gcode/feature/trinamic/M913.cpp
  28. 0
    55
      Marlin/src/gcode/feature/trinamic/M914.cpp
  29. 8
    7
      Marlin/src/gcode/gcode.cpp
  30. 8
    7
      Marlin/src/gcode/gcode.h
  31. 0
    51
      Marlin/src/gcode/geometry/M206.cpp
  32. 21
    0
      Marlin/src/gcode/geometry/M206_M428.cpp
  33. 191
    0
      Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp
  34. 0
    39
      Marlin/src/gcode/sdcard/M20.cpp
  35. 0
    35
      Marlin/src/gcode/sdcard/M21.cpp
  36. 0
    35
      Marlin/src/gcode/sdcard/M22.cpp
  37. 0
    39
      Marlin/src/gcode/sdcard/M23.cpp
  38. 0
    47
      Marlin/src/gcode/sdcard/M24.cpp
  39. 0
    47
      Marlin/src/gcode/sdcard/M25.cpp
  40. 0
    38
      Marlin/src/gcode/sdcard/M26.cpp
  41. 0
    35
      Marlin/src/gcode/sdcard/M27.cpp
  42. 0
    35
      Marlin/src/gcode/sdcard/M28.cpp
  43. 0
    38
      Marlin/src/gcode/sdcard/M29.cpp
  44. 0
    40
      Marlin/src/gcode/sdcard/M30.cpp
  45. 0
    55
      Marlin/src/gcode/sdcard/M32.cpp
  46. 0
    46
      Marlin/src/gcode/sdcard/M33.cpp
  47. 0
    42
      Marlin/src/gcode/sdcard/M34.cpp
  48. 0
    37
      Marlin/src/gcode/sdcard/M928.cpp
  49. 0
    39
      Marlin/src/gcode/stats/M75-M77.cpp
  50. 17
    4
      Marlin/src/gcode/stats/M75-M78.cpp
  51. 0
    75
      Marlin/src/gcode/temperature/M104.cpp
  52. 45
    4
      Marlin/src/gcode/temperature/M104_M109.cpp
  53. 0
    38
      Marlin/src/gcode/temperature/M140.cpp
  54. 9
    1
      Marlin/src/gcode/temperature/M140_M190.cpp
  55. 2
    4
      Marlin/src/lcd/ultralcd.cpp

+ 1
- 2
Marlin/src/feature/caselight.cpp Ver arquivo

@@ -24,7 +24,7 @@
24 24
 
25 25
 #if HAS_CASE_LIGHT
26 26
 
27
-int case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
27
+uint8_t case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
28 28
 bool case_light_on = CASE_LIGHT_DEFAULT_ON;
29 29
     
30 30
 #ifndef INVERT_CASE_LIGHT
@@ -33,7 +33,6 @@ bool case_light_on = CASE_LIGHT_DEFAULT_ON;
33 33
 
34 34
 void update_case_light() {
35 35
   SET_OUTPUT(CASE_LIGHT_PIN);
36
-  uint8_t case_light_bright = (uint8_t)case_light_brightness;
37 36
   if (case_light_on) {
38 37
     if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
39 38
       analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );

+ 1
- 1
Marlin/src/feature/caselight.h Ver arquivo

@@ -23,7 +23,7 @@
23 23
 #ifndef __CASELIGHT_H__
24 24
 #define __CASELIGHT_H__
25 25
 
26
-extern int case_light_brightness;  // LCD routine wants INT
26
+extern uint8_t case_light_brightness;
27 27
 extern bool case_light_on;
28 28
 
29 29
 void update_case_light();

+ 129
- 0
Marlin/src/gcode/config/M200-M205.cpp Ver arquivo

@@ -0,0 +1,129 @@
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
+#include "../gcode.h"
24
+#include "../../Marlin.h"
25
+#include "../../module/planner.h"
26
+
27
+/**
28
+ * M200: Set filament diameter and set E axis units to cubic units
29
+ *
30
+ *    T<extruder> - Optional extruder number. Current extruder if omitted.
31
+ *    D<linear> - Diameter of the filament. Use "D0" to switch back to linear units on the E axis.
32
+ */
33
+void GcodeSuite::M200() {
34
+
35
+  if (get_target_extruder_from_command()) return;
36
+
37
+  if (parser.seen('D')) {
38
+    // setting any extruder filament size disables volumetric on the assumption that
39
+    // slicers either generate in extruder values as cubic mm or as as filament feeds
40
+    // for all extruders
41
+    if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) )
42
+      planner.set_filament_size(target_extruder, parser.value_linear_units());
43
+  }
44
+  planner.calculate_volumetric_multipliers();
45
+}
46
+
47
+/**
48
+ * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
49
+ *
50
+ *       With multiple extruders use T to specify which one.
51
+ */
52
+void GcodeSuite::M201() {
53
+
54
+  GET_TARGET_EXTRUDER();
55
+
56
+  LOOP_XYZE(i) {
57
+    if (parser.seen(axis_codes[i])) {
58
+      const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
59
+      planner.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a);
60
+    }
61
+  }
62
+  // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
63
+  planner.reset_acceleration_rates();
64
+}
65
+
66
+/**
67
+ * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec
68
+ *
69
+ *       With multiple extruders use T to specify which one.
70
+ */
71
+void GcodeSuite::M203() {
72
+
73
+  GET_TARGET_EXTRUDER();
74
+
75
+  LOOP_XYZE(i)
76
+    if (parser.seen(axis_codes[i])) {
77
+      const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
78
+      planner.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a);
79
+    }
80
+}
81
+
82
+/**
83
+ * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
84
+ *
85
+ *    P = Printing moves
86
+ *    R = Retract only (no X, Y, Z) moves
87
+ *    T = Travel (non printing) moves
88
+ *
89
+ *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
90
+ */
91
+void GcodeSuite::M204() {
92
+  if (parser.seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
93
+    planner.travel_acceleration = planner.acceleration = parser.value_linear_units();
94
+    SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
95
+  }
96
+  if (parser.seen('P')) {
97
+    planner.acceleration = parser.value_linear_units();
98
+    SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration);
99
+  }
100
+  if (parser.seen('R')) {
101
+    planner.retract_acceleration = parser.value_linear_units();
102
+    SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
103
+  }
104
+  if (parser.seen('T')) {
105
+    planner.travel_acceleration = parser.value_linear_units();
106
+    SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
107
+  }
108
+}
109
+
110
+/**
111
+ * M205: Set Advanced Settings
112
+ *
113
+ *    S = Min Feed Rate (units/s)
114
+ *    T = Min Travel Feed Rate (units/s)
115
+ *    B = Min Segment Time (µs)
116
+ *    X = Max X Jerk (units/sec^2)
117
+ *    Y = Max Y Jerk (units/sec^2)
118
+ *    Z = Max Z Jerk (units/sec^2)
119
+ *    E = Max E Jerk (units/sec^2)
120
+ */
121
+void GcodeSuite::M205() {
122
+  if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units();
123
+  if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units();
124
+  if (parser.seen('B')) planner.min_segment_time = parser.value_millis();
125
+  if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units();
126
+  if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units();
127
+  if (parser.seen('Z')) planner.max_jerk[Z_AXIS] = parser.value_linear_units();
128
+  if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units();
129
+}

+ 0
- 45
Marlin/src/gcode/config/M200.cpp Ver arquivo

@@ -1,45 +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
-#include "../gcode.h"
24
-#include "../../Marlin.h"
25
-#include "../../module/planner.h"
26
-
27
-/**
28
- * M200: Set filament diameter and set E axis units to cubic units
29
- *
30
- *    T<extruder> - Optional extruder number. Current extruder if omitted.
31
- *    D<linear> - Diameter of the filament. Use "D0" to switch back to linear units on the E axis.
32
- */
33
-void GcodeSuite::M200() {
34
-
35
-  if (get_target_extruder_from_command()) return;
36
-
37
-  if (parser.seen('D')) {
38
-    // setting any extruder filament size disables volumetric on the assumption that
39
-    // slicers either generate in extruder values as cubic mm or as as filament feeds
40
-    // for all extruders
41
-    if ( (parser.volumetric_enabled = (parser.value_linear_units() != 0.0)) )
42
-      planner.set_filament_size(target_extruder, parser.value_linear_units());
43
-  }
44
-  planner.calculate_volumetric_multipliers();
45
-}

+ 0
- 43
Marlin/src/gcode/config/M201.cpp Ver arquivo

@@ -1,43 +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
-#include "../gcode.h"
24
-#include "../../module/planner.h"
25
-
26
-/**
27
- * M201: Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
28
- *
29
- *       With multiple extruders use T to specify which one.
30
- */
31
-void GcodeSuite::M201() {
32
-
33
-  GET_TARGET_EXTRUDER();
34
-
35
-  LOOP_XYZE(i) {
36
-    if (parser.seen(axis_codes[i])) {
37
-      const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
38
-      planner.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a);
39
-    }
40
-  }
41
-  // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
42
-  planner.reset_acceleration_rates();
43
-}

+ 0
- 40
Marlin/src/gcode/config/M203.cpp Ver arquivo

@@ -1,40 +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
-#include "../gcode.h"
24
-#include "../../module/planner.h"
25
-
26
-/**
27
- * M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec
28
- *
29
- *       With multiple extruders use T to specify which one.
30
- */
31
-void GcodeSuite::M203() {
32
-
33
-  GET_TARGET_EXTRUDER();
34
-
35
-  LOOP_XYZE(i)
36
-    if (parser.seen(axis_codes[i])) {
37
-      const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
38
-      planner.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a);
39
-    }
40
-}

+ 0
- 52
Marlin/src/gcode/config/M204.cpp Ver arquivo

@@ -1,52 +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
-#include "../gcode.h"
24
-#include "../../module/planner.h"
25
-
26
-/**
27
- * M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
28
- *
29
- *    P = Printing moves
30
- *    R = Retract only (no X, Y, Z) moves
31
- *    T = Travel (non printing) moves
32
- *
33
- *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
34
- */
35
-void GcodeSuite::M204() {
36
-  if (parser.seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
37
-    planner.travel_acceleration = planner.acceleration = parser.value_linear_units();
38
-    SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);
39
-  }
40
-  if (parser.seen('P')) {
41
-    planner.acceleration = parser.value_linear_units();
42
-    SERIAL_ECHOLNPAIR("Setting Print Acceleration: ", planner.acceleration);
43
-  }
44
-  if (parser.seen('R')) {
45
-    planner.retract_acceleration = parser.value_linear_units();
46
-    SERIAL_ECHOLNPAIR("Setting Retract Acceleration: ", planner.retract_acceleration);
47
-  }
48
-  if (parser.seen('T')) {
49
-    planner.travel_acceleration = parser.value_linear_units();
50
-    SERIAL_ECHOLNPAIR("Setting Travel Acceleration: ", planner.travel_acceleration);
51
-  }
52
-}

+ 0
- 45
Marlin/src/gcode/config/M205.cpp Ver arquivo

@@ -1,45 +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
-#include "../gcode.h"
24
-#include "../../module/planner.h"
25
-
26
-/**
27
- * M205: Set Advanced Settings
28
- *
29
- *    S = Min Feed Rate (units/s)
30
- *    T = Min Travel Feed Rate (units/s)
31
- *    B = Min Segment Time (µs)
32
- *    X = Max X Jerk (units/sec^2)
33
- *    Y = Max Y Jerk (units/sec^2)
34
- *    Z = Max Z Jerk (units/sec^2)
35
- *    E = Max E Jerk (units/sec^2)
36
- */
37
-void GcodeSuite::M205() {
38
-  if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units();
39
-  if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units();
40
-  if (parser.seen('B')) planner.min_segment_time = parser.value_millis();
41
-  if (parser.seen('X')) planner.max_jerk[X_AXIS] = parser.value_linear_units();
42
-  if (parser.seen('Y')) planner.max_jerk[Y_AXIS] = parser.value_linear_units();
43
-  if (parser.seen('Z')) planner.max_jerk[Z_AXIS] = parser.value_linear_units();
44
-  if (parser.seen('E')) planner.max_jerk[E_AXIS] = parser.value_linear_units();
45
-}

+ 0
- 39
Marlin/src/gcode/control/M108.cpp Ver arquivo

@@ -1,39 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if DISABLED(EMERGENCY_PARSER)
26
-
27
-#include "../gcode.h"
28
-#include "../../Marlin.h" // for wait_for_heatup
29
-
30
-/**
31
- * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
32
- */
33
-void GcodeSuite::M108() {
34
-
35
-  wait_for_heatup = false;
36
-
37
-}
38
-
39
-#endif // !EMERGENCY_PARSER

Marlin/src/gcode/control/M410.cpp → Marlin/src/gcode/control/M108_M112_M410.cpp Ver arquivo

@@ -25,7 +25,21 @@
25 25
 #if DISABLED(EMERGENCY_PARSER)
26 26
 
27 27
 #include "../gcode.h"
28
-#include "../../Marlin.h" // for quickstop_stepper
28
+#include "../../Marlin.h" // for wait_for_heatup, kill, quickstop_stepper
29
+
30
+/**
31
+ * M108: Stop the waiting for heaters in M109, M190, M303. Does not affect the target temperature.
32
+ */
33
+void GcodeSuite::M108() {
34
+  wait_for_heatup = false;
35
+}
36
+
37
+/**
38
+ * M112: Emergency Stop
39
+ */
40
+void GcodeSuite::M112() {
41
+  kill(PSTR(MSG_KILLED));
42
+}
29 43
 
30 44
 /**
31 45
  * M410: Quickstop - Abort all planned moves
@@ -34,9 +48,7 @@
34 48
  * will be out of sync with the stepper position after this.
35 49
  */
36 50
 void GcodeSuite::M410() {
37
-
38 51
   quickstop_stepper();
39
-
40 52
 }
41 53
 
42 54
 #endif // !EMERGENCY_PARSER

+ 0
- 39
Marlin/src/gcode/control/M112.cpp Ver arquivo

@@ -1,39 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if DISABLED(EMERGENCY_PARSER)
26
-
27
-#include "../gcode.h"
28
-#include "../../Marlin.h" // for kill
29
-
30
-/**
31
- * M112: Emergency Stop
32
- */
33
-void GcodeSuite::M112() {
34
-
35
-  kill(PSTR(MSG_KILLED));
36
-
37
-}
38
-
39
-#endif // !EMERGENCY_PARSER

+ 0
- 33
Marlin/src/gcode/control/M17.cpp Ver arquivo

@@ -1,33 +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
-#include "../gcode.h"
24
-#include "../../lcd/ultralcd.h"
25
-#include "../../Marlin.h"
26
-
27
-/**
28
- * M17: Enable power on all stepper motors
29
- */
30
-void GcodeSuite::M17() {
31
-  LCD_MESSAGEPGM(MSG_NO_MOVE);
32
-  enable_all_steppers();
33
-}

Marlin/src/gcode/control/M18_M84.cpp → Marlin/src/gcode/control/M17_M18_M84.cpp Ver arquivo

@@ -22,14 +22,22 @@
22 22
 
23 23
 #include "../gcode.h"
24 24
 #include "../../Marlin.h" // for stepper_inactive_time
25
+#include "../../lcd/ultralcd.h"
25 26
 #include "../../module/stepper.h"
26 27
 
27 28
 #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTRA_LCD)
28 29
   #include "../../feature/bedlevel/bedlevel.h"
29
-  #include "../../lcd/ultralcd.h"
30 30
 #endif
31 31
 
32 32
 /**
33
+ * M17: Enable power on all stepper motors
34
+ */
35
+void GcodeSuite::M17() {
36
+  LCD_MESSAGEPGM(MSG_NO_MOVE);
37
+  enable_all_steppers();
38
+}
39
+
40
+/**
33 41
  * M18, M84: Disable stepper motors
34 42
  */
35 43
 void GcodeSuite::M18_M84() {

Marlin/src/gcode/feature/digipot/M907.cpp → Marlin/src/gcode/feature/digipot/M907-M910.cpp Ver arquivo

@@ -20,6 +20,10 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
26
+
23 27
 #include "../../gcode.h"
24 28
 
25 29
 #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
@@ -73,3 +77,34 @@ void GcodeSuite::M907() {
73 77
     LOOP_XYZE(i) if (parser.seen(axis_codes[i])) dac_current_percent(i, parser.value_float());
74 78
   #endif
75 79
 }
80
+
81
+#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
82
+
83
+  /**
84
+   * M908: Control digital trimpot directly (M908 P<pin> S<current>)
85
+   */
86
+  void GcodeSuite::M908() {
87
+    #if HAS_DIGIPOTSS
88
+      stepper.digitalPotWrite(
89
+        parser.intval('P'),
90
+        parser.intval('S')
91
+      );
92
+    #endif
93
+    #if ENABLED(DAC_STEPPER_CURRENT)
94
+      dac_current_raw(
95
+        parser.byteval('P', -1),
96
+        parser.ushortval('S', 0)
97
+      );
98
+    #endif
99
+  }
100
+
101
+#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT
102
+
103
+#if ENABLED(DAC_STEPPER_CURRENT)
104
+
105
+  void GcodeSuite::M909() { dac_print_values(); }
106
+  void GcodeSuite::M910() { dac_commit_eeprom(); }
107
+
108
+#endif // DAC_STEPPER_CURRENT
109
+
110
+#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT || HAS_MOTOR_CURRENT_PWM || DIGIPOT_I2C

+ 0
- 55
Marlin/src/gcode/feature/digipot/M908.cpp Ver arquivo

@@ -1,55 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
26
-
27
-#include "../../gcode.h"
28
-
29
-#if HAS_DIGIPOTSS
30
-  #include "../../../module/stepper.h"
31
-#endif
32
-
33
-#if ENABLED(DAC_STEPPER_CURRENT)
34
-  #include "../../../feature/dac/stepper_dac.h"
35
-#endif
36
-
37
-/**
38
- * M908: Control digital trimpot directly (M908 P<pin> S<current>)
39
- */
40
-void GcodeSuite::M908() {
41
-  #if HAS_DIGIPOTSS
42
-    stepper.digitalPotWrite(
43
-      parser.intval('P'),
44
-      parser.intval('S')
45
-    );
46
-  #endif
47
-  #if ENABLED(DAC_STEPPER_CURRENT)
48
-    dac_current_raw(
49
-      parser.byteval('P', -1),
50
-      parser.ushortval('S', 0)
51
-    );
52
-  #endif
53
-}
54
-
55
-#endif // HAS_DIGIPOTSS || DAC_STEPPER_CURRENT

+ 0
- 36
Marlin/src/gcode/feature/digipot/M909.cpp Ver arquivo

@@ -1,36 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(DAC_STEPPER_CURRENT)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/dac/stepper_dac.h"
29
-
30
-void GcodeSuite::M909() {
31
-
32
-  dac_print_values();
33
-
34
-}
35
-
36
-#endif // DAC_STEPPER_CURRENT

+ 0
- 36
Marlin/src/gcode/feature/digipot/M910.cpp Ver arquivo

@@ -1,36 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(DAC_STEPPER_CURRENT)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/dac/stepper_dac.h"
29
-
30
-void GcodeSuite::M910() {
31
-
32
-  dac_commit_eeprom();
33
-
34
-}
35
-
36
-#endif // DAC_STEPPER_CURRENT

Marlin/src/gcode/feature/fwretract/M208.cpp → Marlin/src/gcode/feature/fwretract/M207-M209.cpp Ver arquivo

@@ -28,6 +28,21 @@
28 28
 #include "../../gcode.h"
29 29
 
30 30
 /**
31
+ * M207: Set firmware retraction values
32
+ *
33
+ *   S[+units]    retract_length
34
+ *   W[+units]    swap_retract_length (multi-extruder)
35
+ *   F[units/min] retract_feedrate_mm_s
36
+ *   Z[units]     retract_zlift
37
+ */
38
+void GcodeSuite::M207() {
39
+  if (parser.seen('S')) fwretract.retract_length = parser.value_axis_units(E_AXIS);
40
+  if (parser.seen('F')) fwretract.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
41
+  if (parser.seen('Z')) fwretract.retract_zlift = parser.value_linear_units();
42
+  if (parser.seen('W')) fwretract.swap_retract_length = parser.value_axis_units(E_AXIS);
43
+}
44
+
45
+/**
31 46
  * M208: Set firmware un-retraction values
32 47
  *
33 48
  *   S[+units]    retract_recover_length (in addition to M207 S*)
@@ -42,4 +57,18 @@ void GcodeSuite::M208() {
42 57
   if (parser.seen('W')) fwretract.swap_retract_recover_length = parser.value_axis_units(E_AXIS);
43 58
 }
44 59
 
60
+/**
61
+ * M209: Enable automatic retract (M209 S1)
62
+ *   For slicers that don't support G10/11, reversed extrude-only
63
+ *   moves will be classified as retraction.
64
+ */
65
+void GcodeSuite::M209() {
66
+  if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
67
+    if (parser.seen('S')) {
68
+      fwretract.autoretract_enabled = parser.value_bool();
69
+      for (uint8_t i = 0; i < EXTRUDERS; i++) fwretract.retracted[i] = false;
70
+    }
71
+  }
72
+}
73
+
45 74
 #endif // FWRETRACT

+ 0
- 45
Marlin/src/gcode/feature/fwretract/M207.cpp Ver arquivo

@@ -1,45 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(FWRETRACT)
26
-
27
-#include "../../../feature/fwretract.h"
28
-#include "../../gcode.h"
29
-
30
-/**
31
- * M207: Set firmware retraction values
32
- *
33
- *   S[+units]    retract_length
34
- *   W[+units]    swap_retract_length (multi-extruder)
35
- *   F[units/min] retract_feedrate_mm_s
36
- *   Z[units]     retract_zlift
37
- */
38
-void GcodeSuite::M207() {
39
-  if (parser.seen('S')) fwretract.retract_length = parser.value_axis_units(E_AXIS);
40
-  if (parser.seen('F')) fwretract.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS));
41
-  if (parser.seen('Z')) fwretract.retract_zlift = parser.value_linear_units();
42
-  if (parser.seen('W')) fwretract.swap_retract_length = parser.value_axis_units(E_AXIS);
43
-}
44
-
45
-#endif // FWRETRACT

+ 0
- 44
Marlin/src/gcode/feature/fwretract/M209.cpp Ver arquivo

@@ -1,44 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(FWRETRACT)
26
-
27
-#include "../../../feature/fwretract.h"
28
-#include "../../gcode.h"
29
-
30
-/**
31
- * M209: Enable automatic retract (M209 S1)
32
- *   For slicers that don't support G10/11, reversed extrude-only
33
- *   moves will be classified as retraction.
34
- */
35
-void GcodeSuite::M209() {
36
-  if (MIN_AUTORETRACT <= MAX_AUTORETRACT) {
37
-    if (parser.seen('S')) {
38
-      fwretract.autoretract_enabled = parser.value_bool();
39
-      for (uint8_t i = 0; i < EXTRUDERS; i++) fwretract.retracted[i] = false;
40
-    }
41
-  }
42
-}
43
-
44
-#endif // FWRETRACT

Marlin/src/gcode/feature/mixing/M163.cpp → Marlin/src/gcode/feature/mixing/M163-M165.cpp Ver arquivo

@@ -44,4 +44,42 @@ void GcodeSuite::M163() {
44 44
   }
45 45
 }
46 46
 
47
+#if MIXING_VIRTUAL_TOOLS > 1
48
+
49
+  /**
50
+   * M164: Store the current mix factors as a virtual tool.
51
+   *
52
+   *   S[index]   The virtual tool to store
53
+   *
54
+   */
55
+  void GcodeSuite::M164() {
56
+    const int tool_index = parser.intval('S');
57
+    if (tool_index < MIXING_VIRTUAL_TOOLS) {
58
+      normalize_mix();
59
+      for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
60
+        mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i];
61
+    }
62
+  }
63
+
64
+#endif // MIXING_VIRTUAL_TOOLS > 1
65
+
66
+#if ENABLED(DIRECT_MIXING_IN_G1)
67
+
68
+  /**
69
+   * M165: Set multiple mix factors for a mixing extruder.
70
+   *       Factors that are left out will be set to 0.
71
+   *       All factors together must add up to 1.0.
72
+   *
73
+   *   A[factor] Mix factor for extruder stepper 1
74
+   *   B[factor] Mix factor for extruder stepper 2
75
+   *   C[factor] Mix factor for extruder stepper 3
76
+   *   D[factor] Mix factor for extruder stepper 4
77
+   *   H[factor] Mix factor for extruder stepper 5
78
+   *   I[factor] Mix factor for extruder stepper 6
79
+   *
80
+   */
81
+  void GcodeSuite::M165() { gcode_get_mix(); }
82
+
83
+#endif // DIRECT_MIXING_IN_G1
84
+
47 85
 #endif // MIXING_EXTRUDER

+ 0
- 45
Marlin/src/gcode/feature/mixing/M164.cpp Ver arquivo

@@ -1,45 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/mixing.h"
29
-
30
-/**
31
- * M164: Store the current mix factors as a virtual tool.
32
- *
33
- *   S[index]   The virtual tool to store
34
- *
35
- */
36
-void GcodeSuite::M164() {
37
-  const int tool_index = parser.intval('S');
38
-  if (tool_index < MIXING_VIRTUAL_TOOLS) {
39
-    normalize_mix();
40
-    for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
41
-      mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i];
42
-  }
43
-}
44
-
45
-#endif // MIXING_EXTRUDER && MIXING_VIRTUAL_TOOLS > 1

+ 0
- 45
Marlin/src/gcode/feature/mixing/M165.cpp Ver arquivo

@@ -1,45 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(DIRECT_MIXING_IN_G1)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/mixing.h"
29
-
30
-/**
31
- * M165: Set multiple mix factors for a mixing extruder.
32
- *       Factors that are left out will be set to 0.
33
- *       All factors together must add up to 1.0.
34
- *
35
- *   A[factor] Mix factor for extruder stepper 1
36
- *   B[factor] Mix factor for extruder stepper 2
37
- *   C[factor] Mix factor for extruder stepper 3
38
- *   D[factor] Mix factor for extruder stepper 4
39
- *   H[factor] Mix factor for extruder stepper 5
40
- *   I[factor] Mix factor for extruder stepper 6
41
- *
42
- */
43
-void GcodeSuite::M165() { gcode_get_mix(); }
44
-
45
-#endif // DIRECT_MIXING_IN_G1

+ 155
- 0
Marlin/src/gcode/feature/trinamic/M911-M914.cpp Ver arquivo

@@ -0,0 +1,155 @@
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
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(HAVE_TMC2130)
26
+
27
+#include "../../gcode.h"
28
+#include "../../../feature/tmc2130.h"
29
+#include "../../../module/stepper_indirection.h"
30
+
31
+inline void tmc2130_report_otpw(TMC2130Stepper &st, const char name) {
32
+  SERIAL_CHAR(name);
33
+  SERIAL_ECHOPGM(" axis temperature prewarn triggered: ");
34
+  serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false"));
35
+  SERIAL_EOL();
36
+}
37
+
38
+/**
39
+ * M911: Report TMC2130 stepper driver overtemperature pre-warn flag
40
+ * The flag is held by the library and persist until manually cleared by M912
41
+ */
42
+void GcodeSuite::M911() {
43
+  const bool reportX = parser.seen('X'), reportY = parser.seen('Y'), reportZ = parser.seen('Z'), reportE = parser.seen('E'),
44
+           reportAll = (!reportX && !reportY && !reportZ && !reportE) || (reportX && reportY && reportZ && reportE);
45
+  #if ENABLED(X_IS_TMC2130)
46
+    if (reportX || reportAll) tmc2130_report_otpw(stepperX, 'X');
47
+  #endif
48
+  #if ENABLED(Y_IS_TMC2130)
49
+    if (reportY || reportAll) tmc2130_report_otpw(stepperY, 'Y');
50
+  #endif
51
+  #if ENABLED(Z_IS_TMC2130)
52
+    if (reportZ || reportAll) tmc2130_report_otpw(stepperZ, 'Z');
53
+  #endif
54
+  #if ENABLED(E0_IS_TMC2130)
55
+    if (reportE || reportAll) tmc2130_report_otpw(stepperE0, 'E');
56
+  #endif
57
+}
58
+
59
+inline void tmc2130_clear_otpw(TMC2130Stepper &st, const char name) {
60
+  st.clear_otpw();
61
+  SERIAL_CHAR(name);
62
+  SERIAL_ECHOLNPGM(" prewarn flag cleared");
63
+}
64
+
65
+/**
66
+ * M912: Clear TMC2130 stepper driver overtemperature pre-warn flag held by the library
67
+ */
68
+void GcodeSuite::M912() {
69
+  const bool clearX = parser.seen('X'), clearY = parser.seen('Y'), clearZ = parser.seen('Z'), clearE = parser.seen('E'),
70
+           clearAll = (!clearX && !clearY && !clearZ && !clearE) || (clearX && clearY && clearZ && clearE);
71
+  #if ENABLED(X_IS_TMC2130)
72
+    if (clearX || clearAll) tmc2130_clear_otpw(stepperX, 'X');
73
+  #endif
74
+  #if ENABLED(Y_IS_TMC2130)
75
+    if (clearY || clearAll) tmc2130_clear_otpw(stepperY, 'Y');
76
+  #endif
77
+  #if ENABLED(Z_IS_TMC2130)
78
+    if (clearZ || clearAll) tmc2130_clear_otpw(stepperZ, 'Z');
79
+  #endif
80
+  #if ENABLED(E0_IS_TMC2130)
81
+    if (clearE || clearAll) tmc2130_clear_otpw(stepperE0, 'E');
82
+  #endif
83
+}
84
+
85
+#if ENABLED(HYBRID_THRESHOLD)
86
+
87
+  #include "../../../module/planner.h"
88
+
89
+  inline void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
90
+    SERIAL_CHAR(name);
91
+    SERIAL_ECHOPGM(" stealthChop max speed set to ");
92
+    SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
93
+  }
94
+  inline void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
95
+    st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
96
+    tmc2130_get_pwmthrs(st, name, spmm);
97
+  }
98
+
99
+  /**
100
+   * M913: Set HYBRID_THRESHOLD speed.
101
+   */
102
+  void GcodeSuite::M913() {
103
+    uint16_t values[XYZE];
104
+    LOOP_XYZE(i)
105
+      values[i] = parser.intval(axis_codes[i]);
106
+
107
+    #if ENABLED(X_IS_TMC2130)
108
+      if (values[X_AXIS]) tmc2130_set_pwmthrs(stepperX, 'X', values[X_AXIS], planner.axis_steps_per_mm[X_AXIS]);
109
+      else tmc2130_get_pwmthrs(stepperX, 'X', planner.axis_steps_per_mm[X_AXIS]);
110
+    #endif
111
+    #if ENABLED(Y_IS_TMC2130)
112
+      if (values[Y_AXIS]) tmc2130_set_pwmthrs(stepperY, 'Y', values[Y_AXIS], planner.axis_steps_per_mm[Y_AXIS]);
113
+      else tmc2130_get_pwmthrs(stepperY, 'Y', planner.axis_steps_per_mm[Y_AXIS]);
114
+    #endif
115
+    #if ENABLED(Z_IS_TMC2130)
116
+      if (values[Z_AXIS]) tmc2130_set_pwmthrs(stepperZ, 'Z', values[Z_AXIS], planner.axis_steps_per_mm[Z_AXIS]);
117
+      else tmc2130_get_pwmthrs(stepperZ, 'Z', planner.axis_steps_per_mm[Z_AXIS]);
118
+    #endif
119
+    #if ENABLED(E0_IS_TMC2130)
120
+      if (values[E_AXIS]) tmc2130_set_pwmthrs(stepperE0, 'E', values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]);
121
+      else tmc2130_get_pwmthrs(stepperE0, 'E', planner.axis_steps_per_mm[E_AXIS]);
122
+    #endif
123
+  }
124
+
125
+#endif // HYBRID_THRESHOLD
126
+
127
+#if ENABLED(SENSORLESS_HOMING)
128
+
129
+  inline void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
130
+    SERIAL_CHAR(name);
131
+    SERIAL_ECHOPGM(" driver homing sensitivity set to ");
132
+    SERIAL_ECHOLN(st.sgt());
133
+  }
134
+  inline void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
135
+    st.sgt(sgt_val);
136
+    tmc2130_get_sgt(st, name);
137
+  }
138
+
139
+  /**
140
+   * M914: Set SENSORLESS_HOMING sensitivity.
141
+   */
142
+  void GcodeSuite::M914() {
143
+    #if ENABLED(X_IS_TMC2130)
144
+      if (parser.seen(axis_codes[X_AXIS])) tmc2130_set_sgt(stepperX, 'X', parser.value_int());
145
+      else tmc2130_get_sgt(stepperX, 'X');
146
+    #endif
147
+    #if ENABLED(Y_IS_TMC2130)
148
+      if (parser.seen(axis_codes[Y_AXIS])) tmc2130_set_sgt(stepperY, 'Y', parser.value_int());
149
+      else tmc2130_get_sgt(stepperY, 'Y');
150
+    #endif
151
+  }
152
+
153
+#endif // SENSORLESS_HOMING
154
+
155
+#endif // HAVE_TMC2130

+ 0
- 59
Marlin/src/gcode/feature/trinamic/M911.cpp Ver arquivo

@@ -1,59 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(HAVE_TMC2130)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/tmc2130.h"
29
-#include "../../../module/stepper_indirection.h"
30
-
31
-inline void tmc2130_report_otpw(TMC2130Stepper &st, const char name) {
32
-  SERIAL_CHAR(name);
33
-  SERIAL_ECHOPGM(" axis temperature prewarn triggered: ");
34
-  serialprintPGM(st.getOTPW() ? PSTR("true") : PSTR("false"));
35
-  SERIAL_EOL();
36
-}
37
-
38
-/**
39
- * M911: Report TMC2130 stepper driver overtemperature pre-warn flag
40
- * The flag is held by the library and persist until manually cleared by M912
41
- */
42
-void GcodeSuite::M911() {
43
-  const bool reportX = parser.seen('X'), reportY = parser.seen('Y'), reportZ = parser.seen('Z'), reportE = parser.seen('E'),
44
-           reportAll = (!reportX && !reportY && !reportZ && !reportE) || (reportX && reportY && reportZ && reportE);
45
-  #if ENABLED(X_IS_TMC2130)
46
-    if (reportX || reportAll) tmc2130_report_otpw(stepperX, 'X');
47
-  #endif
48
-  #if ENABLED(Y_IS_TMC2130)
49
-    if (reportY || reportAll) tmc2130_report_otpw(stepperY, 'Y');
50
-  #endif
51
-  #if ENABLED(Z_IS_TMC2130)
52
-    if (reportZ || reportAll) tmc2130_report_otpw(stepperZ, 'Z');
53
-  #endif
54
-  #if ENABLED(E0_IS_TMC2130)
55
-    if (reportE || reportAll) tmc2130_report_otpw(stepperE0, 'E');
56
-  #endif
57
-}
58
-
59
-#endif // HAVE_TMC2130

+ 0
- 57
Marlin/src/gcode/feature/trinamic/M912.cpp Ver arquivo

@@ -1,57 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(HAVE_TMC2130)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/tmc2130.h"
29
-#include "../../../module/stepper_indirection.h"
30
-
31
-inline void tmc2130_clear_otpw(TMC2130Stepper &st, const char name) {
32
-  st.clear_otpw();
33
-  SERIAL_CHAR(name);
34
-  SERIAL_ECHOLNPGM(" prewarn flag cleared");
35
-}
36
-
37
-/**
38
- * M912: Clear TMC2130 stepper driver overtemperature pre-warn flag held by the library
39
- */
40
-void GcodeSuite::M912() {
41
-  const bool clearX = parser.seen('X'), clearY = parser.seen('Y'), clearZ = parser.seen('Z'), clearE = parser.seen('E'),
42
-           clearAll = (!clearX && !clearY && !clearZ && !clearE) || (clearX && clearY && clearZ && clearE);
43
-  #if ENABLED(X_IS_TMC2130)
44
-    if (clearX || clearAll) tmc2130_clear_otpw(stepperX, 'X');
45
-  #endif
46
-  #if ENABLED(Y_IS_TMC2130)
47
-    if (clearY || clearAll) tmc2130_clear_otpw(stepperY, 'Y');
48
-  #endif
49
-  #if ENABLED(Z_IS_TMC2130)
50
-    if (clearZ || clearAll) tmc2130_clear_otpw(stepperZ, 'Z');
51
-  #endif
52
-  #if ENABLED(E0_IS_TMC2130)
53
-    if (clearE || clearAll) tmc2130_clear_otpw(stepperE0, 'E');
54
-  #endif
55
-}
56
-
57
-#endif // HAVE_TMC2130

+ 0
- 68
Marlin/src/gcode/feature/trinamic/M913.cpp Ver arquivo

@@ -1,68 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(HAVE_TMC2130) && ENABLED(HYBRID_THRESHOLD)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/tmc2130.h"
29
-#include "../../../module/planner.h"
30
-#include "../../../module/stepper_indirection.h"
31
-
32
-inline void tmc2130_get_pwmthrs(TMC2130Stepper &st, const char name, const uint16_t spmm) {
33
-  SERIAL_CHAR(name);
34
-  SERIAL_ECHOPGM(" stealthChop max speed set to ");
35
-  SERIAL_ECHOLN(12650000UL * st.microsteps() / (256 * st.stealth_max_speed() * spmm));
36
-}
37
-inline void tmc2130_set_pwmthrs(TMC2130Stepper &st, const char name, const int32_t thrs, const uint32_t spmm) {
38
-  st.stealth_max_speed(12650000UL * st.microsteps() / (256 * thrs * spmm));
39
-  tmc2130_get_pwmthrs(st, name, spmm);
40
-}
41
-
42
-/**
43
- * M913: Set HYBRID_THRESHOLD speed.
44
- */
45
-void GcodeSuite::M913() {
46
-  uint16_t values[XYZE];
47
-  LOOP_XYZE(i)
48
-    values[i] = parser.intval(axis_codes[i]);
49
-
50
-  #if ENABLED(X_IS_TMC2130)
51
-    if (values[X_AXIS]) tmc2130_set_pwmthrs(stepperX, 'X', values[X_AXIS], planner.axis_steps_per_mm[X_AXIS]);
52
-    else tmc2130_get_pwmthrs(stepperX, 'X', planner.axis_steps_per_mm[X_AXIS]);
53
-  #endif
54
-  #if ENABLED(Y_IS_TMC2130)
55
-    if (values[Y_AXIS]) tmc2130_set_pwmthrs(stepperY, 'Y', values[Y_AXIS], planner.axis_steps_per_mm[Y_AXIS]);
56
-    else tmc2130_get_pwmthrs(stepperY, 'Y', planner.axis_steps_per_mm[Y_AXIS]);
57
-  #endif
58
-  #if ENABLED(Z_IS_TMC2130)
59
-    if (values[Z_AXIS]) tmc2130_set_pwmthrs(stepperZ, 'Z', values[Z_AXIS], planner.axis_steps_per_mm[Z_AXIS]);
60
-    else tmc2130_get_pwmthrs(stepperZ, 'Z', planner.axis_steps_per_mm[Z_AXIS]);
61
-  #endif
62
-  #if ENABLED(E0_IS_TMC2130)
63
-    if (values[E_AXIS]) tmc2130_set_pwmthrs(stepperE0, 'E', values[E_AXIS], planner.axis_steps_per_mm[E_AXIS]);
64
-    else tmc2130_get_pwmthrs(stepperE0, 'E', planner.axis_steps_per_mm[E_AXIS]);
65
-  #endif
66
-}
67
-
68
-#endif // HAVE_TMC2130 && HYBRID_THRESHOLD

+ 0
- 55
Marlin/src/gcode/feature/trinamic/M914.cpp Ver arquivo

@@ -1,55 +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
-#include "../../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(HAVE_TMC2130) && ENABLED(SENSORLESS_HOMING)
26
-
27
-#include "../../gcode.h"
28
-#include "../../../feature/tmc2130.h"
29
-#include "../../../module/stepper_indirection.h"
30
-
31
-inline void tmc2130_get_sgt(TMC2130Stepper &st, const char name) {
32
-  SERIAL_CHAR(name);
33
-  SERIAL_ECHOPGM(" driver homing sensitivity set to ");
34
-  SERIAL_ECHOLN(st.sgt());
35
-}
36
-inline void tmc2130_set_sgt(TMC2130Stepper &st, const char name, const int8_t sgt_val) {
37
-  st.sgt(sgt_val);
38
-  tmc2130_get_sgt(st, name);
39
-}
40
-
41
-/**
42
- * M914: Set SENSORLESS_HOMING sensitivity.
43
- */
44
-void GcodeSuite::M914() {
45
-  #if ENABLED(X_IS_TMC2130)
46
-    if (parser.seen(axis_codes[X_AXIS])) tmc2130_set_sgt(stepperX, 'X', parser.value_int());
47
-    else tmc2130_get_sgt(stepperX, 'X');
48
-  #endif
49
-  #if ENABLED(Y_IS_TMC2130)
50
-    if (parser.seen(axis_codes[Y_AXIS])) tmc2130_set_sgt(stepperY, 'Y', parser.value_int());
51
-    else tmc2130_get_sgt(stepperY, 'Y');
52
-  #endif
53
-}
54
-
55
-#endif // HAVE_TMC2130 && SENSORLESS_HOMING

+ 8
- 7
Marlin/src/gcode/gcode.cpp Ver arquivo

@@ -636,13 +636,14 @@ void GcodeSuite::process_next_command() {
636 636
         case 900: M900(); break;  // M900: Set advance K factor.
637 637
       #endif
638 638
 
639
-      case 907: M907(); break;      // M907: Set digital trimpot motor current using axis codes.
640
-
641
-      #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
642
-        case 908: M908(); break;    // M908: Control digital trimpot directly.
643
-        #if ENABLED(DAC_STEPPER_CURRENT) // As with Printrbot RevF
644
-          case 909: M909(); break;  // M909: Print digipot/DAC current value
645
-          case 910: M910(); break;  // M910: Commit digipot/DAC value to external EEPROM
639
+      #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
640
+        case 907: M907(); break;      // M907: Set digital trimpot motor current using axis codes.
641
+        #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
642
+          case 908: M908(); break;    // M908: Control digital trimpot directly.
643
+          #if ENABLED(DAC_STEPPER_CURRENT) // As with Printrbot RevF
644
+            case 909: M909(); break;  // M909: Print digipot/DAC current value
645
+            case 910: M910(); break;  // M910: Commit digipot/DAC value to external EEPROM
646
+          #endif
646 647
         #endif
647 648
       #endif
648 649
 

+ 8
- 7
Marlin/src/gcode/gcode.h Ver arquivo

@@ -706,13 +706,14 @@ private:
706 706
     #endif
707 707
   #endif
708 708
 
709
-  static void M907();
710
-
711
-  #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
712
-    static void M908();
713
-    #if ENABLED(DAC_STEPPER_CURRENT)
714
-      static void M909();
715
-      static void M910();
709
+  #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM || ENABLED(DIGIPOT_I2C) || ENABLED(DAC_STEPPER_CURRENT)
710
+    static void M907();
711
+    #if HAS_DIGIPOTSS || ENABLED(DAC_STEPPER_CURRENT)
712
+      static void M908();
713
+      #if ENABLED(DAC_STEPPER_CURRENT)
714
+        static void M909();
715
+        static void M910();
716
+      #endif
716 717
     #endif
717 718
   #endif
718 719
 

+ 0
- 51
Marlin/src/gcode/geometry/M206.cpp Ver arquivo

@@ -1,51 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if HAS_M206_COMMAND
26
-
27
-#include "../gcode.h"
28
-#include "../../module/motion.h"
29
-
30
-/**
31
- * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
32
- *
33
- * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665.
34
- * ***              M206 for SCARA will remain enabled in 1.1.x for compatibility.
35
- * ***              In the 2.0 release, it will simply be disabled by default.
36
- */
37
-void GcodeSuite::M206() {
38
-  LOOP_XYZ(i)
39
-    if (parser.seen(axis_codes[i]))
40
-      set_home_offset((AxisEnum)i, parser.value_linear_units());
41
-
42
-  #if ENABLED(MORGAN_SCARA)
43
-    if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_linear_units()); // Theta
44
-    if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_linear_units()); // Psi
45
-  #endif
46
-
47
-  SYNC_PLAN_POSITION_KINEMATIC();
48
-  report_current_position();
49
-}
50
-
51
-#endif // HAS_M206_COMMAND

Marlin/src/gcode/geometry/M428.cpp → Marlin/src/gcode/geometry/M206_M428.cpp Ver arquivo

@@ -31,6 +31,27 @@
31 31
 #include "../../Marlin.h" // for axis_homed
32 32
 
33 33
 /**
34
+ * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
35
+ *
36
+ * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665.
37
+ * ***              M206 for SCARA will remain enabled in 1.1.x for compatibility.
38
+ * ***              In the 2.0 release, it will simply be disabled by default.
39
+ */
40
+void GcodeSuite::M206() {
41
+  LOOP_XYZ(i)
42
+    if (parser.seen(axis_codes[i]))
43
+      set_home_offset((AxisEnum)i, parser.value_linear_units());
44
+
45
+  #if ENABLED(MORGAN_SCARA)
46
+    if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_linear_units()); // Theta
47
+    if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_linear_units()); // Psi
48
+  #endif
49
+
50
+  SYNC_PLAN_POSITION_KINEMATIC();
51
+  report_current_position();
52
+}
53
+
54
+/**
34 55
  * M428: Set home_offset based on the distance between the
35 56
  *       current_position and the nearest "reference point."
36 57
  *       If an axis is past center its endstop position

+ 191
- 0
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp Ver arquivo

@@ -0,0 +1,191 @@
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
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(SDSUPPORT)
26
+
27
+#include "../gcode.h"
28
+#include "../../sd/cardreader.h"
29
+#include "../../module/printcounter.h"
30
+#include "../../module/stepper.h"
31
+
32
+#if ENABLED(PARK_HEAD_ON_PAUSE)
33
+  #include "../../feature/pause.h"
34
+  #include "../queue.h"
35
+#endif
36
+
37
+/**
38
+ * M20: List SD card to serial output
39
+ */
40
+void GcodeSuite::M20() {
41
+  SERIAL_PROTOCOLLNPGM(MSG_BEGIN_FILE_LIST);
42
+  card.ls();
43
+  SERIAL_PROTOCOLLNPGM(MSG_END_FILE_LIST);
44
+}
45
+
46
+/**
47
+ * M21: Init SD Card
48
+ */
49
+void GcodeSuite::M21() { card.initsd(); }
50
+
51
+/**
52
+ * M22: Release SD Card
53
+ */
54
+void GcodeSuite::M22() { card.release(); }
55
+
56
+/**
57
+ * M23: Open a file
58
+ */
59
+void GcodeSuite::M23() {
60
+  // Simplify3D includes the size, so zero out all spaces (#7227)
61
+  for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
62
+  card.openFile(parser.string_arg, true);
63
+}
64
+
65
+/**
66
+ * M24: Start or Resume SD Print
67
+ */
68
+void GcodeSuite::M24() {
69
+  #if ENABLED(PARK_HEAD_ON_PAUSE)
70
+    resume_print();
71
+  #endif
72
+
73
+  card.startFileprint();
74
+  print_job_timer.start();
75
+}
76
+
77
+/**
78
+ * M25: Pause SD Print
79
+ */
80
+void GcodeSuite::M25() {
81
+  card.pauseSDPrint();
82
+  print_job_timer.pause();
83
+
84
+  #if ENABLED(PARK_HEAD_ON_PAUSE)
85
+    enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer
86
+  #endif
87
+}
88
+
89
+/**
90
+ * M26: Set SD Card file index
91
+ */
92
+void GcodeSuite::M26() {
93
+  if (card.cardOK && parser.seenval('S'))
94
+    card.setIndex(parser.value_long());
95
+}
96
+
97
+/**
98
+ * M27: Get SD Card status
99
+ */
100
+void GcodeSuite::M27() { card.getStatus(); }
101
+
102
+/**
103
+ * M28: Start SD Write
104
+ */
105
+void GcodeSuite::M28() { card.openFile(parser.string_arg, false); }
106
+
107
+/**
108
+ * M29: Stop SD Write
109
+ * Processed in write to file routine
110
+ */
111
+void GcodeSuite::M29() {
112
+  // card.saving = false;
113
+}
114
+
115
+/**
116
+ * M30 <filename>: Delete SD Card file
117
+ */
118
+void GcodeSuite::M30() {
119
+  if (card.cardOK) {
120
+    card.closefile();
121
+    card.removeFile(parser.string_arg);
122
+  }
123
+}
124
+
125
+/**
126
+ * M32: Select file and start SD Print
127
+ */
128
+void GcodeSuite::M32() {
129
+  if (IS_SD_PRINTING)
130
+    stepper.synchronize();
131
+
132
+  char* namestartpos = parser.string_arg;
133
+  const bool call_procedure = parser.boolval('P');
134
+
135
+  if (card.cardOK) {
136
+    card.openFile(namestartpos, true, call_procedure);
137
+
138
+    if (parser.seenval('S'))
139
+      card.setIndex(parser.value_long());
140
+
141
+    card.startFileprint();
142
+
143
+    // Procedure calls count as normal print time.
144
+    if (!call_procedure) print_job_timer.start();
145
+  }
146
+}
147
+
148
+#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
149
+
150
+  /**
151
+   * M33: Get the long full path of a file or folder
152
+   *
153
+   * Parameters:
154
+   *   <dospath> Case-insensitive DOS-style path to a file or folder
155
+   *
156
+   * Example:
157
+   *   M33 miscel~1/armchair/armcha~1.gco
158
+   *
159
+   * Output:
160
+   *   /Miscellaneous/Armchair/Armchair.gcode
161
+   */
162
+  void GcodeSuite::M33() {
163
+    card.printLongPath(parser.string_arg);
164
+  }
165
+
166
+#endif // LONG_FILENAME_HOST_SUPPORT
167
+
168
+#if ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
169
+
170
+  /**
171
+   * M34: Set SD Card Sorting Options
172
+   */
173
+  void GcodeSuite::M34() {
174
+    if (parser.seen('S')) card.setSortOn(parser.value_bool());
175
+    if (parser.seenval('F')) {
176
+      const int v = parser.value_long();
177
+      card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);
178
+    }
179
+    //if (parser.seen('R')) card.setSortReverse(parser.value_bool());
180
+  }
181
+
182
+#endif // SDCARD_SORT_ALPHA && SDSORT_GCODE
183
+
184
+/**
185
+ * M928: Start SD Write
186
+ */
187
+void GcodeSuite::M928() {
188
+  card.openLogFile(parser.string_arg);
189
+}
190
+
191
+#endif // SDSUPPORT

+ 0
- 39
Marlin/src/gcode/sdcard/M20.cpp Ver arquivo

@@ -1,39 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M20: List SD card to serial output
32
- */
33
-void GcodeSuite::M20() {
34
-  SERIAL_PROTOCOLLNPGM(MSG_BEGIN_FILE_LIST);
35
-  card.ls();
36
-  SERIAL_PROTOCOLLNPGM(MSG_END_FILE_LIST);
37
-}
38
-
39
-#endif // SDSUPPORT

+ 0
- 35
Marlin/src/gcode/sdcard/M21.cpp Ver arquivo

@@ -1,35 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M21: Init SD Card
32
- */
33
-void GcodeSuite::M21() { card.initsd(); }
34
-
35
-#endif // SDSUPPORT

+ 0
- 35
Marlin/src/gcode/sdcard/M22.cpp Ver arquivo

@@ -1,35 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M22: Release SD Card
32
- */
33
-void GcodeSuite::M22() { card.release(); }
34
-
35
-#endif // SDSUPPORT

+ 0
- 39
Marlin/src/gcode/sdcard/M23.cpp Ver arquivo

@@ -1,39 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M23: Open a file
32
- */
33
-void GcodeSuite::M23() {
34
-  // Simplify3D includes the size, so zero out all spaces (#7227)
35
-  for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
36
-  card.openFile(parser.string_arg, true);
37
-}
38
-
39
-#endif // SDSUPPORT

+ 0
- 47
Marlin/src/gcode/sdcard/M24.cpp Ver arquivo

@@ -1,47 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-#include "../../module/printcounter.h"
30
-
31
-#if ENABLED(PARK_HEAD_ON_PAUSE)
32
-  #include "../../feature/pause.h"
33
-#endif
34
-
35
-/**
36
- * M24: Start or Resume SD Print
37
- */
38
-void GcodeSuite::M24() {
39
-  #if ENABLED(PARK_HEAD_ON_PAUSE)
40
-    resume_print();
41
-  #endif
42
-
43
-  card.startFileprint();
44
-  print_job_timer.start();
45
-}
46
-
47
-#endif // SDSUPPORT

+ 0
- 47
Marlin/src/gcode/sdcard/M25.cpp Ver arquivo

@@ -1,47 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-#include "../../module/printcounter.h"
30
-
31
-#if ENABLED(PARK_HEAD_ON_PAUSE)
32
-  #include "../queue.h"
33
-#endif
34
-
35
-/**
36
- * M25: Pause SD Print
37
- */
38
-void GcodeSuite::M25() {
39
-  card.pauseSDPrint();
40
-  print_job_timer.pause();
41
-
42
-  #if ENABLED(PARK_HEAD_ON_PAUSE)
43
-    enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer
44
-  #endif
45
-}
46
-
47
-#endif // SDSUPPORT

+ 0
- 38
Marlin/src/gcode/sdcard/M26.cpp Ver arquivo

@@ -1,38 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M26: Set SD Card file index
32
- */
33
-void GcodeSuite::M26() {
34
-  if (card.cardOK && parser.seenval('S'))
35
-    card.setIndex(parser.value_long());
36
-}
37
-
38
-#endif // SDSUPPORT

+ 0
- 35
Marlin/src/gcode/sdcard/M27.cpp Ver arquivo

@@ -1,35 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M27: Get SD Card status
32
- */
33
-void GcodeSuite::M27() { card.getStatus(); }
34
-
35
-#endif // SDSUPPORT

+ 0
- 35
Marlin/src/gcode/sdcard/M28.cpp Ver arquivo

@@ -1,35 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M28: Start SD Write
32
- */
33
-void GcodeSuite::M28() { card.openFile(parser.string_arg, false); }
34
-
35
-#endif // SDSUPPORT

+ 0
- 38
Marlin/src/gcode/sdcard/M29.cpp Ver arquivo

@@ -1,38 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M29: Stop SD Write
32
- * Processed in write to file routine above
33
- */
34
-void GcodeSuite::M29() {
35
-  // card.saving = false;
36
-}
37
-
38
-#endif // SDSUPPORT

+ 0
- 40
Marlin/src/gcode/sdcard/M30.cpp Ver arquivo

@@ -1,40 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M30 <filename>: Delete SD Card file
32
- */
33
-void GcodeSuite::M30() {
34
-  if (card.cardOK) {
35
-    card.closefile();
36
-    card.removeFile(parser.string_arg);
37
-  }
38
-}
39
-
40
-#endif // SDSUPPORT

+ 0
- 55
Marlin/src/gcode/sdcard/M32.cpp Ver arquivo

@@ -1,55 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-#include "../../module/stepper.h"
30
-#include "../../module/printcounter.h"
31
-
32
-/**
33
- * M32: Select file and start SD Print
34
- */
35
-void GcodeSuite::M32() {
36
-  if (IS_SD_PRINTING)
37
-    stepper.synchronize();
38
-
39
-  char* namestartpos = parser.string_arg;
40
-  const bool call_procedure = parser.boolval('P');
41
-
42
-  if (card.cardOK) {
43
-    card.openFile(namestartpos, true, call_procedure);
44
-
45
-    if (parser.seenval('S'))
46
-      card.setIndex(parser.value_long());
47
-
48
-    card.startFileprint();
49
-
50
-    // Procedure calls count as normal print time.
51
-    if (!call_procedure) print_job_timer.start();
52
-  }
53
-}
54
-
55
-#endif // SDSUPPORT

+ 0
- 46
Marlin/src/gcode/sdcard/M33.cpp Ver arquivo

@@ -1,46 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT) && ENABLED(LONG_FILENAME_HOST_SUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M33: Get the long full path of a file or folder
32
- *
33
- * Parameters:
34
- *   <dospath> Case-insensitive DOS-style path to a file or folder
35
- *
36
- * Example:
37
- *   M33 miscel~1/armchair/armcha~1.gco
38
- *
39
- * Output:
40
- *   /Miscellaneous/Armchair/Armchair.gcode
41
- */
42
-void GcodeSuite::M33() {
43
-  card.printLongPath(parser.string_arg);
44
-}
45
-
46
-#endif // SDSUPPORT && LONG_FILENAME_HOST_SUPPORT

+ 0
- 42
Marlin/src/gcode/sdcard/M34.cpp Ver arquivo

@@ -1,42 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT) && ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_GCODE)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M34: Set SD Card Sorting Options
32
- */
33
-void GcodeSuite::M34() {
34
-  if (parser.seen('S')) card.setSortOn(parser.value_bool());
35
-  if (parser.seenval('F')) {
36
-    const int v = parser.value_long();
37
-    card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0);
38
-  }
39
-  //if (parser.seen('R')) card.setSortReverse(parser.value_bool());
40
-}
41
-
42
-#endif // SDSUPPORT && SDCARD_SORT_ALPHA && SDSORT_GCODE

+ 0
- 37
Marlin/src/gcode/sdcard/M928.cpp Ver arquivo

@@ -1,37 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(SDSUPPORT)
26
-
27
-#include "../gcode.h"
28
-#include "../../sd/cardreader.h"
29
-
30
-/**
31
- * M928: Start SD Write
32
- */
33
-void GcodeSuite::M928() {
34
-  card.openLogFile(parser.string_arg);
35
-}
36
-
37
-#endif // SDSUPPORT

+ 0
- 39
Marlin/src/gcode/stats/M75-M77.cpp Ver arquivo

@@ -1,39 +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
-#include "../gcode.h"
24
-#include "../../module/printcounter.h"
25
-
26
-/**
27
- * M75: Start print timer
28
- */
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(); }

Marlin/src/gcode/stats/M78.cpp → Marlin/src/gcode/stats/M75-M78.cpp Ver arquivo

@@ -20,14 +20,27 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if ENABLED(PRINTCOUNTER)
26
-
27 23
 #include "../gcode.h"
28 24
 #include "../../module/printcounter.h"
29 25
 
30 26
 /**
27
+ * M75: Start print timer
28
+ */
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(); }
40
+
41
+#if ENABLED(PRINTCOUNTER)
42
+
43
+/**
31 44
  * M78: Show print statistics
32 45
  */
33 46
 void GcodeSuite::M78() {

+ 0
- 75
Marlin/src/gcode/temperature/M104.cpp Ver arquivo

@@ -1,75 +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
-#include "../gcode.h"
24
-#include "../../module/temperature.h"
25
-#include "../../module/motion.h"
26
-#include "../../module/planner.h"
27
-#include "../../lcd/ultralcd.h"
28
-
29
-#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
30
-  #include "../../module/printcounter.h"
31
-#endif
32
-
33
-/**
34
- * M104: Set hot end temperature
35
- */
36
-void GcodeSuite::M104() {
37
-  if (get_target_extruder_from_command()) return;
38
-  if (DEBUGGING(DRYRUN)) return;
39
-
40
-  const uint8_t e = target_extruder;
41
-
42
-  #if ENABLED(SINGLENOZZLE)
43
-    if (e != active_extruder) return;
44
-  #endif
45
-
46
-  if (parser.seenval('S')) {
47
-    const int16_t temp = parser.value_celsius();
48
-    thermalManager.setTargetHotend(temp, e);
49
-
50
-    #if ENABLED(DUAL_X_CARRIAGE)
51
-      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && e == 0)
52
-        thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
53
-    #endif
54
-
55
-    #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
56
-      /**
57
-       * Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
58
-       * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
59
-       * standby mode, for instance in a dual extruder setup, without affecting
60
-       * the running print timer.
61
-       */
62
-      if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
63
-        print_job_timer.stop();
64
-        LCD_MESSAGEPGM(WELCOME_MSG);
65
-      }
66
-    #endif
67
-
68
-    if (parser.value_celsius() > thermalManager.degHotend(e))
69
-      lcd_status_printf_P(0, PSTR("E%i %s"), e + 1, MSG_HEATING);
70
-  }
71
-
72
-  #if ENABLED(AUTOTEMP)
73
-    planner.autotemp_M104_M109();
74
-  #endif
75
-}

Marlin/src/gcode/temperature/M109.cpp → Marlin/src/gcode/temperature/M104_M109.cpp Ver arquivo

@@ -22,6 +22,7 @@
22 22
 
23 23
 #include "../gcode.h"
24 24
 #include "../../module/temperature.h"
25
+#include "../../module/motion.h"
25 26
 #include "../../module/planner.h"
26 27
 #include "../../lcd/ultralcd.h"
27 28
 #include "../../Marlin.h"
@@ -30,15 +31,55 @@
30 31
   #include "../../module/printcounter.h"
31 32
 #endif
32 33
 
33
-#if ENABLED(DUAL_X_CARRIAGE)
34
-  #include "../../module/motion.h"
35
-#endif
36
-
37 34
 #if HAS_COLOR_LEDS
38 35
   #include "../../feature/leds/leds.h"
39 36
 #endif
40 37
 
41 38
 /**
39
+ * M104: Set hot end temperature
40
+ */
41
+void GcodeSuite::M104() {
42
+  if (get_target_extruder_from_command()) return;
43
+  if (DEBUGGING(DRYRUN)) return;
44
+
45
+  const uint8_t e = target_extruder;
46
+
47
+  #if ENABLED(SINGLENOZZLE)
48
+    if (e != active_extruder) return;
49
+  #endif
50
+
51
+  if (parser.seenval('S')) {
52
+    const int16_t temp = parser.value_celsius();
53
+    thermalManager.setTargetHotend(temp, e);
54
+
55
+    #if ENABLED(DUAL_X_CARRIAGE)
56
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && e == 0)
57
+        thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
58
+    #endif
59
+
60
+    #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
61
+      /**
62
+       * Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
63
+       * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
64
+       * standby mode, for instance in a dual extruder setup, without affecting
65
+       * the running print timer.
66
+       */
67
+      if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
68
+        print_job_timer.stop();
69
+        LCD_MESSAGEPGM(WELCOME_MSG);
70
+      }
71
+    #endif
72
+
73
+    if (parser.value_celsius() > thermalManager.degHotend(e))
74
+      lcd_status_printf_P(0, PSTR("E%i %s"), e + 1, MSG_HEATING);
75
+  }
76
+
77
+  #if ENABLED(AUTOTEMP)
78
+    planner.autotemp_M104_M109();
79
+  #endif
80
+}
81
+
82
+/**
42 83
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
43 84
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
44 85
  */

+ 0
- 38
Marlin/src/gcode/temperature/M140.cpp Ver arquivo

@@ -1,38 +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
-#include "../../inc/MarlinConfig.h"
24
-
25
-#if HAS_HEATER_BED && HAS_TEMP_BED
26
-
27
-#include "../gcode.h"
28
-#include "../../module/temperature.h"
29
-
30
-/**
31
- * M140: Set bed temperature
32
- */
33
-void GcodeSuite::M140() {
34
-  if (DEBUGGING(DRYRUN)) return;
35
-  if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
36
-}
37
-
38
-#endif // HAS_HEATER_BED && HAS_TEMP_BED

Marlin/src/gcode/temperature/M190.cpp → Marlin/src/gcode/temperature/M140_M190.cpp Ver arquivo

@@ -25,8 +25,8 @@
25 25
 #if HAS_HEATER_BED && HAS_TEMP_BED
26 26
 
27 27
 #include "../gcode.h"
28
-#include "../../module/motion.h"
29 28
 #include "../../module/temperature.h"
29
+#include "../../module/motion.h"
30 30
 #include "../../lcd/ultralcd.h"
31 31
 
32 32
 #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
@@ -39,6 +39,14 @@
39 39
 
40 40
 #include "../../Marlin.h" // for wait_for_heatup and idle()
41 41
 
42
+/**
43
+ * M140: Set bed temperature
44
+ */
45
+void GcodeSuite::M140() {
46
+  if (DEBUGGING(DRYRUN)) return;
47
+  if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius());
48
+}
49
+
42 50
 #ifndef MIN_COOLING_SLOPE_DEG_BED
43 51
   #define MIN_COOLING_SLOPE_DEG_BED 1.50
44 52
 #endif

+ 2
- 4
Marlin/src/lcd/ultralcd.cpp Ver arquivo

@@ -761,9 +761,7 @@ void kill_screen(const char* lcd_msg) {
761 761
 
762 762
   #if ENABLED(MENU_ITEM_CASE_LIGHT)
763 763
 
764
-    extern int case_light_brightness;
765
-    extern bool case_light_on;
766
-    extern void update_case_light();
764
+    #include "../feature/caselight.h"
767 765
 
768 766
     void case_light_menu() {
769 767
       START_MENU();
@@ -771,7 +769,7 @@ void kill_screen(const char* lcd_msg) {
771 769
       // ^ Main
772 770
       //
773 771
       MENU_BACK(MSG_MAIN);
774
-      MENU_ITEM_EDIT_CALLBACK(int3, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
772
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
775 773
       MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
776 774
       END_MENU();
777 775
     }

Carregando…
Cancelar
Salvar