From 52cb37770b7c36982b7c05f8297fe774a7be70e6 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 23 Aug 2019 19:27:58 +0200 Subject: [PATCH 1/4] Fix repeated power panic restarted print from beginning or jumped at most 65536 B back in file printed from SD card. As sdpos_atomic was not updated after printer power up and first power panic recovery, it was equal 0. When the first command from SD card was queued its size on SD card was computed as current SD index position minus sdpos_atomic. This was equal to offset from beginning of the file limited to 16 bit storage type. When next power outage occurred earlier then this command was finished and wiped out of queue, this command size (extraordinarily big) was subtracted from sdpos_atomic and saved to EEPROM. This led to up to 65536 B jump back in file printed after next power panic recovery. --- Firmware/Marlin_main.cpp | 6 ++++-- Firmware/cmdqueue.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 10c5437e..79cdba1a 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5343,7 +5343,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) // ---------------------------------- case 26: if(card.cardOK && code_seen('S')) { - card.setIndex(code_value_long()); + long index = code_value_long(); + card.setIndex(index); + sdpos_atomic = index; } break; @@ -9497,7 +9499,7 @@ void serialecho_temperatures() { SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(""); } -extern uint32_t sdpos_atomic; + #ifdef UVLO_SUPPORT void uvlo_() diff --git a/Firmware/cmdqueue.h b/Firmware/cmdqueue.h index 6c81db29..13185f17 100644 --- a/Firmware/cmdqueue.h +++ b/Firmware/cmdqueue.h @@ -45,6 +45,8 @@ extern bool cmdbuffer_front_already_processed; // Debugging information will be sent to serial line. //#define CMDBUFFER_DEBUG +extern uint32_t sdpos_atomic; + extern int serial_count; extern boolean comment_mode; extern char *strchr_pointer; From c27fcf9cffafb9837bcfc0b39bc189e4b8c72849 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 26 Aug 2019 17:03:18 +0200 Subject: [PATCH 2/4] Increase version to 3.8.0-RC2 and build number to 2639. --- Firmware/Configuration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 870eee89..ebda4960 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -16,8 +16,8 @@ extern uint16_t nPrinterType; extern PGM_P sPrinterName; // Firmware version -#define FW_VERSION "3.8.0" -#define FW_COMMIT_NR 2608 +#define FW_VERSION "3.8.0-RC2" +#define FW_COMMIT_NR 2639 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN From 159a1a70d8d168d98269fd5c21bef14d0275b577 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 26 Aug 2019 17:19:57 +0200 Subject: [PATCH 3/4] Update documentation. --- Firmware/Marlin_main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 79cdba1a..5279776d 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5339,12 +5339,17 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) card.pauseSDPrint(); break; - //! ### M26 - Set SD index + //! ### M26 S\ - Set SD index + //! Set position in SD card file to index in bytes. + //! This command is expected to be called after M23 and before M24. + //! Otherwise effect of this command is undefined. // ---------------------------------- case 26: if(card.cardOK && code_seen('S')) { long index = code_value_long(); card.setIndex(index); + // We don't disable interrupt during update of sdpos_atomic + // as we expect, that SD card print is not active in this moment sdpos_atomic = index; } break; From bf2097342dfe4ef8902a67805f92e644e4cb4e75 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 27 Aug 2019 17:01:41 +0200 Subject: [PATCH 4/4] Add ASA preheat into mFilamentMenu(); --- Firmware/ultralcd.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e601fd75..43ab4042 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -2486,6 +2486,12 @@ bFilamentPreheatState=false; mFilamentItem(PET_PREHEAT_HOTEND_TEMP,PET_PREHEAT_HPB_TEMP); } +static void mFilamentItem_ASA() +{ + bFilamentPreheatState=false; + mFilamentItem(ASA_PREHEAT_HOTEND_TEMP,ASA_PREHEAT_HPB_TEMP); +} + static void mFilamentItem_ABS() { bFilamentPreheatState=false; @@ -2520,15 +2526,16 @@ if(eFilamentAction==FilamentAction::AutoLoad) void mFilamentMenu() { -MENU_BEGIN(); -MENU_ITEM_FUNCTION_P(_T(MSG_MAIN),mFilamentBack); -MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA); -MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET); -MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS); -MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS); -MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP); -MENU_ITEM_SUBMENU_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)),mFilamentItem_FLEX); -MENU_END(); + MENU_BEGIN(); + MENU_ITEM_FUNCTION_P(_T(MSG_MAIN),mFilamentBack); + MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA); + MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET); + MENU_ITEM_SUBMENU_P(PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)),mFilamentItem_ASA); + MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS); + MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS); + MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP); + MENU_ITEM_SUBMENU_P(PSTR("FLEX - " STRINGIFY(FLEX_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FLEX_PREHEAT_HPB_TEMP)),mFilamentItem_FLEX); + MENU_END(); } void mFilamentItemForce()