Browse Source

Fix is_M29

Followup for #13013
Scott Lahteine 6 years ago
parent
commit
92ed9a2bb6
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/src/gcode/queue.cpp

+ 3
- 2
Marlin/src/gcode/queue.cpp View File

@@ -526,8 +526,9 @@ void gcode_line_error(PGM_P const err, const int8_t port) {
526 526
 
527 527
 #endif // BINARY_FILE_TRANSFER
528 528
 
529
-FORCE_INLINE bool is_M29(const char * const cmd) {
530
-  return cmd[0] == 'M' && cmd[1] == '2' && cmd[2] == '9' && !WITHIN(cmd[3], '0', '9');
529
+FORCE_INLINE bool is_M29(const char * const cmd) {  // matches "M29" & "M29 ", but not "M290", etc
530
+  const char * const m29 = strstr_P(cmd, PSTR("M29"));
531
+  return m29 && !NUMERIC(m29[3]);
531 532
 }
532 533
 
533 534
 /**

Loading…
Cancel
Save