Browse Source

Add code_value_short and SERIAL_CHAR

Scott Lahteine 10 years ago
parent
commit
1e5c18bb14
5 changed files with 122 additions and 114 deletions
  1. 12
    10
      Marlin/Marlin.h
  2. 1
    2
      Marlin/MarlinSerial.cpp
  3. 101
    94
      Marlin/Marlin_main.cpp
  4. 6
    6
      Marlin/cardreader.cpp
  5. 2
    2
      Marlin/vector_3.cpp

+ 12
- 10
Marlin/Marlin.h View File

62
   #define MYSERIAL MSerial
62
   #define MYSERIAL MSerial
63
 #endif
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
 extern const char errormagic[] PROGMEM;
76
 extern const char errormagic[] PROGMEM;
73
 extern const char echomagic[] PROGMEM;
77
 extern const char echomagic[] PROGMEM;
74
 
78
 
75
-#define SERIAL_ERROR_START (serialprintPGM(errormagic))
79
+#define SERIAL_ERROR_START serialprintPGM(errormagic)
76
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
80
 #define SERIAL_ERROR(x) SERIAL_PROTOCOL(x)
77
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
81
 #define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x)
78
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
82
 #define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x)
79
 #define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
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
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
86
 #define SERIAL_ECHO(x) SERIAL_PROTOCOL(x)
83
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
87
 #define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x)
84
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
88
 #define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x)
85
 #define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x)
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
 void serial_echopair_P(const char *s_P, float v);
93
 void serial_echopair_P(const char *s_P, float v);
92
 void serial_echopair_P(const char *s_P, double v);
94
 void serial_echopair_P(const char *s_P, double v);

+ 1
- 2
Marlin/MarlinSerial.cpp View File

268
   print(int_part);
268
   print(int_part);
269
 
269
 
270
   // Print the decimal point, but only if there are digits beyond
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
   // Extract digits from the remainder one at a time
273
   // Extract digits from the remainder one at a time
275
   while (digits-- > 0) {
274
   while (digits-- > 0) {

+ 101
- 94
Marlin/Marlin_main.cpp View File

242
 static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l;
242
 static unsigned long stepper_inactive_time = DEFAULT_STEPPER_DEACTIVE_TIME*1000l;
243
 unsigned long starttime = 0; ///< Print job start time
243
 unsigned long starttime = 0; ///< Print job start time
244
 unsigned long stoptime = 0;  ///< Print job stop time
244
 unsigned long stoptime = 0;  ///< Print job stop time
245
-static uint8_t tmp_extruder;
245
+static uint8_t target_extruder;
246
 bool Stopped = false;
246
 bool Stopped = false;
247
 bool CooldownNoWait = true;
247
 bool CooldownNoWait = true;
248
 bool target_direction;
248
 bool target_direction;
856
   return ret;
856
   return ret;
857
 }
857
 }
858
 
858
 
859
-long code_value_long() { return (strtol(strchr_pointer + 1, NULL, 10)); }
859
+long code_value_long() { return strtol(strchr_pointer + 1, NULL, 10); }
860
+
861
+int16_t code_value_short() { return (int16_t)strtol(strchr_pointer + 1, NULL, 10); }
860
 
862
 
861
 bool code_seen(char code) {
863
 bool code_seen(char code) {
862
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
864
   strchr_pointer = strchr(cmdbuffer[bufindr], code);
1409
       for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
1411
       for (int y = 0; y < AUTO_BED_LEVELING_GRID_POINTS; y++) {
1410
         for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
1412
         for (int x = 0; x < AUTO_BED_LEVELING_GRID_POINTS; x++) {
1411
           SERIAL_PROTOCOL_F(bed_level[x][y], 2);
1413
           SERIAL_PROTOCOL_F(bed_level[x][y], 2);
1412
-          SERIAL_PROTOCOLPGM(" ");
1414
+          SERIAL_PROTOCOLCHAR(' ');
1413
         }
1415
         }
1414
-        SERIAL_ECHOLN("");
1416
+        SERIAL_EOL;
1415
       }
1417
       }
1416
     }
1418
     }
1417
 
1419
 
1684
  * G4: Dwell S<seconds> or P<milliseconds>
1686
  * G4: Dwell S<seconds> or P<milliseconds>
1685
  */
1687
  */
1686
 inline void gcode_G4() {
1688
 inline void gcode_G4() {
1687
-  unsigned long codenum=0;
1689
+  unsigned long codenum = 0;
1688
 
1690
 
1689
   LCD_MESSAGEPGM(MSG_DWELL);
1691
   LCD_MESSAGEPGM(MSG_DWELL);
1690
 
1692
 
1710
   inline void gcode_G10_G11(bool doRetract=false) {
1712
   inline void gcode_G10_G11(bool doRetract=false) {
1711
     #if EXTRUDERS > 1
1713
     #if EXTRUDERS > 1
1712
       if (doRetract) {
1714
       if (doRetract) {
1713
-        retracted_swap[active_extruder] = (code_seen('S') && code_value_long() == 1); // checks for swap retract argument
1715
+        retracted_swap[active_extruder] = (code_seen('S') && code_value_short() == 1); // checks for swap retract argument
1714
       }
1716
       }
1715
     #endif
1717
     #endif
1716
     retract(doRetract
1718
     retract(doRetract
2028
   inline void gcode_G29() {
2030
   inline void gcode_G29() {
2029
 
2031
 
2030
     static int probe_point = -1;
2032
     static int probe_point = -1;
2031
-    MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_long() : MeshReport;
2033
+    MeshLevelingState state = code_seen('S') || code_seen('s') ? (MeshLevelingState)code_value_short() : MeshReport;
2032
     if (state < 0 || state > 2) {
2034
     if (state < 0 || state > 2) {
2033
       SERIAL_PROTOCOLLNPGM("S out of range (0-2).");
2035
       SERIAL_PROTOCOLLNPGM("S out of range (0-2).");
2034
       return;
2036
       return;
2039
         if (mbl.active) {
2041
         if (mbl.active) {
2040
           SERIAL_PROTOCOLPGM("Num X,Y: ");
2042
           SERIAL_PROTOCOLPGM("Num X,Y: ");
2041
           SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
2043
           SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
2042
-          SERIAL_PROTOCOLPGM(",");
2044
+          SERIAL_PROTOCOLCHAR(',');
2043
           SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
2045
           SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
2044
           SERIAL_PROTOCOLPGM("\nZ search height: ");
2046
           SERIAL_PROTOCOLPGM("\nZ search height: ");
2045
           SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z);
2047
           SERIAL_PROTOCOL(MESH_HOME_SEARCH_Z);
2155
       return;
2157
       return;
2156
     }
2158
     }
2157
 
2159
 
2158
-    int verbose_level = code_seen('V') || code_seen('v') ? code_value_long() : 1;
2160
+    int verbose_level = code_seen('V') || code_seen('v') ? code_value_short() : 1;
2159
     if (verbose_level < 0 || verbose_level > 4) {
2161
     if (verbose_level < 0 || verbose_level > 4) {
2160
       SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4).");
2162
       SERIAL_ECHOLNPGM("?(V)erbose Level is implausible (0-4).");
2161
       return;
2163
       return;
2177
 
2179
 
2178
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
2180
       int auto_bed_leveling_grid_points = AUTO_BED_LEVELING_GRID_POINTS;
2179
       #ifndef DELTA
2181
       #ifndef DELTA
2180
-        if (code_seen('P')) auto_bed_leveling_grid_points = code_value_long();
2182
+        if (code_seen('P')) auto_bed_leveling_grid_points = code_value_short();
2181
         if (auto_bed_leveling_grid_points < 2) {
2183
         if (auto_bed_leveling_grid_points < 2) {
2182
           SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
2184
           SERIAL_PROTOCOLPGM("?Number of probed (P)oints is implausible (2 minimum).\n");
2183
           return;
2185
           return;
2184
         }
2186
         }
2185
       #endif
2187
       #endif
2186
 
2188
 
2187
-      xy_travel_speed = code_seen('S') ? code_value_long() : XY_TRAVEL_SPEED;
2189
+      xy_travel_speed = code_seen('S') ? code_value_short() : XY_TRAVEL_SPEED;
2188
 
2190
 
2189
-      int left_probe_bed_position = code_seen('L') ? code_value_long() : LEFT_PROBE_BED_POSITION,
2190
-          right_probe_bed_position = code_seen('R') ? code_value_long() : RIGHT_PROBE_BED_POSITION,
2191
-          front_probe_bed_position = code_seen('F') ? code_value_long() : FRONT_PROBE_BED_POSITION,
2192
-          back_probe_bed_position = code_seen('B') ? code_value_long() : BACK_PROBE_BED_POSITION;
2191
+      int left_probe_bed_position = code_seen('L') ? code_value_short() : LEFT_PROBE_BED_POSITION,
2192
+          right_probe_bed_position = code_seen('R') ? code_value_short() : RIGHT_PROBE_BED_POSITION,
2193
+          front_probe_bed_position = code_seen('F') ? code_value_short() : FRONT_PROBE_BED_POSITION,
2194
+          back_probe_bed_position = code_seen('B') ? code_value_short() : BACK_PROBE_BED_POSITION;
2193
 
2195
 
2194
       bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
2196
       bool left_out_l = left_probe_bed_position < MIN_PROBE_X,
2195
            left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE,
2197
            left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - MIN_PROBE_EDGE,
2393
               if (diff >= 0.0)
2395
               if (diff >= 0.0)
2394
                 SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2396
                 SERIAL_PROTOCOLPGM(" +");   // Include + for column alignment
2395
               else
2397
               else
2396
-                SERIAL_PROTOCOLPGM(" ");
2398
+                SERIAL_PROTOCOLCHAR(' ');
2397
               SERIAL_PROTOCOL_F(diff, 5);
2399
               SERIAL_PROTOCOL_F(diff, 5);
2398
             } // xx
2400
             } // xx
2399
             SERIAL_EOL;
2401
             SERIAL_EOL;
2517
     unsigned long codenum = 0;
2519
     unsigned long codenum = 0;
2518
     bool hasP = false, hasS = false;
2520
     bool hasP = false, hasS = false;
2519
     if (code_seen('P')) {
2521
     if (code_seen('P')) {
2520
-      codenum = code_value(); // milliseconds to wait
2522
+      codenum = code_value_short(); // milliseconds to wait
2521
       hasP = codenum > 0;
2523
       hasP = codenum > 0;
2522
     }
2524
     }
2523
     if (code_seen('S')) {
2525
     if (code_seen('S')) {
2524
-      codenum = code_value() * 1000; // seconds to wait
2526
+      codenum = code_value_short() * 1000UL; // seconds to wait
2525
       hasS = codenum > 0;
2527
       hasS = codenum > 0;
2526
     }
2528
     }
2527
     char* starpos = strchr(src, '*');
2529
     char* starpos = strchr(src, '*');
2633
    */
2635
    */
2634
   inline void gcode_M26() {
2636
   inline void gcode_M26() {
2635
     if (card.cardOK && code_seen('S'))
2637
     if (card.cardOK && code_seen('S'))
2636
-      card.setIndex(code_value_long());
2638
+      card.setIndex(code_value_short());
2637
   }
2639
   }
2638
 
2640
 
2639
   /**
2641
   /**
2724
       card.openFile(namestartpos, true, !call_procedure);
2726
       card.openFile(namestartpos, true, !call_procedure);
2725
 
2727
 
2726
       if (code_seen('S') && strchr_pointer < namestartpos) // "S" (must occur _before_ the filename!)
2728
       if (code_seen('S') && strchr_pointer < namestartpos) // "S" (must occur _before_ the filename!)
2727
-        card.setIndex(code_value_long());
2729
+        card.setIndex(code_value_short());
2728
 
2730
 
2729
       card.startFileprint();
2731
       card.startFileprint();
2730
       if (!call_procedure)
2732
       if (!call_procedure)
2752
  */
2754
  */
2753
 inline void gcode_M42() {
2755
 inline void gcode_M42() {
2754
   if (code_seen('S')) {
2756
   if (code_seen('S')) {
2755
-    int pin_status = code_value(),
2757
+    int pin_status = code_value_short(),
2756
         pin_number = LED_PIN;
2758
         pin_number = LED_PIN;
2757
 
2759
 
2758
     if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
2760
     if (code_seen('P') && pin_status >= 0 && pin_status <= 255)
2759
-      pin_number = code_value();
2761
+      pin_number = code_value_short();
2760
 
2762
 
2761
     for (int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins) / sizeof(*sensitive_pins)); i++) {
2763
     for (int8_t i = 0; i < (int8_t)(sizeof(sensitive_pins) / sizeof(*sensitive_pins)); i++) {
2762
       if (sensitive_pins[i] == pin_number) {
2764
       if (sensitive_pins[i] == pin_number) {
2815
     int verbose_level = 1, n_samples = 10, n_legs = 0;
2817
     int verbose_level = 1, n_samples = 10, n_legs = 0;
2816
     
2818
     
2817
     if (code_seen('V') || code_seen('v')) {
2819
     if (code_seen('V') || code_seen('v')) {
2818
-      verbose_level = code_value();
2820
+      verbose_level = code_value_short();
2819
       if (verbose_level < 0 || verbose_level > 4 ) {
2821
       if (verbose_level < 0 || verbose_level > 4 ) {
2820
         SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n");
2822
         SERIAL_PROTOCOLPGM("?Verbose Level not plausible (0-4).\n");
2821
         return;
2823
         return;
2826
       SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
2828
       SERIAL_PROTOCOLPGM("M48 Z-Probe Repeatability test\n");
2827
 
2829
 
2828
     if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`!
2830
     if (code_seen('P') || code_seen('p') || code_seen('n')) { // `n` for legacy support only - please use `P`!
2829
-      n_samples = code_value();
2831
+      n_samples = code_value_short();
2830
       if (n_samples < 4 || n_samples > 50) {
2832
       if (n_samples < 4 || n_samples > 50) {
2831
         SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
2833
         SERIAL_PROTOCOLPGM("?Sample size not plausible (4-50).\n");
2832
         return;
2834
         return;
2859
     }
2861
     }
2860
 
2862
 
2861
     if (code_seen('L') || code_seen('l')) {
2863
     if (code_seen('L') || code_seen('l')) {
2862
-      n_legs = code_value();
2864
+      n_legs = code_value_short();
2863
       if (n_legs == 1) n_legs = 2;
2865
       if (n_legs == 1) n_legs = 2;
2864
       if (n_legs < 0 || n_legs > 15) {
2866
       if (n_legs < 0 || n_legs > 15) {
2865
         SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n");
2867
         SERIAL_PROTOCOLPGM("?Number of legs in movement not plausible (0-15).\n");
3041
 inline void gcode_M104() {
3043
 inline void gcode_M104() {
3042
   if (setTargetedHotend(104)) return;
3044
   if (setTargetedHotend(104)) return;
3043
 
3045
 
3044
-  if (code_seen('S')) setTargetHotend(code_value(), tmp_extruder);
3045
-  #ifdef DUAL_X_CARRIAGE
3046
-    if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
3047
-      setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
3048
-  #endif
3049
-  setWatch();
3046
+  if (code_seen('S')) {
3047
+    float temp = code_value();
3048
+    setTargetHotend(temp, target_extruder);
3049
+    #ifdef DUAL_X_CARRIAGE
3050
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
3051
+        setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
3052
+    #endif
3053
+    setWatch();
3054
+  }
3050
 }
3055
 }
3051
 
3056
 
3052
 /**
3057
 /**
3057
 
3062
 
3058
   #if HAS_TEMP_0
3063
   #if HAS_TEMP_0
3059
     SERIAL_PROTOCOLPGM("ok T:");
3064
     SERIAL_PROTOCOLPGM("ok T:");
3060
-    SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
3065
+    SERIAL_PROTOCOL_F(degHotend(target_extruder),1);
3061
     SERIAL_PROTOCOLPGM(" /");
3066
     SERIAL_PROTOCOLPGM(" /");
3062
-    SERIAL_PROTOCOL_F(degTargetHotend(tmp_extruder),1);
3067
+    SERIAL_PROTOCOL_F(degTargetHotend(target_extruder),1);
3063
     #if HAS_TEMP_BED
3068
     #if HAS_TEMP_BED
3064
       SERIAL_PROTOCOLPGM(" B:");
3069
       SERIAL_PROTOCOLPGM(" B:");
3065
       SERIAL_PROTOCOL_F(degBed(),1);
3070
       SERIAL_PROTOCOL_F(degBed(),1);
3069
     for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
3074
     for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
3070
       SERIAL_PROTOCOLPGM(" T");
3075
       SERIAL_PROTOCOLPGM(" T");
3071
       SERIAL_PROTOCOL(cur_extruder);
3076
       SERIAL_PROTOCOL(cur_extruder);
3072
-      SERIAL_PROTOCOLPGM(":");
3077
+      SERIAL_PROTOCOLCHAR(':');
3073
       SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
3078
       SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
3074
       SERIAL_PROTOCOLPGM(" /");
3079
       SERIAL_PROTOCOLPGM(" /");
3075
       SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1);
3080
       SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1);
3081
 
3086
 
3082
   SERIAL_PROTOCOLPGM(" @:");
3087
   SERIAL_PROTOCOLPGM(" @:");
3083
   #ifdef EXTRUDER_WATTS
3088
   #ifdef EXTRUDER_WATTS
3084
-    SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(tmp_extruder))/127);
3085
-    SERIAL_PROTOCOLPGM("W");
3089
+    SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(target_extruder))/127);
3090
+    SERIAL_PROTOCOLCHAR('W');
3086
   #else
3091
   #else
3087
-    SERIAL_PROTOCOL(getHeaterPower(tmp_extruder));
3092
+    SERIAL_PROTOCOL(getHeaterPower(target_extruder));
3088
   #endif
3093
   #endif
3089
 
3094
 
3090
   SERIAL_PROTOCOLPGM(" B@:");
3095
   SERIAL_PROTOCOLPGM(" B@:");
3091
   #ifdef BED_WATTS
3096
   #ifdef BED_WATTS
3092
     SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127);
3097
     SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127);
3093
-    SERIAL_PROTOCOLPGM("W");
3098
+    SERIAL_PROTOCOLCHAR('W');
3094
   #else
3099
   #else
3095
     SERIAL_PROTOCOL(getHeaterPower(-1));
3100
     SERIAL_PROTOCOL(getHeaterPower(-1));
3096
   #endif
3101
   #endif
3105
     for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
3110
     for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
3106
       SERIAL_PROTOCOLPGM("  T");
3111
       SERIAL_PROTOCOLPGM("  T");
3107
       SERIAL_PROTOCOL(cur_extruder);
3112
       SERIAL_PROTOCOL(cur_extruder);
3108
-      SERIAL_PROTOCOLPGM(":");
3113
+      SERIAL_PROTOCOLCHAR(':');
3109
       SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
3114
       SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
3110
       SERIAL_PROTOCOLPGM("C->");
3115
       SERIAL_PROTOCOLPGM("C->");
3111
       SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
3116
       SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
3120
   /**
3125
   /**
3121
    * M106: Set Fan Speed
3126
    * M106: Set Fan Speed
3122
    */
3127
    */
3123
-  inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value(), 0, 255) : 255; }
3128
+  inline void gcode_M106() { fanSpeed = code_seen('S') ? constrain(code_value_short(), 0, 255) : 255; }
3124
 
3129
 
3125
   /**
3130
   /**
3126
    * M107: Fan Off
3131
    * M107: Fan Off
3139
 
3144
 
3140
   CooldownNoWait = code_seen('S');
3145
   CooldownNoWait = code_seen('S');
3141
   if (CooldownNoWait || code_seen('R')) {
3146
   if (CooldownNoWait || code_seen('R')) {
3142
-    setTargetHotend(code_value(), tmp_extruder);
3147
+    float temp = code_value();
3148
+    setTargetHotend(temp, target_extruder);
3143
     #ifdef DUAL_X_CARRIAGE
3149
     #ifdef DUAL_X_CARRIAGE
3144
-      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && tmp_extruder == 0)
3145
-        setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
3150
+      if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
3151
+        setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
3146
     #endif
3152
     #endif
3147
   }
3153
   }
3148
 
3154
 
3158
   unsigned long timetemp = millis();
3164
   unsigned long timetemp = millis();
3159
 
3165
 
3160
   /* See if we are heating up or cooling down */
3166
   /* See if we are heating up or cooling down */
3161
-  target_direction = isHeatingHotend(tmp_extruder); // true if heating, false if cooling
3167
+  target_direction = isHeatingHotend(target_extruder); // true if heating, false if cooling
3162
 
3168
 
3163
   cancel_heatup = false;
3169
   cancel_heatup = false;
3164
 
3170
 
3169
     while((!cancel_heatup)&&((residencyStart == -1) ||
3175
     while((!cancel_heatup)&&((residencyStart == -1) ||
3170
           (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) )
3176
           (residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL)))) )
3171
   #else
3177
   #else
3172
-    while ( target_direction ? (isHeatingHotend(tmp_extruder)) : (isCoolingHotend(tmp_extruder)&&(CooldownNoWait==false)) )
3178
+    while ( target_direction ? (isHeatingHotend(target_extruder)) : (isCoolingHotend(target_extruder)&&(CooldownNoWait==false)) )
3173
   #endif //TEMP_RESIDENCY_TIME
3179
   #endif //TEMP_RESIDENCY_TIME
3174
 
3180
 
3175
     { // while loop
3181
     { // while loop
3176
       if (millis() > timetemp + 1000UL) { //Print temp & remaining time every 1s while waiting
3182
       if (millis() > timetemp + 1000UL) { //Print temp & remaining time every 1s while waiting
3177
         SERIAL_PROTOCOLPGM("T:");
3183
         SERIAL_PROTOCOLPGM("T:");
3178
-        SERIAL_PROTOCOL_F(degHotend(tmp_extruder),1);
3184
+        SERIAL_PROTOCOL_F(degHotend(target_extruder),1);
3179
         SERIAL_PROTOCOLPGM(" E:");
3185
         SERIAL_PROTOCOLPGM(" E:");
3180
-        SERIAL_PROTOCOL((int)tmp_extruder);
3186
+        SERIAL_PROTOCOL((int)target_extruder);
3181
         #ifdef TEMP_RESIDENCY_TIME
3187
         #ifdef TEMP_RESIDENCY_TIME
3182
           SERIAL_PROTOCOLPGM(" W:");
3188
           SERIAL_PROTOCOLPGM(" W:");
3183
           if (residencyStart > -1) {
3189
           if (residencyStart > -1) {
3198
       #ifdef TEMP_RESIDENCY_TIME
3204
       #ifdef TEMP_RESIDENCY_TIME
3199
         // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
3205
         // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
3200
         // or when current temp falls outside the hysteresis after target temp was reached
3206
         // or when current temp falls outside the hysteresis after target temp was reached
3201
-        if ((residencyStart == -1 &&  target_direction && (degHotend(tmp_extruder) >= (degTargetHotend(tmp_extruder)-TEMP_WINDOW))) ||
3202
-            (residencyStart == -1 && !target_direction && (degHotend(tmp_extruder) <= (degTargetHotend(tmp_extruder)+TEMP_WINDOW))) ||
3203
-            (residencyStart > -1 && labs(degHotend(tmp_extruder) - degTargetHotend(tmp_extruder)) > TEMP_HYSTERESIS) )
3207
+        if ((residencyStart == -1 &&  target_direction && (degHotend(target_extruder) >= (degTargetHotend(target_extruder)-TEMP_WINDOW))) ||
3208
+            (residencyStart == -1 && !target_direction && (degHotend(target_extruder) <= (degTargetHotend(target_extruder)+TEMP_WINDOW))) ||
3209
+            (residencyStart > -1 && labs(degHotend(target_extruder) - degTargetHotend(target_extruder)) > TEMP_HYSTERESIS) )
3204
         {
3210
         {
3205
           residencyStart = millis();
3211
           residencyStart = millis();
3206
         }
3212
         }
3538
    */
3544
    */
3539
   inline void gcode_M150() {
3545
   inline void gcode_M150() {
3540
     SendColors(
3546
     SendColors(
3541
-      code_seen('R') ? (byte)code_value() : 0,
3542
-      code_seen('U') ? (byte)code_value() : 0,
3543
-      code_seen('B') ? (byte)code_value() : 0
3547
+      code_seen('R') ? (byte)code_value_short() : 0,
3548
+      code_seen('U') ? (byte)code_value_short() : 0,
3549
+      code_seen('B') ? (byte)code_value_short() : 0
3544
     );
3550
     );
3545
   }
3551
   }
3546
 
3552
 
3552
  *       D<millimeters>
3558
  *       D<millimeters>
3553
  */
3559
  */
3554
 inline void gcode_M200() {
3560
 inline void gcode_M200() {
3555
-  tmp_extruder = active_extruder;
3561
+  int tmp_extruder = active_extruder;
3556
   if (code_seen('T')) {
3562
   if (code_seen('T')) {
3557
-    tmp_extruder = code_value();
3563
+    tmp_extruder = code_value_short();
3558
     if (tmp_extruder >= EXTRUDERS) {
3564
     if (tmp_extruder >= EXTRUDERS) {
3559
       SERIAL_ECHO_START;
3565
       SERIAL_ECHO_START;
3560
       SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER);
3566
       SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER);
3625
  *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
3631
  *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
3626
  */
3632
  */
3627
 inline void gcode_M204() {
3633
 inline void gcode_M204() {
3628
-  if (code_seen('S'))   // Kept for legacy compatibility. Should NOT BE USED for new developments.
3629
-  {
3634
+  if (code_seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
3630
     acceleration = code_value();
3635
     acceleration = code_value();
3631
     travel_acceleration = acceleration;
3636
     travel_acceleration = acceleration;
3632
-    SERIAL_ECHOPAIR("Setting Printing and Travelling Acceleration: ", acceleration );
3637
+    SERIAL_ECHOPAIR("Setting Print and Travel Acceleration: ", acceleration );
3633
     SERIAL_EOL;
3638
     SERIAL_EOL;
3634
   }
3639
   }
3635
-  if (code_seen('P'))
3636
-  {
3640
+  if (code_seen('P')) {
3637
     acceleration = code_value();
3641
     acceleration = code_value();
3638
-    SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration );
3642
+    SERIAL_ECHOPAIR("Setting Print Acceleration: ", acceleration );
3639
     SERIAL_EOL;
3643
     SERIAL_EOL;
3640
   }
3644
   }
3641
-  if (code_seen('R'))
3642
-  {
3645
+  if (code_seen('R')) {
3643
     retract_acceleration = code_value();
3646
     retract_acceleration = code_value();
3644
     SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration );
3647
     SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration );
3645
     SERIAL_EOL;
3648
     SERIAL_EOL;
3646
   }
3649
   }
3647
-  if (code_seen('T'))
3648
-  {
3650
+  if (code_seen('T')) {
3649
     travel_acceleration = code_value();
3651
     travel_acceleration = code_value();
3650
     SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration );
3652
     SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration );
3651
     SERIAL_EOL;
3653
     SERIAL_EOL;
3748
    */
3750
    */
3749
   inline void gcode_M209() {
3751
   inline void gcode_M209() {
3750
     if (code_seen('S')) {
3752
     if (code_seen('S')) {
3751
-      int t = code_value();
3753
+      int t = code_value_short();
3752
       switch(t) {
3754
       switch(t) {
3753
         case 0:
3755
         case 0:
3754
           autoretract_enabled = false;
3756
           autoretract_enabled = false;
3777
   inline void gcode_M218() {
3779
   inline void gcode_M218() {
3778
     if (setTargetedHotend(218)) return;
3780
     if (setTargetedHotend(218)) return;
3779
 
3781
 
3780
-    if (code_seen('X')) extruder_offset[X_AXIS][tmp_extruder] = code_value();
3781
-    if (code_seen('Y')) extruder_offset[Y_AXIS][tmp_extruder] = code_value();
3782
+    if (code_seen('X')) extruder_offset[X_AXIS][target_extruder] = code_value();
3783
+    if (code_seen('Y')) extruder_offset[Y_AXIS][target_extruder] = code_value();
3782
 
3784
 
3783
     #ifdef DUAL_X_CARRIAGE
3785
     #ifdef DUAL_X_CARRIAGE
3784
-      if (code_seen('Z')) extruder_offset[Z_AXIS][tmp_extruder] = code_value();
3786
+      if (code_seen('Z')) extruder_offset[Z_AXIS][target_extruder] = code_value();
3785
     #endif
3787
     #endif
3786
 
3788
 
3787
     SERIAL_ECHO_START;
3789
     SERIAL_ECHO_START;
3788
     SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
3790
     SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
3789
-    for (tmp_extruder = 0; tmp_extruder < EXTRUDERS; tmp_extruder++) {
3790
-      SERIAL_ECHO(" ");
3791
-      SERIAL_ECHO(extruder_offset[X_AXIS][tmp_extruder]);
3792
-      SERIAL_ECHO(",");
3793
-      SERIAL_ECHO(extruder_offset[Y_AXIS][tmp_extruder]);
3791
+    for (int e = 0; e < EXTRUDERS; e++) {
3792
+      SERIAL_CHAR(' ');
3793
+      SERIAL_ECHO(extruder_offset[X_AXIS][e]);
3794
+      SERIAL_CHAR(',');
3795
+      SERIAL_ECHO(extruder_offset[Y_AXIS][e]);
3794
       #ifdef DUAL_X_CARRIAGE
3796
       #ifdef DUAL_X_CARRIAGE
3795
-        SERIAL_ECHO(",");
3796
-        SERIAL_ECHO(extruder_offset[Z_AXIS][tmp_extruder]);
3797
+        SERIAL_CHAR(',');
3798
+        SERIAL_ECHO(extruder_offset[Z_AXIS][e]);
3797
       #endif
3799
       #endif
3798
     }
3800
     }
3799
     SERIAL_EOL;
3801
     SERIAL_EOL;
3816
     int sval = code_value();
3818
     int sval = code_value();
3817
     if (code_seen('T')) {
3819
     if (code_seen('T')) {
3818
       if (setTargetedHotend(221)) return;
3820
       if (setTargetedHotend(221)) return;
3819
-      extruder_multiply[tmp_extruder] = sval;
3821
+      extruder_multiply[target_extruder] = sval;
3820
     }
3822
     }
3821
     else {
3823
     else {
3822
       extruder_multiply[active_extruder] = sval;
3824
       extruder_multiply[active_extruder] = sval;
4047
    * M250: Read and optionally set the LCD contrast
4049
    * M250: Read and optionally set the LCD contrast
4048
    */
4050
    */
4049
   inline void gcode_M250() {
4051
   inline void gcode_M250() {
4050
-    if (code_seen('C')) lcd_setcontrast(code_value_long() & 0x3F);
4052
+    if (code_seen('C')) lcd_setcontrast(code_value_short() & 0x3F);
4051
     SERIAL_PROTOCOLPGM("lcd contrast value: ");
4053
     SERIAL_PROTOCOLPGM("lcd contrast value: ");
4052
     SERIAL_PROTOCOL(lcd_contrast);
4054
     SERIAL_PROTOCOL(lcd_contrast);
4053
     SERIAL_PROTOCOLLN("");
4055
     SERIAL_PROTOCOLLN("");
4073
  *       C<cycles>
4075
  *       C<cycles>
4074
  */
4076
  */
4075
 inline void gcode_M303() {
4077
 inline void gcode_M303() {
4076
-  int e = code_seen('E') ? code_value_long() : 0;
4077
-  int c = code_seen('C') ? code_value_long() : 5;
4078
+  int e = code_seen('E') ? code_value_short() : 0;
4079
+  int c = code_seen('C') ? code_value_short() : 5;
4078
   float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0);
4080
   float temp = code_seen('S') ? code_value() : (e < 0 ? 70.0 : 150.0);
4079
   PID_autotune(temp, e, c);
4081
   PID_autotune(temp, e, c);
4080
 }
4082
 }
4483
         if (code_seen('R')) duplicate_extruder_temp_offset = code_value();
4485
         if (code_seen('R')) duplicate_extruder_temp_offset = code_value();
4484
         SERIAL_ECHO_START;
4486
         SERIAL_ECHO_START;
4485
         SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
4487
         SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
4486
-        SERIAL_ECHO(" ");
4488
+        SERIAL_CHAR(' ');
4487
         SERIAL_ECHO(extruder_offset[X_AXIS][0]);
4489
         SERIAL_ECHO(extruder_offset[X_AXIS][0]);
4488
-        SERIAL_ECHO(",");
4490
+        SERIAL_CHAR(',');
4489
         SERIAL_ECHO(extruder_offset[Y_AXIS][0]);
4491
         SERIAL_ECHO(extruder_offset[Y_AXIS][0]);
4490
-        SERIAL_ECHO(" ");
4492
+        SERIAL_CHAR(' ');
4491
         SERIAL_ECHO(duplicate_extruder_x_offset);
4493
         SERIAL_ECHO(duplicate_extruder_x_offset);
4492
-        SERIAL_ECHO(",");
4494
+        SERIAL_CHAR(',');
4493
         SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]);
4495
         SERIAL_ECHOLN(extruder_offset[Y_AXIS][1]);
4494
         break;
4496
         break;
4495
       case DXC_FULL_CONTROL_MODE:
4497
       case DXC_FULL_CONTROL_MODE:
4562
    *       S# determines MS1 or MS2, X# sets the pin high/low.
4564
    *       S# determines MS1 or MS2, X# sets the pin high/low.
4563
    */
4565
    */
4564
   inline void gcode_M351() {
4566
   inline void gcode_M351() {
4565
-    if (code_seen('S')) switch(code_value_long()) {
4567
+    if (code_seen('S')) switch(code_value_short()) {
4566
       case 1:
4568
       case 1:
4567
         for(int i=0;i<NUM_AXIS;i++) if (code_seen(axis_codes[i])) microstep_ms(i, code_value(), -1);
4569
         for(int i=0;i<NUM_AXIS;i++) if (code_seen(axis_codes[i])) microstep_ms(i, code_value(), -1);
4568
         if (code_seen('B')) microstep_ms(4, code_value(), -1);
4570
         if (code_seen('B')) microstep_ms(4, code_value(), -1);
4588
 }
4590
 }
4589
 
4591
 
4590
 inline void gcode_T() {
4592
 inline void gcode_T() {
4591
-  tmp_extruder = code_value();
4593
+  int tmp_extruder = code_value();
4592
   if (tmp_extruder >= EXTRUDERS) {
4594
   if (tmp_extruder >= EXTRUDERS) {
4593
     SERIAL_ECHO_START;
4595
     SERIAL_ECHO_START;
4594
-    SERIAL_ECHO("T");
4596
+    SERIAL_CHAR('T');
4595
     SERIAL_ECHO(tmp_extruder);
4597
     SERIAL_ECHO(tmp_extruder);
4596
     SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
4598
     SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
4597
   }
4599
   }
4598
   else {
4600
   else {
4601
+    target_extruder = tmp_extruder;
4602
+
4599
     #if EXTRUDERS > 1
4603
     #if EXTRUDERS > 1
4600
       bool make_move = false;
4604
       bool make_move = false;
4601
     #endif
4605
     #endif
4606
+
4602
     if (code_seen('F')) {
4607
     if (code_seen('F')) {
4608
+
4603
       #if EXTRUDERS > 1
4609
       #if EXTRUDERS > 1
4604
         make_move = true;
4610
         make_move = true;
4605
       #endif
4611
       #endif
4612
+
4606
       next_feedrate = code_value();
4613
       next_feedrate = code_value();
4607
       if (next_feedrate > 0.0) feedrate = next_feedrate;
4614
       if (next_feedrate > 0.0) feedrate = next_feedrate;
4608
     }
4615
     }
4692
 void process_commands() {
4699
 void process_commands() {
4693
   if (code_seen('G')) {
4700
   if (code_seen('G')) {
4694
 
4701
 
4695
-    int gCode = code_value_long();
4702
+    int gCode = code_value_short();
4696
 
4703
 
4697
     switch(gCode) {
4704
     switch(gCode) {
4698
 
4705
 
4767
   }
4774
   }
4768
 
4775
 
4769
   else if (code_seen('M')) {
4776
   else if (code_seen('M')) {
4770
-    switch( code_value_long() ) {
4777
+    switch(code_value_short()) {
4771
       #ifdef ULTIPANEL
4778
       #ifdef ULTIPANEL
4772
         case 0: // M0 - Unconditional stop - Wait for user button press on LCD
4779
         case 0: // M0 - Unconditional stop - Wait for user button press on LCD
4773
         case 1: // M1 - Conditional stop - Wait for user button press on LCD
4780
         case 1: // M1 - Conditional stop - Wait for user button press on LCD
5922
 #endif //FAST_PWM_FAN
5929
 #endif //FAST_PWM_FAN
5923
 
5930
 
5924
 bool setTargetedHotend(int code){
5931
 bool setTargetedHotend(int code){
5925
-  tmp_extruder = active_extruder;
5926
-  if(code_seen('T')) {
5927
-    tmp_extruder = code_value();
5928
-    if(tmp_extruder >= EXTRUDERS) {
5932
+  target_extruder = active_extruder;
5933
+  if (code_seen('T')) {
5934
+    target_extruder = code_value_short();
5935
+    if (target_extruder >= EXTRUDERS) {
5929
       SERIAL_ECHO_START;
5936
       SERIAL_ECHO_START;
5930
       switch(code){
5937
       switch(code){
5931
         case 104:
5938
         case 104:
5944
           SERIAL_ECHO(MSG_M221_INVALID_EXTRUDER);
5951
           SERIAL_ECHO(MSG_M221_INVALID_EXTRUDER);
5945
           break;
5952
           break;
5946
       }
5953
       }
5947
-      SERIAL_ECHOLN(tmp_extruder);
5954
+      SERIAL_ECHOLN(target_extruder);
5948
       return true;
5955
       return true;
5949
     }
5956
     }
5950
   }
5957
   }

+ 6
- 6
Marlin/cardreader.cpp View File

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

+ 2
- 2
Marlin/vector_3.cpp View File

125
   int count = 0;
125
   int count = 0;
126
   for(int i=0; i<3; i++) {
126
   for(int i=0; i<3; i++) {
127
     for(int j=0; j<3; j++) {
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
       SERIAL_PROTOCOL_F(matrix[count], 6);
129
       SERIAL_PROTOCOL_F(matrix[count], 6);
130
-      SERIAL_PROTOCOLPGM(" ");
130
+      SERIAL_PROTOCOLCHAR(' ');
131
       count++;
131
       count++;
132
     }
132
     }
133
     SERIAL_EOL;
133
     SERIAL_EOL;

Loading…
Cancel
Save