Browse Source

Merge pull request #1801 from thinkyhead/fixup_probing

Minor optimizations
Scott Lahteine 9 years ago
parent
commit
a3e129e091

+ 4
- 2
Marlin/Configuration.h View File

@@ -529,8 +529,10 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
529 529
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
530 530
 #endif
531 531
 
532
-//// MOVEMENT SETTINGS
533
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
532
+/**
533
+ * MOVEMENT SETTINGS
534
+ */
535
+
534 536
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
535 537
 
536 538
 // default settings

+ 43
- 28
Marlin/Marlin.h View File

@@ -62,49 +62,48 @@
62 62
   #define MYSERIAL MSerial
63 63
 #endif
64 64
 
65
-#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))
66
-#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y))
67
-#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x)))
68
-#define SERIAL_PROTOCOLLN(x) (MYSERIAL.print(x),MYSERIAL.write('\n'))
69
-#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x)),MYSERIAL.write('\n'))
65
+#define SERIAL_CHAR(x) MYSERIAL.write(x)
66
+#define SERIAL_EOL SERIAL_CHAR('\n')
67
+
68
+#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x)
69
+#define SERIAL_PROTOCOL(x) MYSERIAL.print(x)
70
+#define SERIAL_PROTOCOL_F(x,y) MYSERIAL.print(x,y)
71
+#define SERIAL_PROTOCOLPGM(x) serialprintPGM(PSTR(x))
72
+#define SERIAL_PROTOCOLLN(x) do{ MYSERIAL.print(x),MYSERIAL.write('\n'); }while(0)
73
+#define SERIAL_PROTOCOLLNPGM(x) do{ serialprintPGM(PSTR(x)),MYSERIAL.write('\n'); }while(0)
70 74
 
71 75
 
72 76
 extern const char errormagic[] PROGMEM;
73 77
 extern const char echomagic[] PROGMEM;
74 78
 
75
-#define SERIAL_ERROR_START (serialprintPGM(errormagic))
79
+#define SERIAL_ERROR_START serialprintPGM(errormagic)
76 80
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
77 81
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
78 82
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
79 83
 #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
80 84
 
81
-#define SERIAL_ECHO_START (serialprintPGM(echomagic))
85
+#define SERIAL_ECHO_START serialprintPGM(echomagic)
82 86
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
83 87
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
84 88
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
85 89
 #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
86 90
 
87
-#define SERIAL_ECHOPAIR(name,value) (serial_echopair_P(PSTR(name),(value)))
88
-
89
-#define SERIAL_EOL MYSERIAL.write('\n')
91
+#define SERIAL_ECHOPAIR(name,value) do{ serial_echopair_P(PSTR(name),(value)); }while(0)
90 92
 
91 93
 void serial_echopair_P(const char *s_P, float v);
92 94
 void serial_echopair_P(const char *s_P, double v);
93 95
 void serial_echopair_P(const char *s_P, unsigned long v);
94 96
 
95 97
 
96
-//Things to write to serial from Program memory. Saves 400 to 2k of RAM.
97
-FORCE_INLINE void serialprintPGM(const char *str)
98
-{
99
-  char ch=pgm_read_byte(str);
100
-  while(ch)
101
-  {
98
+// Things to write to serial from Program memory. Saves 400 to 2k of RAM.
99
+FORCE_INLINE void serialprintPGM(const char *str) {
100
+  char ch;
101
+  while ((ch = pgm_read_byte(str))) {
102 102
     MYSERIAL.write(ch);
103
-    ch=pgm_read_byte(++str);
103
+    str++;
104 104
   }
105 105
 }
106 106
 
107
-
108 107
 void get_command();
109 108
 void process_commands();
110 109
 
@@ -148,7 +147,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
148 147
 #endif
149 148
 
150 149
 #if HAS_E0_ENABLE
151
-  #define enable_e0() E0_ENABLE_WRITE(E_ENABLE_ON)
150
+  #define enable_e0()  E0_ENABLE_WRITE( E_ENABLE_ON)
152 151
   #define disable_e0() E0_ENABLE_WRITE(!E_ENABLE_ON)
153 152
 #else
154 153
   #define enable_e0()  /* nothing */
@@ -156,7 +155,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
156 155
 #endif
157 156
 
158 157
 #if (EXTRUDERS > 1) && HAS_E1_ENABLE
159
-  #define enable_e1() E1_ENABLE_WRITE(E_ENABLE_ON)
158
+  #define enable_e1()  E1_ENABLE_WRITE( E_ENABLE_ON)
160 159
   #define disable_e1() E1_ENABLE_WRITE(!E_ENABLE_ON)
161 160
 #else
162 161
   #define enable_e1()  /* nothing */
@@ -164,7 +163,7 @@ void manage_inactivity(bool ignore_stepper_queue=false);
164 163
 #endif
165 164
 
166 165
 #if (EXTRUDERS > 2) && HAS_E2_ENABLE
167
-  #define enable_e2() E2_ENABLE_WRITE(E_ENABLE_ON)
166
+  #define enable_e2()  E2_ENABLE_WRITE( E_ENABLE_ON)
168 167
   #define disable_e2() E2_ENABLE_WRITE(!E_ENABLE_ON)
169 168
 #else
170 169
   #define enable_e2()  /* nothing */
@@ -172,19 +171,29 @@ void manage_inactivity(bool ignore_stepper_queue=false);
172 171
 #endif
173 172
 
174 173
 #if (EXTRUDERS > 3) && HAS_E3_ENABLE
175
-  #define enable_e3() E3_ENABLE_WRITE(E_ENABLE_ON)
174
+  #define enable_e3()  E3_ENABLE_WRITE( E_ENABLE_ON)
176 175
   #define disable_e3() E3_ENABLE_WRITE(!E_ENABLE_ON)
177 176
 #else
178 177
   #define enable_e3()  /* nothing */
179 178
   #define disable_e3() /* nothing */
180 179
 #endif
181 180
 
181
+/**
182
+ * The axis order in all axis related arrays is X, Y, Z, E
183
+ */
184
+#define NUM_AXIS 4
185
+
186
+/**
187
+ * Axis indices as enumerated constants
188
+ *
189
+ * A_AXIS and B_AXIS are used by COREXY printers
190
+ * X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
191
+ */
192
+enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
193
+
182 194
 void enable_all_steppers();
183 195
 void disable_all_steppers();
184 196
 
185
-enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
186
-//X_HEAD and Y_HEAD is used for systems that don't have a 1:1 relationship between X_AXIS and X Head movement, like CoreXY bots.
187
-
188 197
 void FlushSerialRequestResend();
189 198
 void ClearToSend();
190 199
 
@@ -227,7 +236,7 @@ void refresh_cmd_timeout(void);
227 236
 #ifndef CRITICAL_SECTION_START
228 237
   #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
229 238
   #define CRITICAL_SECTION_END    SREG = _sreg;
230
-#endif //CRITICAL_SECTION_START
239
+#endif
231 240
 
232 241
 extern float homing_feedrate[];
233 242
 extern bool axis_relative_modes[];
@@ -236,8 +245,9 @@ extern bool volumetric_enabled;
236 245
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
237 246
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
238 247
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
239
-extern float current_position[NUM_AXIS] ;
248
+extern float current_position[NUM_AXIS];
240 249
 extern float home_offset[3];
250
+
241 251
 #ifdef DELTA
242 252
   extern float endstop_adj[3];
243 253
   extern float delta_radius;
@@ -245,18 +255,23 @@ extern float home_offset[3];
245 255
   extern float delta_segments_per_second;
246 256
   void recalc_delta_settings(float radius, float diagonal_rod);
247 257
 #elif defined(Z_DUAL_ENDSTOPS)
248
-extern float z_endstop_adj;
258
+  extern float z_endstop_adj;
249 259
 #endif
260
+
250 261
 #ifdef SCARA
251 262
   extern float axis_scaling[3];  // Build size scaling
252 263
 #endif
264
+
253 265
 extern float min_pos[3];
254 266
 extern float max_pos[3];
255 267
 extern bool axis_known_position[3];
268
+
256 269
 #ifdef ENABLE_AUTO_BED_LEVELING
257 270
   extern float zprobe_zoffset;
258 271
 #endif
272
+
259 273
 extern int fanSpeed;
274
+
260 275
 #ifdef BARICUDA
261 276
   extern int ValvePressure;
262 277
   extern int EtoPPressure;

+ 1
- 2
Marlin/MarlinSerial.cpp View File

@@ -268,8 +268,7 @@ void MarlinSerial::printFloat(double number, uint8_t digits) {
268 268
   print(int_part);
269 269
 
270 270
   // Print the decimal point, but only if there are digits beyond
271
-  if (digits > 0)
272
-    print("."); 
271
+  if (digits > 0) print('.');
273 272
 
274 273
   // Extract digits from the remainder one at a time
275 274
   while (digits-- > 0) {

+ 101
- 94
Marlin/Marlin_main.cpp View File

@@ -243,7 +243,7 @@ static unsigned long max_inactive_time = 0;
243 243
 static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l;
244 244
 unsigned long starttime = 0; ///< Print job start time
245 245
 unsigned long stoptime = 0;  ///< Print job stop time
246
-static uint8_t tmp_extruder;
246
+static uint8_t target_extruder;
247 247
 bool Stopped = false;
248 248
 bool CooldownNoWait = true;
249 249
 bool target_direction;
@@ -857,7 +857,9 @@ float code_value() {
857 857
   return ret;
858 858
 }
859 859
 
860
-long code_value_long() { return (strtol(strchr_pointer + 1, NULL, 10)); }
860
+long code_value_long() { return strtol(strchr_pointer + 1, NULL, 10); }
861
+
862
+int16_t code_value_short() { return (int16_t)strtol(strchr_pointer + 1, NULL, 10); }
861 863
 
862 864
 bool code_seen(char code) {
863 865
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
@@ -1410,9 +1412,9 @@ inline void sync_plan_position() {
1410 1412
       for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
1411 1413
         for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
1412 1414
           SERIAL_PROTOCOL_F(bed_level[x][y], 2);
1413
-          SERIAL_PROTOCOLPGM(" ");
1415
+          SERIAL_PROTOCOLCHAR(' ');
1414 1416
         }
1415
-        SERIAL_ECHOLN("");
1417
+        SERIAL_EOL;
1416 1418
       }
1417 1419
     }
1418 1420
 
@@ -1685,7 +1687,7 @@ inline void gcode_G2_G3(bool clockwise) {
1685 1687
  * G4: Dwell S<seconds> or P<milliseconds>
1686 1688
  */
1687 1689
 inline void gcode_G4() {
1688
-  unsigned long codenum=0;
1690
+  unsigned long codenum = 0;
1689 1691
 
1690 1692
   LCD_MESSAGEPGM(MSG_DWELL);
1691 1693
 
@@ -1711,7 +1713,7 @@ inline void gcode_G4() {
1711 1713
   inline void gcode_G10_G11(bool doRetract=false) {
1712 1714
     #if EXTRUDERS > 1
1713 1715
       if (doRetract) {
1714
-        retracted_swap[active_extruder] = (code_seen('S') && code_value_long() == 1); // checks for swap retract argument
1716
+        retracted_swap[active_extruder] = (code_seen('S') && code_value_short() == 1); // checks for swap retract argument
1715 1717
       }
1716 1718
     #endif
1717 1719
     retract(doRetract
@@ -2029,7 +2031,7 @@ inline void gcode_G28() {
2029 2031
   inline void gcode_G29() {
2030 2032
 
2031 2033
     static int probe_point = -1;
2032
-    MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_long() : MeshReport;
2034
+    MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_short() : MeshReport;
2033 2035
     if (state < 0 || state > 2) {
2034 2036
       SERIAL_PROTOCOLLNPGM("S out of range (0-2).");
2035 2037
       return;
@@ -2040,7 +2042,7 @@ inline void gcode_G28() {
2040 2042
         if (mbl.active) {
2041 2043
           SERIAL_PROTOCOLPGM("Num X,Y: ");
2042 2044
           SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
2043
-          SERIAL_PROTOCOLPGM(",");
2045
+          SERIAL_PROTOCOLCHAR(',');
2044 2046
           SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
2045 2047
           SERIAL_PROTOCOLPGM("\nZ search height: ");
2046 2048
           SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z);
@@ -2156,7 +2158,7 @@ inline void gcode_G28() {
2156 2158
       return;
2157 2159
     }
2158 2160
 
2159
-    int verbose_level = code_seen('V') || code_seen('v') ? code_value_long() : 1;
2161
+    int verbose_level = code_seen('V') || code_seen('v') ? code_value_short() : 1;
2160 2162
     if (verbose_level < 0 || verbose_level > 4) {
2161 2163
       SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4).");
2162 2164
       return;
@@ -2178,19 +2180,19 @@ inline void gcode_G28() {
2178 2180
 
2179 2181
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
2180 2182
       #ifndef DELTA
2181
-        if (code_seen('P')) auto_bed_leveling_grid_points = code_value_long();
2183
+        if (code_seen('P')) auto_bed_leveling_grid_points = code_value_short();
2182 2184
         if (auto_bed_leveling_grid_points < 2) {
2183 2185
           SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
2184 2186
           return;
2185 2187
         }
2186 2188
       #endif
2187 2189
 
2188
-      xy_travel_speed = code_seen('S') ? code_value_long() : XY_TRAVEL_SPEED;
2190
+      xy_travel_speed = code_seen('S') ? code_value_short() : XY_TRAVEL_SPEED;
2189 2191
 
2190
-      int left_probe_bed_position = code_seen('L') ? code_value_long() : LEFT_PROBE_BED_POSITION,
2191
-          right_probe_bed_position = code_seen('R') ? code_value_long() : RIGHT_PROBE_BED_POSITION,
2192
-          front_probe_bed_position = code_seen('F') ? code_value_long() : FRONT_PROBE_BED_POSITION,
2193
-          back_probe_bed_position = code_seen('B') ? code_value_long() : BACK_PROBE_BED_POSITION;
2192
+      int left_probe_bed_position = code_seen('L') ? code_value_short() : LEFT_PROBE_BED_POSITION,
2193
+          right_probe_bed_position = code_seen('R') ? code_value_short() : RIGHT_PROBE_BED_POSITION,
2194
+          front_probe_bed_position = code_seen('F') ? code_value_short() : FRONT_PROBE_BED_POSITION,
2195
+          back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
2194 2196
 
2195 2197
       bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
2196 2198
            left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE,
@@ -2394,7 +2396,7 @@ inline void gcode_G28() {
2394 2396
               if (diff >= 0.0)
2395 2397
                 SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2396 2398
               else
2397
-                SERIAL_PROTOCOLPGM(" ");
2399
+                SERIAL_PROTOCOLCHAR(' ');
2398 2400
               SERIAL_PROTOCOL_F(diff, 5);
2399 2401
             } // xx
2400 2402
             SERIAL_EOL;
@@ -2518,11 +2520,11 @@ inline void gcode_G92() {
2518 2520
     unsigned long codenum = 0;
2519 2521
     bool hasP = false, hasS = false;
2520 2522
     if (code_seen('P')) {
2521
-      codenum = code_value(); // milliseconds to wait
2523
+      codenum = code_value_short(); // milliseconds to wait
2522 2524
       hasP = codenum > 0;
2523 2525
     }
2524 2526
     if (code_seen('S')) {
2525
-      codenum = code_value() * 1000; // seconds to wait
2527
+      codenum = code_value_short() * 1000UL; // seconds to wait
2526 2528
       hasS = codenum > 0;
2527 2529
     }
2528 2530
     char* starpos = strchr(src, '*');
@@ -2628,7 +2630,7 @@ inline void gcode_M17() {
2628 2630
    */
2629 2631
   inline void gcode_M26() {
2630 2632
     if (card.cardOK && code_seen('S'))
2631
-      card.setIndex(code_value_long());
2633
+      card.setIndex(code_value_short());
2632 2634
   }
2633 2635
 
2634 2636
   /**
@@ -2719,7 +2721,7 @@ inline void gcode_M31() {
2719 2721
       card.openFile(namestartpos, true, !call_procedure);
2720 2722
 
2721 2723
       if (code_seen('S') && strchr_pointer < namestartpos) // "S" (must occur _before_ the filename!)
2722
-        card.setIndex(code_value_long());
2724
+        card.setIndex(code_value_short());
2723 2725
 
2724 2726
       card.startFileprint();
2725 2727
       if (!call_procedure)
@@ -2747,11 +2749,11 @@ inline void gcode_M31() {
2747 2749
  */
2748 2750
 inline void gcode_M42() {
2749 2751
   if (code_seen('S')) {
2750
-    int pin_status = code_value(),
2752
+    int pin_status = code_value_short(),
2751 2753
         pin_number = LED_PIN;
2752 2754
 
2753 2755
     if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
2754
-      pin_number = code_value();
2756
+      pin_number = code_value_short();
2755 2757
 
2756 2758
     for (int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins) / sizeof(*sensitive_pins)); i++) {
2757 2759
       if (sensitive_pins[i] == pin_number) {
@@ -2810,7 +2812,7 @@ inline void gcode_M42() {
2810 2812
     int verbose_level = 1, n_samples = 10, n_legs = 0;
2811 2813
     
2812 2814
     if (code_seen('V') || code_seen('v')) {
2813
-      verbose_level = code_value();
2815
+      verbose_level = code_value_short();
2814 2816
       if (verbose_level < 0 || verbose_level > 4 ) {
2815 2817
         SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n");
2816 2818
         return;
@@ -2821,7 +2823,7 @@ inline void gcode_M42() {
2821 2823
       SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
2822 2824
 
2823 2825
     if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`!
2824
-      n_samples = code_value();
2826
+      n_samples = code_value_short();
2825 2827
       if (n_samples < 4 || n_samples > 50) {
2826 2828
         SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
2827 2829
         return;
@@ -2854,7 +2856,7 @@ inline void gcode_M42() {
2854 2856
     }
2855 2857
 
2856 2858
     if (code_seen('L') || code_seen('l')) {
2857
-      n_legs = code_value();
2859
+      n_legs = code_value_short();
2858 2860
       if (n_legs == 1) n_legs = 2;
2859 2861
       if (n_legs < 0 || n_legs > 15) {
2860 2862
         SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n");
@@ -3036,12 +3038,15 @@ inline void gcode_M42() {
3036 3038
 inline void gcode_M104() {
3037 3039
   if (setTargetedHotend(104)) return;
3038 3040
 
3039
-  if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
3040
-  #ifdef DUAL_X_CARRIAGE
3041
-    if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
3042
-      setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
3043
-  #endif
3044
-  setWatch();
3041
+  if (code_seen('S')) {
3042
+    float temp = code_value();
3043
+    setTargetHotend(temp, target_extruder);
3044
+    #ifdef DUAL_X_CARRIAGE
3045
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
3046
+        setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
3047
+    #endif
3048
+    setWatch();
3049
+  }
3045 3050
 }
3046 3051
 
3047 3052
 /**
@@ -3054,9 +3059,9 @@ inline void gcode_M105() {
3054 3059
     SERIAL_PROTOCOLPGM("ok");
3055 3060
     #if HAS_TEMP_0
3056 3061
       SERIAL_PROTOCOLPGM(" T:");
3057
-      SERIAL_PROTOCOL_F(degHotend(tmp_extruder), 1);
3062
+      SERIAL_PROTOCOL_F(degHotend(target_extruder), 1);
3058 3063
       SERIAL_PROTOCOLPGM(" /");
3059
-      SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder), 1);
3064
+      SERIAL_PROTOCOL_F(degTargetHotend(target_extruder), 1);
3060 3065
     #endif
3061 3066
     #if HAS_TEMP_BED
3062 3067
       SERIAL_PROTOCOLPGM(" B:");
@@ -3067,7 +3072,7 @@ inline void gcode_M105() {
3067 3072
     for (int8_t e = 0; e < EXTRUDERS; ++e) {
3068 3073
       SERIAL_PROTOCOLPGM(" T");
3069 3074
       SERIAL_PROTOCOL(e);
3070
-      SERIAL_PROTOCOLPGM(":");
3075
+      SERIAL_PROTOCOLCHAR(':');
3071 3076
       SERIAL_PROTOCOL_F(degHotend(e), 1);
3072 3077
       SERIAL_PROTOCOLPGM(" /");
3073 3078
       SERIAL_PROTOCOL_F(degTargetHotend(e), 1);
@@ -3079,16 +3084,16 @@ inline void gcode_M105() {
3079 3084
 
3080 3085
   SERIAL_PROTOCOLPGM(" @:");
3081 3086
   #ifdef EXTRUDER_WATTS
3082
-    SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(tmp_extruder))/127);
3083
-    SERIAL_PROTOCOLPGM("W");
3087
+    SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder))/127);
3088
+    SERIAL_PROTOCOLCHAR('W');
3084 3089
   #else
3085
-    SERIAL_PROTOCOL(getHeaterPower(tmp_extruder));
3090
+    SERIAL_PROTOCOL(getHeaterPower(target_extruder));
3086 3091
   #endif
3087 3092
 
3088 3093
   SERIAL_PROTOCOLPGM(" B@:");
3089 3094
   #ifdef BED_WATTS
3090 3095
     SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127);
3091
-    SERIAL_PROTOCOLPGM("W");
3096
+    SERIAL_PROTOCOLCHAR('W');
3092 3097
   #else
3093 3098
     SERIAL_PROTOCOL(getHeaterPower(-1));
3094 3099
   #endif
@@ -3103,7 +3108,7 @@ inline void gcode_M105() {
3103 3108
     for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
3104 3109
       SERIAL_PROTOCOLPGM("  T");
3105 3110
       SERIAL_PROTOCOL(cur_extruder);
3106
-      SERIAL_PROTOCOLPGM(":");
3111
+      SERIAL_PROTOCOLCHAR(':');
3107 3112
       SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
3108 3113
       SERIAL_PROTOCOLPGM("C->");
3109 3114
       SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
@@ -3118,7 +3123,7 @@ inline void gcode_M105() {
3118 3123
   /**
3119 3124
    * M106: Set Fan Speed
3120 3125
    */
3121
-  inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value(), 0, 255) : 255; }
3126
+  inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value_short(), 0, 255) : 255; }
3122 3127
 
3123 3128
   /**
3124 3129
    * M107: Fan Off
@@ -3137,10 +3142,11 @@ inline void gcode_M109() {
3137 3142
 
3138 3143
   CooldownNoWait = code_seen('S');
3139 3144
   if (CooldownNoWait || code_seen('R')) {
3140
-    setTargetHotend(code_value(), tmp_extruder);
3145
+    float temp = code_value();
3146
+    setTargetHotend(temp, target_extruder);
3141 3147
     #ifdef DUAL_X_CARRIAGE
3142
-      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
3143
-        setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
3148
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
3149
+        setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
3144 3150
     #endif
3145 3151
   }
3146 3152
 
@@ -3156,7 +3162,7 @@ inline void gcode_M109() {
3156 3162
   unsigned long timetemp = millis();
3157 3163
 
3158 3164
   /* See if we are heating up or cooling down */
3159
-  target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
3165
+  target_direction = isHeatingHotend(target_extruder); // true if heating, false if cooling
3160 3166
 
3161 3167
   cancel_heatup = false;
3162 3168
 
@@ -3167,15 +3173,15 @@ inline void gcode_M109() {
3167 3173
     while((!cancel_heatup)&&((residencyStart == -1) ||
3168 3174
           (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) )
3169 3175
   #else
3170
-    while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) )
3176
+    while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(CooldownNoWait==false)) )
3171 3177
   #endif //TEMP_RESIDENCY_TIME
3172 3178
 
3173 3179
     { // while loop
3174 3180
       if (millis() > timetemp + 1000UL) { //Print temp & remaining time every 1s while waiting
3175 3181
         SERIAL_PROTOCOLPGM("T:");
3176
-        SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
3182
+        SERIAL_PROTOCOL_F(degHotend(target_extruder),1);
3177 3183
         SERIAL_PROTOCOLPGM(" E:");
3178
-        SERIAL_PROTOCOL((int)tmp_extruder);
3184
+        SERIAL_PROTOCOL((int)target_extruder);
3179 3185
         #ifdef TEMP_RESIDENCY_TIME
3180 3186
           SERIAL_PROTOCOLPGM(" W:");
3181 3187
           if (residencyStart > -1) {
@@ -3196,9 +3202,9 @@ inline void gcode_M109() {
3196 3202
       #ifdef TEMP_RESIDENCY_TIME
3197 3203
         // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
3198 3204
         // or when current temp falls outside the hysteresis after target temp was reached
3199
-        if ((residencyStart == -1 &&  target_direction && (degHotend(tmp_extruder) >= (degTargetHotend(tmp_extruder)-TEMP_WINDOW))) ||
3200
-            (residencyStart == -1 && !target_direction && (degHotend(tmp_extruder) <= (degTargetHotend(tmp_extruder)+TEMP_WINDOW))) ||
3201
-            (residencyStart > -1 && labs(degHotend(tmp_extruder) - degTargetHotend(tmp_extruder)) > TEMP_HYSTERESIS) )
3205
+        if ((residencyStart == -1 &&  target_direction && (degHotend(target_extruder) >= (degTargetHotend(target_extruder)-TEMP_WINDOW))) ||
3206
+            (residencyStart == -1 && !target_direction && (degHotend(target_extruder) <= (degTargetHotend(target_extruder)+TEMP_WINDOW))) ||
3207
+            (residencyStart > -1 && labs(degHotend(target_extruder) - degTargetHotend(target_extruder)) > TEMP_HYSTERESIS) )
3202 3208
         {
3203 3209
           residencyStart = millis();
3204 3210
         }
@@ -3535,9 +3541,9 @@ inline void gcode_M121() { enable_endstops(true); }
3535 3541
    */
3536 3542
   inline void gcode_M150() {
3537 3543
     SendColors(
3538
-      code_seen('R') ? (byte)code_value() : 0,
3539
-      code_seen('U') ? (byte)code_value() : 0,
3540
-      code_seen('B') ? (byte)code_value() : 0
3544
+      code_seen('R') ? (byte)code_value_short() : 0,
3545
+      code_seen('U') ? (byte)code_value_short() : 0,
3546
+      code_seen('B') ? (byte)code_value_short() : 0
3541 3547
     );
3542 3548
   }
3543 3549
 
@@ -3549,9 +3555,9 @@ inline void gcode_M121() { enable_endstops(true); }
3549 3555
  *       D<millimeters>
3550 3556
  */
3551 3557
 inline void gcode_M200() {
3552
-  tmp_extruder = active_extruder;
3558
+  int tmp_extruder = active_extruder;
3553 3559
   if (code_seen('T')) {
3554
-    tmp_extruder = code_value();
3560
+    tmp_extruder = code_value_short();
3555 3561
     if (tmp_extruder >= EXTRUDERS) {
3556 3562
       SERIAL_ECHO_START;
3557 3563
       SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER);
@@ -3622,27 +3628,23 @@ inline void gcode_M203() {
3622 3628
  *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
3623 3629
  */
3624 3630
 inline void gcode_M204() {
3625
-  if (code_seen('S'))   // Kept for legacy compatibility. Should NOT BE USED for new developments.
3626
-  {
3631
+  if (code_seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
3627 3632
     acceleration = code_value();
3628 3633
     travel_acceleration = acceleration;
3629
-    SERIAL_ECHOPAIR("Setting Printing and Travelling Acceleration: ", acceleration );
3634
+    SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", acceleration );
3630 3635
     SERIAL_EOL;
3631 3636
   }
3632
-  if (code_seen('P'))
3633
-  {
3637
+  if (code_seen('P')) {
3634 3638
     acceleration = code_value();
3635
-    SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration );
3639
+    SERIAL_ECHOPAIR("Setting Print Acceleration: ", acceleration );
3636 3640
     SERIAL_EOL;
3637 3641
   }
3638
-  if (code_seen('R'))
3639
-  {
3642
+  if (code_seen('R')) {
3640 3643
     retract_acceleration = code_value();
3641 3644
     SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration );
3642 3645
     SERIAL_EOL;
3643 3646
   }
3644
-  if (code_seen('T'))
3645
-  {
3647
+  if (code_seen('T')) {
3646 3648
     travel_acceleration = code_value();
3647 3649
     SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration );
3648 3650
     SERIAL_EOL;
@@ -3745,7 +3747,7 @@ inline void gcode_M206() {
3745 3747
    */
3746 3748
   inline void gcode_M209() {
3747 3749
     if (code_seen('S')) {
3748
-      int t = code_value();
3750
+      int t = code_value_short();
3749 3751
       switch(t) {
3750 3752
         case 0:
3751 3753
           autoretract_enabled = false;
@@ -3774,23 +3776,23 @@ inline void gcode_M206() {
3774 3776
   inline void gcode_M218() {
3775 3777
     if (setTargetedHotend(218)) return;
3776 3778
 
3777
-    if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value();
3778
-    if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value();
3779
+    if (code_seen('X')) extruder_offset[X_AXIS][target_extruder] = code_value();
3780
+    if (code_seen('Y')) extruder_offset[Y_AXIS][target_extruder] = code_value();
3779 3781
 
3780 3782
     #ifdef DUAL_X_CARRIAGE
3781
-      if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value();
3783
+      if (code_seen('Z')) extruder_offset[Z_AXIS][target_extruder] = code_value();
3782 3784
     #endif
3783 3785
 
3784 3786
     SERIAL_ECHO_START;
3785 3787
     SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
3786
-    for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) {
3787
-      SERIAL_ECHO(" ");
3788
-      SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]);
3789
-      SERIAL_ECHO(",");
3790
-      SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]);
3788
+    for (int e = 0; e < EXTRUDERS; e++) {
3789
+      SERIAL_CHAR(' ');
3790
+      SERIAL_ECHO(extruder_offset[X_AXIS][e]);
3791
+      SERIAL_CHAR(',');
3792
+      SERIAL_ECHO(extruder_offset[Y_AXIS][e]);
3791 3793
       #ifdef DUAL_X_CARRIAGE
3792
-        SERIAL_ECHO(",");
3793
-        SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
3794
+        SERIAL_CHAR(',');
3795
+        SERIAL_ECHO(extruder_offset[Z_AXIS][e]);
3794 3796
       #endif
3795 3797
     }
3796 3798
     SERIAL_EOL;
@@ -3813,7 +3815,7 @@ inline void gcode_M221() {
3813 3815
     int sval = code_value();
3814 3816
     if (code_seen('T')) {
3815 3817
       if (setTargetedHotend(221)) return;
3816
-      extruder_multiply[tmp_extruder] = sval;
3818
+      extruder_multiply[target_extruder] = sval;
3817 3819
     }
3818 3820
     else {
3819 3821
       extruder_multiply[active_extruder] = sval;
@@ -4044,7 +4046,7 @@ inline void gcode_M226() {
4044 4046
    * M250: Read and optionally set the LCD contrast
4045 4047
    */
4046 4048
   inline void gcode_M250() {
4047
-    if (code_seen('C')) lcd_setcontrast(code_value_long() & 0x3F);
4049
+    if (code_seen('C')) lcd_setcontrast(code_value_short() & 0x3F);
4048 4050
     SERIAL_PROTOCOLPGM("lcd contrast value: ");
4049 4051
     SERIAL_PROTOCOL(lcd_contrast);
4050 4052
     SERIAL_EOL;
@@ -4070,8 +4072,8 @@ inline void gcode_M226() {
4070 4072
  *       C<cycles>
4071 4073
  */
4072 4074
 inline void gcode_M303() {
4073
-  int e = code_seen('E') ? code_value_long() : 0;
4074
-  int c = code_seen('C') ? code_value_long() : 5;
4075
+  int e = code_seen('E') ? code_value_short() : 0;
4076
+  int c = code_seen('C') ? code_value_short() : 5;
4075 4077
   float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0);
4076 4078
   PID_autotune(temp, e, c);
4077 4079
 }
@@ -4480,13 +4482,13 @@ inline void gcode_M503() {
4480 4482
         if (code_seen('R')) duplicate_extruder_temp_offset = code_value();
4481 4483
         SERIAL_ECHO_START;
4482 4484
         SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
4483
-        SERIAL_ECHO(" ");
4485
+        SERIAL_CHAR(' ');
4484 4486
         SERIAL_ECHO(extruder_offset[X_AXIS][0]);
4485
-        SERIAL_ECHO(",");
4487
+        SERIAL_CHAR(',');
4486 4488
         SERIAL_ECHO(extruder_offset[Y_AXIS][0]);
4487
-        SERIAL_ECHO(" ");
4489
+        SERIAL_CHAR(' ');
4488 4490
         SERIAL_ECHO(duplicate_extruder_x_offset);
4489
-        SERIAL_ECHO(",");
4491
+        SERIAL_CHAR(',');
4490 4492
         SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]);
4491 4493
         break;
4492 4494
       case DXC_FULL_CONTROL_MODE:
@@ -4559,7 +4561,7 @@ inline void gcode_M907() {
4559 4561
    *       S# determines MS1 or MS2, X# sets the pin high/low.
4560 4562
    */
4561 4563
   inline void gcode_M351() {
4562
-    if (code_seen('S')) switch(code_value_long()) {
4564
+    if (code_seen('S')) switch(code_value_short()) {
4563 4565
       case 1:
4564 4566
         for(int i=0;i<NUM_AXIS;i++) if (code_seen(axis_codes[i])) microstep_ms(i, code_value(), -1);
4565 4567
         if (code_seen('B')) microstep_ms(4, code_value(), -1);
@@ -4585,21 +4587,26 @@ inline void gcode_M999() {
4585 4587
 }
4586 4588
 
4587 4589
 inline void gcode_T() {
4588
-  tmp_extruder = code_value();
4590
+  int tmp_extruder = code_value();
4589 4591
   if (tmp_extruder >= EXTRUDERS) {
4590 4592
     SERIAL_ECHO_START;
4591
-    SERIAL_ECHO("T");
4593
+    SERIAL_CHAR('T');
4592 4594
     SERIAL_ECHO(tmp_extruder);
4593 4595
     SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
4594 4596
   }
4595 4597
   else {
4598
+    target_extruder = tmp_extruder;
4599
+
4596 4600
     #if EXTRUDERS > 1
4597 4601
       bool make_move = false;
4598 4602
     #endif
4603
+
4599 4604
     if (code_seen('F')) {
4605
+
4600 4606
       #if EXTRUDERS > 1
4601 4607
         make_move = true;
4602 4608
       #endif
4609
+
4603 4610
       next_feedrate = code_value();
4604 4611
       if (next_feedrate > 0.0) feedrate = next_feedrate;
4605 4612
     }
@@ -4689,7 +4696,7 @@ inline void gcode_T() {
4689 4696
 void process_commands() {
4690 4697
   if (code_seen('G')) {
4691 4698
 
4692
-    int gCode = code_value_long();
4699
+    int gCode = code_value_short();
4693 4700
 
4694 4701
     switch(gCode) {
4695 4702
 
@@ -4764,7 +4771,7 @@ void process_commands() {
4764 4771
   }
4765 4772
 
4766 4773
   else if (code_seen('M')) {
4767
-    switch( code_value_long() ) {
4774
+    switch(code_value_short()) {
4768 4775
       #ifdef ULTIPANEL
4769 4776
         case 0: // M0 - Unconditional stop - Wait for user button press on LCD
4770 4777
         case 1: // M1 - Conditional stop - Wait for user button press on LCD
@@ -5929,10 +5936,10 @@ void setPwmFrequency(uint8_t pin, int val)
5929 5936
 #endif //FAST_PWM_FAN
5930 5937
 
5931 5938
 bool setTargetedHotend(int code){
5932
-  tmp_extruder = active_extruder;
5933
-  if(code_seen('T')) {
5934
-    tmp_extruder = code_value();
5935
-    if(tmp_extruder >= EXTRUDERS) {
5939
+  target_extruder = active_extruder;
5940
+  if (code_seen('T')) {
5941
+    target_extruder = code_value_short();
5942
+    if (target_extruder >= EXTRUDERS) {
5936 5943
       SERIAL_ECHO_START;
5937 5944
       switch(code){
5938 5945
         case 104:
@@ -5951,7 +5958,7 @@ bool setTargetedHotend(int code){
5951 5958
           SERIAL_ECHO(MSG_M221_INVALID_EXTRUDER);
5952 5959
           break;
5953 5960
       }
5954
-      SERIAL_ECHOLN(tmp_extruder);
5961
+      SERIAL_ECHOLN(target_extruder);
5955 5962
       return true;
5956 5963
     }
5957 5964
   }

+ 6
- 6
Marlin/cardreader.cpp View File

@@ -249,7 +249,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
249 249
         if (!myDir.open(curDir, subdirname, O_READ)) {
250 250
           SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
251 251
           SERIAL_PROTOCOL(subdirname);
252
-          SERIAL_PROTOCOLLNPGM(".");
252
+          SERIAL_PROTOCOLCHAR('.');
253 253
           return;
254 254
         }
255 255
         else {
@@ -287,14 +287,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
287 287
     else {
288 288
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
289 289
       SERIAL_PROTOCOL(fname);
290
-      SERIAL_PROTOCOLLNPGM(".");
290
+      SERIAL_PROTOCOLCHAR('.');
291 291
     }
292 292
   }
293 293
   else { //write
294 294
     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
295 295
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
296 296
       SERIAL_PROTOCOL(fname);
297
-      SERIAL_PROTOCOLLNPGM(".");
297
+      SERIAL_PROTOCOLCHAR('.');
298 298
     }
299 299
     else {
300 300
       saving = true;
@@ -330,7 +330,7 @@ void CardReader::removeFile(char* name) {
330 330
         if (!myDir.open(curDir, subdirname, O_READ)) {
331 331
           SERIAL_PROTOCOLPGM("open failed, File: ");
332 332
           SERIAL_PROTOCOL(subdirname);
333
-          SERIAL_PROTOCOLLNPGM(".");
333
+          SERIAL_PROTOCOLCHAR('.');
334 334
           return;
335 335
         }
336 336
         else {
@@ -360,7 +360,7 @@ void CardReader::removeFile(char* name) {
360 360
   else {
361 361
     SERIAL_PROTOCOLPGM("Deletion failed, File: ");
362 362
     SERIAL_PROTOCOL(fname);
363
-    SERIAL_PROTOCOLLNPGM(".");
363
+    SERIAL_PROTOCOLCHAR('.');
364 364
   }
365 365
 }
366 366
 
@@ -368,7 +368,7 @@ void CardReader::getStatus() {
368 368
   if (cardOK) {
369 369
     SERIAL_PROTOCOLPGM(MSG_SD_PRINTING_BYTE);
370 370
     SERIAL_PROTOCOL(sdpos);
371
-    SERIAL_PROTOCOLPGM("/");
371
+    SERIAL_PROTOCOLCHAR('/');
372 372
     SERIAL_PROTOCOLLN(filesize);
373 373
   }
374 374
   else {

+ 4
- 2
Marlin/configurator/config/Configuration.h View File

@@ -553,8 +553,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
553 553
 
554 554
 // @section movement
555 555
 
556
-//// MOVEMENT SETTINGS
557
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
556
+/**
557
+ * MOVEMENT SETTINGS
558
+ */
559
+
558 560
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
559 561
 
560 562
 // default settings

+ 4
- 2
Marlin/example_configurations/Felix/Configuration.h View File

@@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
499 499
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
500 500
 #endif
501 501
 
502
-//// MOVEMENT SETTINGS
503
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
502
+/**
503
+ * MOVEMENT SETTINGS
504
+ */
505
+
504 506
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
505 507
 
506 508
 // default settings

+ 4
- 2
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -499,8 +499,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
499 499
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
500 500
 #endif
501 501
 
502
-//// MOVEMENT SETTINGS
503
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
502
+/**
503
+ * MOVEMENT SETTINGS
504
+ */
505
+
504 506
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
505 507
 
506 508
 // default settings

+ 4
- 2
Marlin/example_configurations/Hephestos/Configuration.h View File

@@ -522,8 +522,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
522 522
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
523 523
 #endif
524 524
 
525
-//// MOVEMENT SETTINGS
526
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
525
+/**
526
+ * MOVEMENT SETTINGS
527
+ */
528
+
527 529
 #define HOMING_FEEDRATE {2000, 2000, 150, 0}  // set the homing speeds (mm/min)
528 530
 
529 531
 // default settings

+ 4
- 2
Marlin/example_configurations/K8200/Configuration.h View File

@@ -527,8 +527,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
527 527
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
528 528
 #endif
529 529
 
530
-//// MOVEMENT SETTINGS
531
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
530
+/**
531
+ * MOVEMENT SETTINGS
532
+ */
533
+
532 534
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
533 535
 
534 536
 // default settings

+ 4
- 2
Marlin/example_configurations/SCARA/Configuration.h View File

@@ -551,8 +551,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
551 551
   #define MANUAL_Z_HOME_POS 0.1  // Distance between nozzle and print surface after homing.
552 552
 #endif
553 553
 
554
-//// MOVEMENT SETTINGS
555
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
554
+/**
555
+ * MOVEMENT SETTINGS
556
+ */
557
+
556 558
 #define HOMING_FEEDRATE {40*60, 40*60, 10*60, 0}  // set the homing speeds (mm/min)
557 559
 
558 560
 // default settings

+ 4
- 2
Marlin/example_configurations/WITBOX/Configuration.h View File

@@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
521 521
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
522 522
 #endif
523 523
 
524
-//// MOVEMENT SETTINGS
525
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
524
+/**
525
+ * MOVEMENT SETTINGS
526
+ */
527
+
526 528
 #define HOMING_FEEDRATE {120*60, 120*60, 7.2*60, 0}  // set the homing speeds (mm/min)
527 529
 
528 530
 // default settings

+ 4
- 2
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -566,8 +566,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
566 566
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
567 567
 #endif
568 568
 
569
-//// MOVEMENT SETTINGS
570
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
569
+/**
570
+ * MOVEMENT SETTINGS
571
+ */
572
+
571 573
 
572 574
 // delta homing speeds must be the same on xyz
573 575
 #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0}  // set the homing speeds (mm/min)

+ 4
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -570,8 +570,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
570 570
   #define MANUAL_Z_HOME_POS 250 // For delta: Distance between nozzle and print surface after homing.
571 571
 #endif
572 572
 
573
-//// MOVEMENT SETTINGS
574
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
573
+/**
574
+ * MOVEMENT SETTINGS
575
+ */
576
+
575 577
 
576 578
 // delta homing speeds must be the same on xyz
577 579
 #define HOMING_FEEDRATE {200*60, 200*60, 200*60, 0}  // set the homing speeds (mm/min)

+ 4
- 2
Marlin/example_configurations/makibox/Configuration.h View File

@@ -519,8 +519,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
519 519
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
520 520
 #endif
521 521
 
522
-//// MOVEMENT SETTINGS
523
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
522
+/**
523
+ * MOVEMENT SETTINGS
524
+ */
525
+
524 526
 #define HOMING_FEEDRATE {1500, 1500, 120, 0}  // set the homing speeds (mm/min)   ***** MakiBox A6 *****
525 527
 
526 528
 // default settings

+ 4
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h View File

@@ -521,8 +521,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
521 521
   //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
522 522
 #endif
523 523
 
524
-//// MOVEMENT SETTINGS
525
-#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
524
+/**
525
+ * MOVEMENT SETTINGS
526
+ */
527
+
526 528
 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
527 529
 
528 530
 // default settings

+ 1
- 1
Marlin/planner.cpp View File

@@ -67,7 +67,7 @@
67 67
 //===========================================================================
68 68
 
69 69
 unsigned long minsegmenttime;
70
-float max_feedrate[NUM_AXIS]; // set the max speeds
70
+float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
71 71
 float axis_steps_per_unit[NUM_AXIS];
72 72
 unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
73 73
 float minimumfeedrate;

+ 1
- 1
Marlin/temperature.cpp View File

@@ -84,7 +84,7 @@ unsigned char soft_pwm_bed;
84 84
     static unsigned long thermal_runaway_timer[4]; // = {0,0,0,0};
85 85
   #endif
86 86
   #if HAS_BED_THERMAL_PROTECTION
87
-    static TRState thermal_runaway_bed_state_machine = { TRInactive, TRInactive, TRInactive, TRInactive };
87
+    static TRState thermal_runaway_bed_state_machine = TRInactive;
88 88
     static unsigned long thermal_runaway_bed_timer;
89 89
   #endif
90 90
 #endif

+ 2
- 2
Marlin/vector_3.cpp View File

@@ -125,9 +125,9 @@ void matrix_3x3::debug(const char title[]) {
125 125
   int count = 0;
126 126
   for(int i=0; i<3; i++) {
127 127
     for(int j=0; j<3; j++) {
128
-      if (matrix[count] >= 0.0) SERIAL_PROTOCOLPGM("+");
128
+      if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+');
129 129
       SERIAL_PROTOCOL_F(matrix[count], 6);
130
-      SERIAL_PROTOCOLPGM(" ");
130
+      SERIAL_PROTOCOLCHAR(' ');
131 131
       count++;
132 132
     }
133 133
     SERIAL_EOL;

Loading…
Cancel
Save