From 1196e3ca592757b99bc4f681f66c2fc771bf7bb7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 3 May 2017 22:14:40 -0500 Subject: [PATCH] SDCard print completion can use "M0" --- Marlin/Marlin_main.cpp | 5 +---- Marlin/cardreader.cpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b53780b71f..0e530b75c7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1182,10 +1182,7 @@ inline void get_serial_commands() { LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS); set_led_color(0, 255, 0); // Green #if HAS_RESUME_CONTINUE - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - while (wait_for_user) idle(); - KEEPALIVE_STATE(IN_HANDLER); + enqueue_and_echo_commands_P(PSTR("M0")); // end of the queue! #else safe_delay(1000); #endif diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index ab4b659dae..a37389e457 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -552,7 +552,7 @@ void CardReader::checkautostart(bool force) { bool found = false; while (root.readDir(p, NULL) > 0) { - for (int8_t i = 0; i < (int8_t)strlen((char*)p.name); i++) p.name[i] = tolower(p.name[i]); + for (int8_t i = (int8_t)strlen((char*)p.name); i--;) p.name[i] = tolower(p.name[i]); if (p.name[9] != '~' && strncmp((char*)p.name, autoname, 5) == 0) { openAndPrintFile(autoname); found = true;