|
@@ -536,6 +536,10 @@ void gcode_line_error(PGM_P err, uint8_t port) {
|
536
|
536
|
|
537
|
537
|
#endif // FAST_FILE_TRANSFER
|
538
|
538
|
|
|
539
|
+FORCE_INLINE bool is_M29(const char * const cmd) {
|
|
540
|
+ return cmd[0] == 'M' && cmd[1] == '2' && cmd[2] == '9' && !WITHIN(cmd[3], '0', '9');
|
|
541
|
+}
|
|
542
|
+
|
539
|
543
|
/**
|
540
|
544
|
* Get all commands waiting on the serial port and queue them.
|
541
|
545
|
* Exit when the buffer is full or when no more characters are
|
|
@@ -631,7 +635,8 @@ inline void get_serial_commands() {
|
631
|
635
|
gcode_LastN = gcode_N;
|
632
|
636
|
}
|
633
|
637
|
#if ENABLED(SDSUPPORT)
|
634
|
|
- else if (card.flag.saving && command[0] == 'M' && command[1] == '2' && command[2] == '9' && (command[3] == '\0' || command[3] == ' '))
|
|
638
|
+ // Pronterface "M29" and "M29 " has no line number
|
|
639
|
+ else if (card.flag.saving && !is_M29(command))
|
635
|
640
|
return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i);
|
636
|
641
|
#endif
|
637
|
642
|
|
|
@@ -840,7 +845,7 @@ void advance_command_queue() {
|
840
|
845
|
|
841
|
846
|
if (card.flag.saving) {
|
842
|
847
|
char* command = command_queue[cmd_queue_index_r];
|
843
|
|
- if (command[0] == 'M' && command[1] == '2' && command[2] == '9' && (command[3] == '\0' || command[3] == ' ')) {
|
|
848
|
+ if (is_M29(command)) {
|
844
|
849
|
// M29 closes the file
|
845
|
850
|
card.closefile();
|
846
|
851
|
SERIAL_ECHOLNPGM(MSG_FILE_SAVED);
|