From 0e0cc13650cd9174114baf02b06a98310f976b6d Mon Sep 17 00:00:00 2001 From: jeffstaley Date: Thu, 24 Jan 2019 19:10:59 -0800 Subject: [PATCH] Fix M29 for Pronterface SD card upload (#13010) --- Marlin/src/gcode/queue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 28a9eaf0f..b0389848c 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -630,7 +630,7 @@ inline void get_serial_commands() { gcode_LastN = gcode_N; } #if ENABLED(SDSUPPORT) - else if (card.flag.saving && strcmp(command, "M29") != 0) // No line number with M29 in Pronterface + else if (card.flag.saving && command[0] == 'M' && command[1] == '2' && command[2] == '9' && (command[3] == '\0' || command[3] == ' ')) return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i); #endif @@ -839,7 +839,7 @@ void advance_command_queue() { if (card.flag.saving) { char* command = command_queue[cmd_queue_index_r]; - if (strstr_P(command, PSTR("M29"))) { + if (command[0] == 'M' && command[1] == '2' && command[2] == '9' && (command[3] == '\0' || command[3] == ' ')) { // M29 closes the file card.closefile(); SERIAL_ECHOLNPGM(MSG_FILE_SAVED);