Browse Source

Merge pull request #9327 from thinkyhead/bf2_fix_parser_M118

[2.0.x] Fix parser.has_value, M118 parameters
Scott Lahteine 7 years ago
parent
commit
70e4f12d2f
No account linked to committer's email address

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/include/Wire.h View File

49
 
49
 
50
     uint8_t requestFrom(uint8_t, uint8_t);
50
     uint8_t requestFrom(uint8_t, uint8_t);
51
     uint8_t requestFrom(int, int);
51
     uint8_t requestFrom(int, int);
52
-    
52
+
53
     virtual size_t write(uint8_t);
53
     virtual size_t write(uint8_t);
54
     virtual size_t write(const uint8_t *, size_t);
54
     virtual size_t write(const uint8_t *, size_t);
55
     virtual int available(void);
55
     virtual int available(void);

+ 4
- 4
Marlin/src/HAL/HAL_LPC1768/persistent_store_impl.cpp View File

107
    SERIAL_PROTOCOLPAIR(" write_data(", pos);         // This extra chit-chat goes away soon.  But it is helpful
107
    SERIAL_PROTOCOLPAIR(" write_data(", pos);         // This extra chit-chat goes away soon.  But it is helpful
108
    SERIAL_PROTOCOLPAIR(",", (int)value);            // right now to see errors that are happening in the
108
    SERIAL_PROTOCOLPAIR(",", (int)value);            // right now to see errors that are happening in the
109
    SERIAL_PROTOCOLPAIR(",", (int)size);             // read_data() and write_data() functions
109
    SERIAL_PROTOCOLPAIR(",", (int)size);             // read_data() and write_data() functions
110
-   SERIAL_PROTOCOL("...)\n");
110
+   SERIAL_PROTOCOLLNPGM("...)");
111
    SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s);
111
    SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s);
112
    return s;
112
    return s;
113
   }
113
   }
117
    SERIAL_PROTOCOLPAIR(" write_data(", pos);         // This extra chit-chat goes away soon.  But it is helpful
117
    SERIAL_PROTOCOLPAIR(" write_data(", pos);         // This extra chit-chat goes away soon.  But it is helpful
118
    SERIAL_PROTOCOLPAIR(",", (int)value);            // right now to see errors that are happening in the
118
    SERIAL_PROTOCOLPAIR(",", (int)value);            // right now to see errors that are happening in the
119
    SERIAL_PROTOCOLPAIR(",", size);             // read_data() and write_data() functions
119
    SERIAL_PROTOCOLPAIR(",", size);             // read_data() and write_data() functions
120
-   SERIAL_PROTOCOLLN("...)");
120
+   SERIAL_PROTOCOLLNPGM("...)");
121
    SERIAL_PROTOCOLLNPAIR(" f_write()=", (int)s);
121
    SERIAL_PROTOCOLLNPAIR(" f_write()=", (int)s);
122
    SERIAL_PROTOCOLPAIR(" size=", size);
122
    SERIAL_PROTOCOLPAIR(" size=", size);
123
    SERIAL_PROTOCOLLNPAIR("\n bytes_written=", bytes_written);
123
    SERIAL_PROTOCOLLNPAIR("\n bytes_written=", bytes_written);
136
    SERIAL_PROTOCOLPAIR(" read_data(", pos);          // This extra chit-chat goes away soon.  But it is helpful
136
    SERIAL_PROTOCOLPAIR(" read_data(", pos);          // This extra chit-chat goes away soon.  But it is helpful
137
    SERIAL_PROTOCOLPAIR(",", (int)value);            // right now to see errors that are happening in the
137
    SERIAL_PROTOCOLPAIR(",", (int)value);            // right now to see errors that are happening in the
138
    SERIAL_PROTOCOLPAIR(",", size);             // read_data() and write_data() functions
138
    SERIAL_PROTOCOLPAIR(",", size);             // read_data() and write_data() functions
139
-   SERIAL_PROTOCOLLN("...)");
139
+   SERIAL_PROTOCOLLNPGM("...)");
140
    SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s);
140
    SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s);
141
    return true;
141
    return true;
142
   }
142
   }
153
    SERIAL_PROTOCOLPAIR(" read_data(", pos);         // This extra chit-chat goes away soon.  But it is helpful
153
    SERIAL_PROTOCOLPAIR(" read_data(", pos);         // This extra chit-chat goes away soon.  But it is helpful
154
    SERIAL_PROTOCOLPAIR(",", (int)value);           // right now to see errors that are happening in the
154
    SERIAL_PROTOCOLPAIR(",", (int)value);           // right now to see errors that are happening in the
155
    SERIAL_PROTOCOLPAIR(",", size);            // read_data() and write_data() functions
155
    SERIAL_PROTOCOLPAIR(",", size);            // read_data() and write_data() functions
156
-   SERIAL_PROTOCOLLN("...)");
156
+   SERIAL_PROTOCOLLNPGM("...)");
157
    SERIAL_PROTOCOLLNPAIR(" f_write()=", (int)s);
157
    SERIAL_PROTOCOLLNPAIR(" f_write()=", (int)s);
158
    SERIAL_PROTOCOLPAIR(" size=", size);
158
    SERIAL_PROTOCOLPAIR(" size=", size);
159
    SERIAL_PROTOCOLLNPAIR("\n bytes_read=",  bytes_read);
159
    SERIAL_PROTOCOLLNPAIR("\n bytes_read=",  bytes_read);

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/HAL_STM32F7.h View File

98
   #define NUM_SERIAL 1
98
   #define NUM_SERIAL 1
99
 #endif
99
 #endif
100
 
100
 
101
-#define _BV(bit) (1 << (bit))
101
+#define _BV(b) (1UL << (b))
102
 
102
 
103
 /**
103
 /**
104
  * TODO: review this to return 1 for pins that are not analog input
104
  * TODO: review this to return 1 for pins that are not analog input

+ 1
- 1
Marlin/src/HAL/HAL_STM32F7/fastio_STM32F7.h View File

29
 #ifndef _FASTIO_STM32F7_H
29
 #ifndef _FASTIO_STM32F7_H
30
 #define _FASTIO_STM32F7_H
30
 #define _FASTIO_STM32F7_H
31
 
31
 
32
-#define _BV(bit) (1 << (bit))
32
+#define _BV(b) (1UL << (b))
33
 
33
 
34
 #define READ(IO)              digitalRead(IO)
34
 #define READ(IO)              digitalRead(IO)
35
 #define WRITE(IO, v)          digitalWrite(IO,v)
35
 #define WRITE(IO, v)          digitalWrite(IO,v)

+ 2
- 3
Marlin/src/core/macros.h View File

95
 #define STRINGIFY(M) STRINGIFY_(M)
95
 #define STRINGIFY(M) STRINGIFY_(M)
96
 
96
 
97
 // Macros for bit masks
97
 // Macros for bit masks
98
-#ifndef _BV
99
-  #define _BV(n)  (1<<(n))
100
-#endif
98
+#undef _BV // Marlin needs 32-bit unsigned!
99
+#define _BV(b) (1UL << (b))
101
 #define TEST(n,b) (((n)&_BV(b))!=0)
100
 #define TEST(n,b) (((n)&_BV(b))!=0)
102
 #define SBI(n,b) (n |= _BV(b))
101
 #define SBI(n,b) (n |= _BV(b))
103
 #define CBI(n,b) (n &= ~_BV(b))
102
 #define CBI(n,b) (n &= ~_BV(b))

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

1095
     SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt);
1095
     SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt);
1096
 
1096
 
1097
     #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1097
     #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1098
-      SERIAL_PROTOCOL("planner.z_fade_height : ");
1098
+      SERIAL_PROTOCOLPGM("planner.z_fade_height : ");
1099
       SERIAL_PROTOCOL_F(planner.z_fade_height, 4);
1099
       SERIAL_PROTOCOL_F(planner.z_fade_height, 4);
1100
       SERIAL_EOL();
1100
       SERIAL_EOL();
1101
     #endif
1101
     #endif

+ 1
- 1
Marlin/src/feature/dac/stepper_dac.cpp View File

114
   SERIAL_ECHOPAIR(" (",   dac_amps(Z_AXIS));
114
   SERIAL_ECHOPAIR(" (",   dac_amps(Z_AXIS));
115
   SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS));
115
   SERIAL_ECHOPAIR(") E:", dac_perc(E_AXIS));
116
   SERIAL_ECHOPAIR(" (",   dac_amps(E_AXIS));
116
   SERIAL_ECHOPAIR(" (",   dac_amps(E_AXIS));
117
-  SERIAL_ECHOLN(")");
117
+  SERIAL_ECHOLNPGM(")");
118
 }
118
 }
119
 
119
 
120
 void dac_commit_eeprom() {
120
 void dac_commit_eeprom() {

+ 1
- 1
Marlin/src/gcode/config/M301.cpp View File

71
   }
71
   }
72
   else {
72
   else {
73
     SERIAL_ERROR_START();
73
     SERIAL_ERROR_START();
74
-    SERIAL_ERRORLN(MSG_INVALID_EXTRUDER);
74
+    SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER);
75
   }
75
   }
76
 }
76
 }
77
 
77
 

+ 2
- 2
Marlin/src/gcode/feature/caselight/M355.cpp View File

56
     // always report case light status
56
     // always report case light status
57
     SERIAL_ECHO_START();
57
     SERIAL_ECHO_START();
58
     if (!case_light_on) {
58
     if (!case_light_on) {
59
-      SERIAL_ECHOLN("Case light: off");
59
+      SERIAL_ECHOLNPGM("Case light: off");
60
     }
60
     }
61
     else {
61
     else {
62
-      if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLN("Case light: on");
62
+      if (!USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) SERIAL_ECHOLNPGM("Case light: on");
63
       else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness);
63
       else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness);
64
     }
64
     }
65
   #else
65
   #else

+ 1
- 1
Marlin/src/gcode/feature/i2c/M260_M261.cpp View File

73
   }
73
   }
74
   else {
74
   else {
75
     SERIAL_ERROR_START();
75
     SERIAL_ERROR_START();
76
-    SERIAL_ERRORLN("Bad i2c request");
76
+    SERIAL_ERRORLNPGM("Bad i2c request");
77
   }
77
   }
78
 }
78
 }
79
 
79
 

+ 2
- 2
Marlin/src/gcode/host/M118.cpp View File

29
  *  E1  Have the host 'echo:' the text
29
  *  E1  Have the host 'echo:' the text
30
  */
30
  */
31
 void GcodeSuite::M118() {
31
 void GcodeSuite::M118() {
32
-  if (parser.boolval('E')) SERIAL_ECHO_START();
33
-  if (parser.boolval('A')) SERIAL_ECHOPGM("// ");
32
+  if (parser.seenval('E') && parser.value_bool()) SERIAL_ECHO_START();
33
+  if (parser.seenval('A') && parser.value_bool()) SERIAL_ECHOPGM("// ");
34
   SERIAL_ECHOLN(parser.string_arg);
34
   SERIAL_ECHOLN(parser.string_arg);
35
 }
35
 }

+ 4
- 17
Marlin/src/gcode/parser.cpp View File

60
 
60
 
61
 #if ENABLED(FASTER_GCODE_PARSER)
61
 #if ENABLED(FASTER_GCODE_PARSER)
62
   // Optimized Parameters
62
   // Optimized Parameters
63
-  byte GCodeParser::codebits[4];   // found bits
63
+  uint32_t GCodeParser::codebits;  // found bits
64
   uint8_t GCodeParser::param[26];  // parameter offsets from command_ptr
64
   uint8_t GCodeParser::param[26];  // parameter offsets from command_ptr
65
 #else
65
 #else
66
   char *GCodeParser::command_args; // start of parameters
66
   char *GCodeParser::command_args; // start of parameters
83
     subcode = 0;                        // No command sub-code
83
     subcode = 0;                        // No command sub-code
84
   #endif
84
   #endif
85
   #if ENABLED(FASTER_GCODE_PARSER)
85
   #if ENABLED(FASTER_GCODE_PARSER)
86
-    ZERO(codebits);                     // No codes yet
86
+    codebits = 0;                       // No codes yet
87
     //ZERO(param);                      // No parameters (should be safe to comment out this line)
87
     //ZERO(param);                      // No parameters (should be safe to comment out this line)
88
   #endif
88
   #endif
89
 }
89
 }
196
 
196
 
197
       while (*p == ' ') p++;                    // Skip spaces between parameters & values
197
       while (*p == ' ') p++;                    // Skip spaces between parameters & values
198
 
198
 
199
-      const bool has_num = NUMERIC(p[0])                            // [0-9]
200
-                        || (p[0] == '.' && NUMERIC(p[1]))           // .[0-9]
201
-                        || (
202
-                              (p[0] == '-' || p[0] == '+') && (     // [-+]
203
-                                NUMERIC(p[1])                       //     [0-9]
204
-                                || (p[1] == '.' && NUMERIC(p[2]))   //     .[0-9]
205
-                              )
206
-                            );
199
+      const bool has_num = valid_float(p);
207
 
200
 
208
       #if ENABLED(DEBUG_GCODE_PARSER)
201
       #if ENABLED(DEBUG_GCODE_PARSER)
209
         if (debug) {
202
         if (debug) {
225
       #endif
218
       #endif
226
 
219
 
227
       #if ENABLED(FASTER_GCODE_PARSER)
220
       #if ENABLED(FASTER_GCODE_PARSER)
228
-      {
229
-        set(code, has_num ? p : NULL            // Set parameter exists and pointer (NULL for no number)
230
-          #if ENABLED(DEBUG_GCODE_PARSER)
231
-            , debug
232
-          #endif
233
-        );
234
-      }
221
+        set(code, has_num ? p : NULL);          // Set parameter exists and pointer (NULL for no number)
235
       #endif
222
       #endif
236
     }
223
     }
237
     else if (!string_arg) {                     // Not A-Z? First time, keep as the string_arg
224
     else if (!string_arg) {                     // Not A-Z? First time, keep as the string_arg

+ 42
- 36
Marlin/src/gcode/parser.h View File

51
   static char *value_ptr;           // Set by seen, used to fetch the value
51
   static char *value_ptr;           // Set by seen, used to fetch the value
52
 
52
 
53
   #if ENABLED(FASTER_GCODE_PARSER)
53
   #if ENABLED(FASTER_GCODE_PARSER)
54
-    static byte codebits[4];        // Parameters pre-scanned
54
+    static uint32_t codebits;       // Parameters pre-scanned
55
     static uint8_t param[26];       // For A-Z, offsets into command args
55
     static uint8_t param[26];       // For A-Z, offsets into command args
56
   #else
56
   #else
57
     static char *command_args;      // Args start here, for slow scan
57
     static char *command_args;      // Args start here, for slow scan
88
   // Reset is done before parsing
88
   // Reset is done before parsing
89
   static void reset();
89
   static void reset();
90
 
90
 
91
-  // Index so that 'X' falls on index 24
92
-  #define PARAM_IND(N)  ((N) >> 3)
93
-  #define PARAM_BIT(N)  ((N) & 0x7)
94
-  #define LETTER_OFF(N) ((N) - 'A')
95
-  #define LETTER_IND(N) PARAM_IND(LETTER_OFF(N))
96
-  #define LETTER_BIT(N) PARAM_BIT(LETTER_OFF(N))
91
+  #define LETTER_BIT(N) ((N) - 'A')
97
 
92
 
98
   #if ENABLED(FASTER_GCODE_PARSER)
93
   #if ENABLED(FASTER_GCODE_PARSER)
99
 
94
 
95
+    FORCE_INLINE static bool valid_signless(const char * const p) {
96
+      return NUMERIC(p[0]) || (p[0] == '.' && NUMERIC(p[1])); // .?[0-9]
97
+    }
98
+
99
+    FORCE_INLINE static bool valid_float(const char * const p) {
100
+      return valid_signless(p) || ((p[0] == '-' || p[0] == '+') && valid_signless(&p[1])); // [-+]?.?[0-9]
101
+    }
102
+
103
+    FORCE_INLINE static bool valid_int(const char * const p) {
104
+      return NUMERIC(p[0]) || ((p[0] == '-' || p[0] == '+') && NUMERIC(p[1])); // [-+]?[0-9]
105
+    }
106
+
100
     // Set the flag and pointer for a parameter
107
     // Set the flag and pointer for a parameter
101
-    static void set(const char c, char * const ptr
102
-      #if ENABLED(DEBUG_GCODE_PARSER)
103
-        , const bool debug=false
104
-      #endif
105
-    ) {
106
-      const uint8_t ind = LETTER_OFF(c);
108
+    static void set(const char c, char * const ptr) {
109
+      const uint8_t ind = LETTER_BIT(c);
107
       if (ind >= COUNT(param)) return;           // Only A-Z
110
       if (ind >= COUNT(param)) return;           // Only A-Z
108
-      SBI(codebits[PARAM_IND(ind)], PARAM_BIT(ind));        // parameter exists
111
+      SBI(codebits, ind);                        // parameter exists
109
       param[ind] = ptr ? ptr - command_ptr : 0;  // parameter offset or 0
112
       param[ind] = ptr ? ptr - command_ptr : 0;  // parameter offset or 0
110
       #if ENABLED(DEBUG_GCODE_PARSER)
113
       #if ENABLED(DEBUG_GCODE_PARSER)
111
-        if (debug) {
112
-          SERIAL_ECHOPAIR("Set bit ", (int)PARAM_BIT(ind));
113
-          SERIAL_ECHOPAIR(" of index ", (int)PARAM_IND(ind));
114
-          SERIAL_ECHOLNPAIR(" | param = ", (int)param[ind]);
114
+        if (codenum == 800) {
115
+          SERIAL_ECHOPAIR("Set bit ", (int)ind);
116
+          SERIAL_ECHOPAIR(" of codebits (", hex_address((void*)(codebits >> 16)));
117
+          print_hex_word((uint16_t)(codebits & 0xFFFF));
118
+          SERIAL_ECHOLNPAIR(") | param = ", (int)param[ind]);
115
         }
119
         }
116
       #endif
120
       #endif
117
     }
121
     }
119
     // Code seen bit was set. If not found, value_ptr is unchanged.
123
     // Code seen bit was set. If not found, value_ptr is unchanged.
120
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
124
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
121
     static bool seen(const char c) {
125
     static bool seen(const char c) {
122
-      const uint8_t ind = LETTER_OFF(c);
126
+      const uint8_t ind = LETTER_BIT(c);
123
       if (ind >= COUNT(param)) return false; // Only A-Z
127
       if (ind >= COUNT(param)) return false; // Only A-Z
124
-      const bool b = TEST(codebits[PARAM_IND(ind)], PARAM_BIT(ind));
125
-      if (b) value_ptr = param[ind] ? command_ptr + param[ind] : (char*)NULL;
128
+      const bool b = TEST(codebits, ind);
129
+      if (b) {
130
+        char * const ptr = command_ptr + param[ind];
131
+        value_ptr = param[ind] && valid_float(ptr) ? ptr : (char*)NULL;
132
+      }
126
       return b;
133
       return b;
127
     }
134
     }
128
 
135
 
129
-    static bool seen_any() { return codebits[3] || codebits[2] || codebits[1] || codebits[0]; }
136
+    static bool seen_any() { return !!codebits; }
130
 
137
 
131
-    #define SEEN_TEST(L) TEST(codebits[LETTER_IND(L)], LETTER_BIT(L))
138
+    #define SEEN_TEST(L) TEST(codebits, LETTER_BIT(L))
132
 
139
 
133
   #else // !FASTER_GCODE_PARSER
140
   #else // !FASTER_GCODE_PARSER
134
 
141
 
135
     // Code is found in the string. If not found, value_ptr is unchanged.
142
     // Code is found in the string. If not found, value_ptr is unchanged.
136
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
143
     // This allows "if (seen('A')||seen('B'))" to use the last-found value.
137
     static bool seen(const char c) {
144
     static bool seen(const char c) {
138
-      char *p = strchr(command_args, c);
145
+      const char *p = strchr(command_args, c);
139
       const bool b = !!p;
146
       const bool b = !!p;
140
-      if (b) value_ptr = DECIMAL_SIGNED(p[1]) ? &p[1] : (char*)NULL;
147
+      if (b) value_ptr = valid_float(&p[1]) ? &p[1] : (char*)NULL;
141
       return b;
148
       return b;
142
     }
149
     }
143
 
150
 
201
   inline static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); }
208
   inline static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); }
202
 
209
 
203
   // Bool is true with no value or non-zero
210
   // Bool is true with no value or non-zero
204
-  inline static bool value_bool() { return !has_value() || value_byte(); }
211
+  inline static bool value_bool() { return !has_value() || !!value_byte(); }
205
 
212
 
206
   // Units modes: Inches, Fahrenheit, Kelvin
213
   // Units modes: Inches, Fahrenheit, Kelvin
207
 
214
 
298
   void unknown_command_error();
305
   void unknown_command_error();
299
 
306
 
300
   // Provide simple value accessors with default option
307
   // Provide simple value accessors with default option
301
-  FORCE_INLINE static float       floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }
302
-  FORCE_INLINE static bool        boolval(const char c)                          { return seenval(c) ? value_bool()         : seen(c); }
303
-  FORCE_INLINE static uint8_t     byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
304
-  FORCE_INLINE static int16_t     intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
305
-  FORCE_INLINE static uint16_t    ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort()       : dval; }
306
-  FORCE_INLINE static int32_t     longval(const char c, const int32_t dval=0)    { return seenval(c) ? value_long()         : dval; }
307
-  FORCE_INLINE static uint32_t    ulongval(const char c, const uint32_t dval=0)  { return seenval(c) ? value_ulong()        : dval; }
308
-  FORCE_INLINE static float       linearval(const char c, const float dval=0.0)  { return seenval(c) ? value_linear_units() : dval; }
309
-  FORCE_INLINE static float       celsiusval(const char c, const float dval=0.0) { return seenval(c) ? value_celsius()      : dval; }
310
-  FORCE_INLINE static const char* strval(const char c)                           { return seenval(c) ? value_ptr            : NULL; }
308
+  FORCE_INLINE static float    floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }
309
+  FORCE_INLINE static bool     boolval(const char c)                          { return seenval(c) ? value_bool()         : seen(c); }
310
+  FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
311
+  FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
312
+  FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort()       : dval; }
313
+  FORCE_INLINE static int32_t  longval(const char c, const int32_t dval=0)    { return seenval(c) ? value_long()         : dval; }
314
+  FORCE_INLINE static uint32_t ulongval(const char c, const uint32_t dval=0)  { return seenval(c) ? value_ulong()        : dval; }
315
+  FORCE_INLINE static float    linearval(const char c, const float dval=0.0)  { return seenval(c) ? value_linear_units() : dval; }
316
+  FORCE_INLINE static float    celsiusval(const char c, const float dval=0.0) { return seenval(c) ? value_celsius()      : dval; }
311
 
317
 
312
 };
318
 };
313
 
319
 

+ 2
- 2
Marlin/src/module/configuration_store.cpp View File

1502
         HAL::PersistentStore::access_finish();
1502
         HAL::PersistentStore::access_finish();
1503
 
1503
 
1504
         if (status)
1504
         if (status)
1505
-          SERIAL_PROTOCOL("?Unable to save mesh data.\n");
1505
+          SERIAL_PROTOCOLPGM("?Unable to save mesh data.\n");
1506
 
1506
 
1507
         // Write crc to MAT along with other data, or just tack on to the beginning or end
1507
         // Write crc to MAT along with other data, or just tack on to the beginning or end
1508
 
1508
 
1540
         HAL::PersistentStore::access_finish();
1540
         HAL::PersistentStore::access_finish();
1541
 
1541
 
1542
         if (status)
1542
         if (status)
1543
-          SERIAL_PROTOCOL("?Unable to load mesh data.\n");
1543
+          SERIAL_PROTOCOLPGM("?Unable to load mesh data.\n");
1544
 
1544
 
1545
         #if ENABLED(EEPROM_CHITCHAT)
1545
         #if ENABLED(EEPROM_CHITCHAT)
1546
           else
1546
           else

+ 2
- 2
Marlin/src/module/temperature.cpp View File

266
     #endif
266
     #endif
267
 
267
 
268
     if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) {
268
     if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) {
269
-      SERIAL_ECHOLN(MSG_PID_BAD_EXTRUDER_NUM);
269
+      SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM);
270
       return;
270
       return;
271
     }
271
     }
272
 
272
 
273
-    SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START);
273
+    SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START);
274
 
274
 
275
     disable_all_heaters(); // switch off all heaters.
275
     disable_all_heaters(); // switch off all heaters.
276
 
276
 

+ 1
- 1
Marlin/src/module/tool_change.cpp View File

123
   SERIAL_CHAR('T');
123
   SERIAL_CHAR('T');
124
   SERIAL_ECHO_F(e, DEC);
124
   SERIAL_ECHO_F(e, DEC);
125
   SERIAL_CHAR(' ');
125
   SERIAL_CHAR(' ');
126
-  SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
126
+  SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER);
127
 }
127
 }
128
 
128
 
129
 /**
129
 /**

+ 1
- 1
Marlin/src/sd/cardreader.cpp View File

364
       if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
364
       if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) {
365
         SERIAL_ERROR_START();
365
         SERIAL_ERROR_START();
366
         SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
366
         SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:");
367
-        SERIAL_ERRORLN(SD_PROCEDURE_DEPTH);
367
+        SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH);
368
         kill(PSTR(MSG_KILLED));
368
         kill(PSTR(MSG_KILLED));
369
         return;
369
         return;
370
       }
370
       }

Loading…
Cancel
Save