From 3d5622a5368dfd6527fbc6ceb7f719de2a8bedee Mon Sep 17 00:00:00 2001 From: Kiss Lorand Date: Sun, 13 Dec 2020 12:09:39 +0200 Subject: [PATCH 1/2] FIx autofile_check() --- Marlin/src/sd/cardreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index fe8bc4879a78..a4c43be39d45 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -758,7 +758,7 @@ void CardReader::write_command(char * const buf) { * Return 'true' if there was nothing to do */ bool CardReader::autofile_check() { - if (!autofile_index) return true; + if (!autofile_index) return false; if (!isMounted()) mount(); From e5b9f6dfa07f06f2faa87251114a7dc376aa8303 Mon Sep 17 00:00:00 2001 From: Kiss Lorand Date: Mon, 14 Dec 2020 00:51:05 +0200 Subject: [PATCH 2/2] Fix autofile_check() logic --- Marlin/src/gcode/sd/M1001.cpp | 2 +- Marlin/src/sd/cardreader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/sd/M1001.cpp b/Marlin/src/gcode/sd/M1001.cpp index 406cd074c3c2..8e24b60493f5 100644 --- a/Marlin/src/gcode/sd/M1001.cpp +++ b/Marlin/src/gcode/sd/M1001.cpp @@ -65,7 +65,7 @@ */ void GcodeSuite::M1001() { // If there's another auto#.g file to run... - if (TERN(NO_SD_AUTOSTART, false, card.autofile_check())) return; + if (TERN(NO_SD_AUTOSTART, false, !card.autofile_check())) return; // Purge the recovery file... TERN_(POWER_LOSS_RECOVERY, recovery.purge()); diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index a4c43be39d45..fe8bc4879a78 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -758,7 +758,7 @@ void CardReader::write_command(char * const buf) { * Return 'true' if there was nothing to do */ bool CardReader::autofile_check() { - if (!autofile_index) return false; + if (!autofile_index) return true; if (!isMounted()) mount();