From 21d1685d0c113b5abd0b1a7b62770aa47179274c Mon Sep 17 00:00:00 2001 From: vovodroid Date: Sat, 16 Dec 2023 18:55:32 +0200 Subject: [PATCH 1/7] Auto resume bed temperature --- Marlin/Configuration_adv.h | 1 + Marlin/src/feature/powerloss.cpp | 1 + Marlin/src/feature/powerloss.h | 1 + Marlin/src/gcode/feature/powerloss/M1000.cpp | 7 ++++++- Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/menu/menu_configuration.cpp | 1 + Marlin/src/module/settings.cpp | 14 ++++++++++++-- 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8b4fa1ab7ca1..3da36fbc3a64 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1724,6 +1724,7 @@ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) + #define PLR_BED_THRESHOLD BED_MAXTEMP //if bed temperature upon restart is more than threshold resume automatically //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 5a25710084b2..70deada15527 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -36,6 +36,7 @@ #endif bool PrintJobRecovery::enabled; // Initialized by settings.load() +int16_t PrintJobRecovery::bed_temp_threshold; MediaFile PrintJobRecovery::file; job_recovery_info_t PrintJobRecovery::info; diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index a69862b25957..b80ed0fbb632 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -174,6 +174,7 @@ class PrintJobRecovery { static bool enabled; static void enable(const bool onoff); static void changed(); + static int16_t bed_temp_threshold; static bool exists() { return card.jobRecoverFileExists(); } static void open(const bool read) { card.openJobRecoveryFile(read); } diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index 1a1ebd517b3b..fe45f23b7c70 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -41,6 +41,7 @@ #define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY) #include "../../../core/debug_out.h" +#include "src/module/temperature.h" void menu_job_recovery(); @@ -65,7 +66,11 @@ inline void plr_error(FSTR_P const prefix) { void GcodeSuite::M1000() { if (recovery.valid()) { - if (parser.seen_test('S')) { + bool force_resume = false; + if (thermalManager.degBed() >= recovery.bed_temp_threshold) + force_resume = true; + + if (parser.seen_test('S') && !force_resume) { #if HAS_MARLINUI_MENU ui.goto_screen(menu_job_recovery); #elif HAS_DWIN_E3V2_BASIC diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 8c9dd08d07da..3af05682a7b2 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -499,6 +499,7 @@ namespace LanguageNarrow_en { LSTR MSG_RESUME_PRINT = _UxGT("Resume Print"); LSTR MSG_STOP_PRINT = _UxGT("Stop Print"); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Power Outage"); + LSTR MSG_BED_TEMP_RECOVERY = _UxGT("Bed temp threshold"); LSTR MSG_HOST_START_PRINT = _UxGT("Host Start"); LSTR MSG_PRINTING_OBJECT = _UxGT("Print Obj"); LSTR MSG_CANCEL_OBJECT = _UxGT("Cancel Obj"); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 7347f219e0ab..eaabb06271be 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -640,6 +640,7 @@ void menu_configuration() { #if ENABLED(POWER_LOSS_RECOVERY) EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); + EDIT_ITEM(int3, MSG_BED_TEMP_RECOVERY, &recovery.bed_temp_threshold, 0, BED_MAXTEMP); #endif // Preheat configurations diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index fa7beee94b84..53f7e6e8904c 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -36,7 +36,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V89" +#define EEPROM_VERSION "V90" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -448,6 +448,7 @@ typedef struct SettingsDataStruct { // POWER_LOSS_RECOVERY // bool recovery_enabled; // M413 S + uint16_t recovery_threshold; // // FWRETRACT @@ -1275,6 +1276,10 @@ void MarlinSettings::postprocess() { _FIELD_TEST(recovery_enabled); const bool recovery_enabled = TERN(POWER_LOSS_RECOVERY, recovery.enabled, ENABLED(PLR_ENABLED_DEFAULT)); EEPROM_WRITE(recovery_enabled); + + _FIELD_TEST(recovery_threshold); + const uint16_t recovery_threshold = TERN(POWER_LOSS_RECOVERY, recovery.bed_temp_threshold,PLR_BED_THRESHOLD); + EEPROM_WRITE(recovery_threshold); } // @@ -2320,6 +2325,11 @@ void MarlinSettings::postprocess() { _FIELD_TEST(recovery_enabled); EEPROM_READ(recovery_enabled); TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.enabled = recovery_enabled); + + int16_t recovery_threshold; + _FIELD_TEST(recovery_threshold); + EEPROM_READ(recovery_threshold); + TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.bed_temp_threshold = recovery_threshold); } // @@ -3470,7 +3480,7 @@ void MarlinSettings::reset() { // Power-Loss Recovery // TERN_(POWER_LOSS_RECOVERY, recovery.enable(ENABLED(PLR_ENABLED_DEFAULT))); - + TERN_(POWER_LOSS_RECOVERY, recovery.bed_temp_threshold = PLR_BED_THRESHOLD); // // Firmware Retraction // From f854b7d4648d9d289eb5358eb0a9d70cc26f702f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jan 2024 21:03:37 -0600 Subject: [PATCH 2/7] completion --- Marlin/Configuration_adv.h | 20 ++++++------- Marlin/src/feature/powerloss.cpp | 5 +++- Marlin/src/feature/powerloss.h | 5 +++- Marlin/src/gcode/feature/powerloss/M1000.cpp | 12 ++++---- Marlin/src/gcode/feature/powerloss/M413.cpp | 14 ++++++++- Marlin/src/inc/Conditionals_adv.h | 5 ++++ Marlin/src/lcd/menu/menu_configuration.cpp | 4 ++- Marlin/src/module/settings.cpp | 31 ++++++++++---------- 8 files changed, 62 insertions(+), 34 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3da36fbc3a64..b97b399eb240 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1723,20 +1723,20 @@ */ //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) - #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) - #define PLR_BED_THRESHOLD BED_MAXTEMP //if bed temperature upon restart is more than threshold resume automatically - //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss - //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) - //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. - //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss - //#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor + #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) + //#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable) + //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss + //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + //#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor //#define POWER_LOSS_PULLDOWN - //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume - //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. + //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume + //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. // Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card, // especially with "vase mode" printing. Set too high and vases cannot be continued. - #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data + #define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data // Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled! //#define POWER_LOSS_RECOVER_ZHOME diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 70deada15527..ce34b3a95cec 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -36,7 +36,10 @@ #endif bool PrintJobRecovery::enabled; // Initialized by settings.load() -int16_t PrintJobRecovery::bed_temp_threshold; + +#if HAS_PLR_BED_THRESHOLD + celsius_t PrintJobRecovery::bed_temp_threshold; // Initialized by settings.load() +#endif MediaFile PrintJobRecovery::file; job_recovery_info_t PrintJobRecovery::info; diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index b80ed0fbb632..1fdc42db26ad 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -174,7 +174,10 @@ class PrintJobRecovery { static bool enabled; static void enable(const bool onoff); static void changed(); - static int16_t bed_temp_threshold; + + #if HAS_PLR_BED_THRESHOLD + static celsius_t bed_temp_threshold; + #endif static bool exists() { return card.jobRecoverFileExists(); } static void open(const bool read) { card.openJobRecoveryFile(read); } diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp index fe45f23b7c70..033bcf4ebbdc 100644 --- a/Marlin/src/gcode/feature/powerloss/M1000.cpp +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -28,6 +28,10 @@ #include "../../../feature/powerloss.h" #include "../../../module/motion.h" +#if HAS_PLR_BED_THRESHOLD + #include "../../../module/temperature.h" // for degBed +#endif + #include "../../../lcd/marlinui.h" #if ENABLED(EXTENSIBLE_UI) #include "../../../lcd/extui/ui_api.h" @@ -41,7 +45,6 @@ #define DEBUG_OUT ENABLED(DEBUG_POWER_LOSS_RECOVERY) #include "../../../core/debug_out.h" -#include "src/module/temperature.h" void menu_job_recovery(); @@ -61,16 +64,15 @@ inline void plr_error(FSTR_P const prefix) { /** * M1000: Resume from power-loss (undocumented) * - With 'S' go to the Resume/Cancel menu + * ...unless the bed temperature is already above a configured minimum temperature. * - With no parameters, run recovery commands */ void GcodeSuite::M1000() { if (recovery.valid()) { - bool force_resume = false; - if (thermalManager.degBed() >= recovery.bed_temp_threshold) - force_resume = true; + const bool force_resume = TERN0(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold && (thermalManager.degBed() >= recovery.bed_temp_threshold)); - if (parser.seen_test('S') && !force_resume) { + if (!force_resume && parser.seen_test('S')) { #if HAS_MARLINUI_MENU ui.goto_screen(menu_job_recovery); #elif HAS_DWIN_E3V2_BASIC diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 5e508d4f28ae..8cbe468476b3 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -35,6 +35,9 @@ * Parameters * S[bool] - Flag to enable / disable. * If omitted, report current state. + * + * With PLR_BED_THRESHOLD: + * B Bed Temperature above which recovery will proceed without asking permission. */ void GcodeSuite::M413() { @@ -43,6 +46,11 @@ void GcodeSuite::M413() { else M413_report(); + #if HAS_PLR_BED_THRESHOLD + if (parser.seenval('B')) + recovery.bed_temp_threshold = parser.value_celsius(); + #endif + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) if (parser.seen("RL")) recovery.load(); if (parser.seen_test('W')) recovery.save(true); @@ -57,7 +65,11 @@ void GcodeSuite::M413() { void GcodeSuite::M413_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F(STR_POWER_LOSS_RECOVERY)); - SERIAL_ECHOPGM(" M413 S", AS_DIGIT(recovery.enabled), " ; "); + SERIAL_ECHOPGM(" M413 S", AS_DIGIT(recovery.enabled) + #if HAS_PLR_BED_THRESHOLD + , " B", recovery.bed_temp_threshold + #endif + ); serialprintln_onoff(recovery.enabled); } diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index f62714df4b62..251f3a0d8f35 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1345,3 +1345,8 @@ #if DISABLED(INCH_MODE_SUPPORT) #undef MANUAL_MOVE_DISTANCE_IN #endif + +// Power-Loss Recovery +#if ENABLED(POWER_LOSS_RECOVERY) && defined(PLR_BED_THRESHOLD) + #define HAS_PLR_BED_THRESHOLD 1 +#endif diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index eaabb06271be..4d2ce428e911 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -640,7 +640,9 @@ void menu_configuration() { #if ENABLED(POWER_LOSS_RECOVERY) EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); - EDIT_ITEM(int3, MSG_BED_TEMP_RECOVERY, &recovery.bed_temp_threshold, 0, BED_MAXTEMP); + #if HAS_PLR_BED_THRESHOLD + EDIT_ITEM(int3, MSG_BED_TEMP_RECOVERY, &recovery.bed_temp_threshold, 0, BED_MAX_TARGET); + #endif #endif // Preheat configurations diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 53f7e6e8904c..817f0eec0485 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -448,7 +448,7 @@ typedef struct SettingsDataStruct { // POWER_LOSS_RECOVERY // bool recovery_enabled; // M413 S - uint16_t recovery_threshold; + celsius_t bed_temp_threshold; // M413 B // // FWRETRACT @@ -1274,12 +1274,10 @@ void MarlinSettings::postprocess() { // { _FIELD_TEST(recovery_enabled); - const bool recovery_enabled = TERN(POWER_LOSS_RECOVERY, recovery.enabled, ENABLED(PLR_ENABLED_DEFAULT)); + const bool recovery_enabled = TERN0(POWER_LOSS_RECOVERY, recovery.enabled); + const celsius_t bed_temp_threshold = TERN0(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold); EEPROM_WRITE(recovery_enabled); - - _FIELD_TEST(recovery_threshold); - const uint16_t recovery_threshold = TERN(POWER_LOSS_RECOVERY, recovery.bed_temp_threshold,PLR_BED_THRESHOLD); - EEPROM_WRITE(recovery_threshold); + EEPROM_WRITE(bed_temp_threshold); } // @@ -2321,15 +2319,15 @@ void MarlinSettings::postprocess() { // Power-Loss Recovery // { - bool recovery_enabled; _FIELD_TEST(recovery_enabled); + bool recovery_enabled; + celsius_t bed_temp_threshold; EEPROM_READ(recovery_enabled); - TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.enabled = recovery_enabled); - - int16_t recovery_threshold; - _FIELD_TEST(recovery_threshold); - EEPROM_READ(recovery_threshold); - TERN_(POWER_LOSS_RECOVERY, if (!validating) recovery.bed_temp_threshold = recovery_threshold); + EEPROM_READ(bed_temp_threshold); + if (!validating) { + TERN_(POWER_LOSS_RECOVERY, recovery.enabled = recovery_enabled); + TERN_(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold = bed_temp_threshold); + } } // @@ -3479,8 +3477,11 @@ void MarlinSettings::reset() { // // Power-Loss Recovery // - TERN_(POWER_LOSS_RECOVERY, recovery.enable(ENABLED(PLR_ENABLED_DEFAULT))); - TERN_(POWER_LOSS_RECOVERY, recovery.bed_temp_threshold = PLR_BED_THRESHOLD); + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.enable(ENABLED(PLR_ENABLED_DEFAULT)); + TERN(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold = PLR_BED_THRESHOLD); + #endif + // // Firmware Retraction // From 83b15a68ae8309ec79bcb80969632e0d7cf8e566 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jan 2024 22:03:37 -0600 Subject: [PATCH 3/7] typo --- Marlin/src/module/settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 817f0eec0485..e5051d7f7a76 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3479,7 +3479,7 @@ void MarlinSettings::reset() { // #if ENABLED(POWER_LOSS_RECOVERY) recovery.enable(ENABLED(PLR_ENABLED_DEFAULT)); - TERN(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold = PLR_BED_THRESHOLD); + TERN_(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold = PLR_BED_THRESHOLD); #endif // From 32a80e4924b59b68ab5a109af41f0377f2c851b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jan 2024 22:14:46 -0600 Subject: [PATCH 4/7] fix some temp limits --- Marlin/src/HAL/shared/servo.cpp | 12 ++++++------ Marlin/src/gcode/bedlevel/G26.cpp | 2 +- Marlin/src/inc/Conditionals_post.h | 8 ++++---- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 ++-- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 3 +-- .../src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 4 ++-- .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 6 +++--- .../lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 18 +++++++++++------- .../lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 18 +++++++++++------- Marlin/src/lcd/menu/menu_configuration.cpp | 16 ++++++++-------- Marlin/src/module/temperature.cpp | 6 +++--- Marlin/src/module/temperature.h | 2 +- 13 files changed, 54 insertions(+), 47 deletions(-) diff --git a/Marlin/src/HAL/shared/servo.cpp b/Marlin/src/HAL/shared/servo.cpp index bb9d61801841..543bc8e873ae 100644 --- a/Marlin/src/HAL/shared/servo.cpp +++ b/Marlin/src/HAL/shared/servo.cpp @@ -60,8 +60,8 @@ ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures uint8_t ServoCount = 0; // the total number of attached servos -#define SERVO_MIN(v) (MIN_PULSE_WIDTH - (v) * 4) // minimum value in uS for this servo -#define SERVO_MAX(v) (MAX_PULSE_WIDTH - (v) * 4) // maximum value in uS for this servo +#define SERVO_MIN_US(v) (MIN_PULSE_WIDTH - (v) * 4) // minimum value in uS for this servo +#define SERVO_MAX_US(v) (MAX_PULSE_WIDTH - (v) * 4) // maximum value in uS for this servo /************ static functions common to all instances ***********************/ @@ -117,7 +117,7 @@ void Servo::detach() { void Servo::write(int value) { if (value < MIN_PULSE_WIDTH) // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds) - value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN(min), SERVO_MAX(max)); + value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN_US(min), SERVO_MAX_US(max)); writeMicroseconds(value); } @@ -126,8 +126,8 @@ void Servo::writeMicroseconds(int value) { byte channel = servoIndex; if (channel < MAX_SERVOS) { // ensure channel is valid // ensure pulse width is valid - value = constrain(value, SERVO_MIN(min), SERVO_MAX(max)) - (TRIM_DURATION); - value = usToTicks(value); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009 + LIMIT(value, SERVO_MIN_US(min), SERVO_MAX_US(max)); + value = usToTicks(value - (TRIM_DURATION)); // convert to ticks after compensating for interrupt overhead - 12 Aug 2009 CRITICAL_SECTION_START(); servo_info[channel].ticks = value; @@ -136,7 +136,7 @@ void Servo::writeMicroseconds(int value) { } // return the value as degrees -int Servo::read() { return map(readMicroseconds() + 1, SERVO_MIN(min), SERVO_MAX(max), 0, 180); } +int Servo::read() { return map(readMicroseconds() + 1, SERVO_MIN_US(min), SERVO_MAX_US(max), 0, 180); } int Servo::readMicroseconds() { return (servoIndex == INVALID_SERVO) ? 0 : ticksToUs(servo_info[servoIndex].ticks) + (TRIM_DURATION); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 30643cb84e9b..197df7ade0f9 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -613,7 +613,7 @@ void GcodeSuite::G26() { // If any preset or temperature was specified if (noztemp) { - if (!WITHIN(noztemp, 165, (HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT))) { + if (!WITHIN(noztemp, 165, thermalManager.hotend_max_target(active_extruder))) { SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); return; } diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 85b3a22cbf73..076f46bba866 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2458,7 +2458,7 @@ #ifndef BED_OVERSHOOT #define BED_OVERSHOOT 10 #endif - #define BED_MAX_TARGET (BED_MAXTEMP - (BED_OVERSHOOT)) + #define BED_MAX_TARGET ((BED_MAXTEMP) - (BED_OVERSHOOT)) #else #undef PIDTEMPBED #undef PREHEAT_BEFORE_LEVELING @@ -2469,8 +2469,8 @@ #ifndef COOLER_OVERSHOOT #define COOLER_OVERSHOOT 2 #endif - #define COOLER_MIN_TARGET (COOLER_MINTEMP + (COOLER_OVERSHOOT)) - #define COOLER_MAX_TARGET (COOLER_MAXTEMP - (COOLER_OVERSHOOT)) + #define COOLER_MIN_TARGET ((COOLER_MINTEMP) + (COOLER_OVERSHOOT)) + #define COOLER_MAX_TARGET ((COOLER_MAXTEMP) - (COOLER_OVERSHOOT)) #endif #if HAS_HEATED_BED || HAS_TEMP_CHAMBER @@ -2486,7 +2486,7 @@ #ifndef CHAMBER_OVERSHOOT #define CHAMBER_OVERSHOOT 10 #endif - #define CHAMBER_MAX_TARGET (CHAMBER_MAXTEMP - (CHAMBER_OVERSHOOT)) + #define CHAMBER_MAX_TARGET ((CHAMBER_MAXTEMP) - (CHAMBER_OVERSHOOT)) #else #undef PIDTEMPCHAMBER #endif diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 1cb2a2efedfb..803bb0d39e4f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -114,7 +114,7 @@ #define MAX_FLOW_RATE 299 #define MIN_FLOW_RATE 10 - #define MAX_E_TEMP (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT) + #define MAX_E_TEMP ((HEATER_0_MAXTEMP) - (HOTEND_OVERSHOOT)) #define MIN_E_TEMP 0 #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 8d54e0c582ec..8571510405e7 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -154,8 +154,8 @@ #endif // Editable temperature limits -#define MIN_ETEMP 0 -#define MAX_ETEMP (thermalManager.hotend_maxtemp[0] - (HOTEND_OVERSHOOT)) +#define MIN_ETEMP 0 +#define MAX_ETEMP thermalManager.hotend_max_target(0) #define MIN_BEDTEMP 0 #define MAX_BEDTEMP BED_MAX_TARGET diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 8b073652b044..f8cba1567694 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -697,8 +697,7 @@ void AnycubicTFT::getCommandFromTFT() { case 18: { // A18 set fan speed float fanPercent; if (codeSeen('S')) { - fanPercent = codeValue(); - fanPercent = constrain(fanPercent, 0, 100); + fanPercent = constrain(codeValue(), 0, 100); setTargetFan_percent(fanPercent, FAN0); } else diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index 3209aa76f248..ed4f8c73673a 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -1011,7 +1011,7 @@ namespace Anycubic { #if HAS_HOTEND else if (control_index == TXT_HOTEND_TARGET || control_index == TXT_ADJUST_HOTEND) { // hotend target temp control_value = (uint16_t(data_buf[4]) << 8) | uint16_t(data_buf[5]); - temp = constrain(uint16_t(control_value), 0, HEATER_0_MAXTEMP); + temp = constrain(uint16_t(control_value), 0, thermalManager.hotend_max_target(0)); setTargetTemp_celsius(temp, E0); //sprintf(str_buf,"%u/%u", (uint16_t)thermalManager.degHotend(0), uint16_t(control_value)); //sendTxtToTFT(str_buf, TXT_PRINT_HOTEND); @@ -1021,7 +1021,7 @@ namespace Anycubic { #if HAS_HEATED_BED else if (control_index == TXT_BED_TARGET || control_index == TXT_ADJUST_BED) {// bed target temp control_value = (uint16_t(data_buf[4]) << 8) | uint16_t(data_buf[5]); - temp = constrain(uint16_t(control_value), 0, BED_MAXTEMP); + temp = constrain(uint16_t(control_value), 0, BED_MAX_TARGET); setTargetTemp_celsius(temp, BED); //sprintf(str_buf,"%u/%u", uint16_t(thermalManager.degBed()), uint16_t(control_value)); //sendTxtToTFT(str_buf, TXT_PRINT_BED); diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index d440ea537539..dc2156a0e225 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -379,21 +379,21 @@ void DGUSScreenHandler::handleTemperatureChanged(DGUS_VP_Variable &var, void *va default: return; #if HAS_HOTEND case VP_T_E0_Set: - NOMORE(newvalue, HEATER_0_MAXTEMP); + NOMORE(newvalue, thermalManager.hotend_max_target(0)); thermalManager.setTargetHotend(newvalue, 0); acceptedvalue = thermalManager.degTargetHotend(0); break; #endif #if HAS_MULTI_HOTEND case VP_T_E1_Set: - NOMORE(newvalue, HEATER_1_MAXTEMP); + NOMORE(newvalue, thermalManager.hotend_max_target(1)); thermalManager.setTargetHotend(newvalue, 1); acceptedvalue = thermalManager.degTargetHotend(1); break; #endif #if HAS_HEATED_BED case VP_T_Bed_Set: - NOMORE(newvalue, BED_MAXTEMP); + NOMORE(newvalue, BED_MAX_TARGET); thermalManager.setTargetBed(newvalue); acceptedvalue = thermalManager.degTargetBed(); break; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index aa58e8569229..9090e1343681 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -809,15 +809,19 @@ void DGUSRxHandler::pidSetTemp(DGUS_VP &vp, void *data_ptr) { switch (screen.pid_heater) { default: return; - case DGUS_Data::Heater::BED: - temp = constrain(temp, BED_MINTEMP, BED_MAX_TARGET); - break; - case DGUS_Data::Heater::H0: - temp = constrain(temp, HEATER_0_MINTEMP, (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT)); - break; + #if HAS_HEATED_BED + case DGUS_Data::Heater::BED: + LIMIT(temp, BED_MINTEMP, BED_MAX_TARGET); + break; + #endif + #if HAS_HOTEND + case DGUS_Data::Heater::H0: + LIMIT(temp, HEATER_0_MINTEMP, thermalManager.hotend_max_target(0)); + break; + #endif #if HAS_MULTI_HOTEND case DGUS_Data::Heater::H1: - temp = constrain(temp, HEATER_1_MINTEMP, (HEATER_1_MAXTEMP - HOTEND_OVERSHOOT)); + LIMIT(temp, HEATER_1_MINTEMP, thermalManager.hotend_max_target(0)); break; #endif } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index 037eafcc9424..e1952879f5d9 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -266,15 +266,19 @@ void DGUSTxHandler::tempMax(DGUS_VP &vp) { switch (vp.addr) { default: return; - case DGUS_Addr::TEMP_Max_Bed: - temp = BED_MAX_TARGET; - break; - case DGUS_Addr::TEMP_Max_H0: - temp = HEATER_0_MAXTEMP - HOTEND_OVERSHOOT; - break; + #if HAS_HEATED_BED + case DGUS_Addr::TEMP_Max_Bed: + temp = BED_MAX_TARGET; + break; + #endif + #if HAS_HOTEND + case DGUS_Addr::TEMP_Max_H0: + temp = thermalManager.hotend_max_target(0); + break; + #endif #if HAS_MULTI_HOTEND case DGUS_Addr::TEMP_Max_H1: - temp = HEATER_1_MAXTEMP - HOTEND_OVERSHOOT; + temp = thermalManager.hotend_max_target(1); break; #endif } diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 4d2ce428e911..e37677daa5ba 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -262,9 +262,9 @@ void menu_advanced_settings(); if (c.timeout) GCODES_ITEM(MSG_HOTEND_IDLE_DISABLE, F("M87")); EDIT_ITEM(int3, MSG_TIMEOUT, &c.timeout, 0, 999); - EDIT_ITEM(int3, MSG_TEMPERATURE, &c.trigger, 0, HEATER_0_MAXTEMP); - EDIT_ITEM(int3, MSG_HOTEND_IDLE_NOZZLE_TARGET, &c.nozzle_target, 0, HEATER_0_MAXTEMP); - EDIT_ITEM(int3, MSG_HOTEND_IDLE_BED_TARGET, &c.bed_target, 0, BED_MAXTEMP); + EDIT_ITEM(int3, MSG_TEMPERATURE, &c.trigger, 0, thermalManager.hotend_max_target(0)); + EDIT_ITEM(int3, MSG_HOTEND_IDLE_NOZZLE_TARGET, &c.nozzle_target, 0, thermalManager.hotend_max_target(0)); + EDIT_ITEM(int3, MSG_HOTEND_IDLE_BED_TARGET, &c.bed_target, 0, BED_MAX_TARGET); END_MENU(); } @@ -397,10 +397,10 @@ void menu_advanced_settings(); #if HAS_PREHEAT && DISABLED(SLIM_LCD_MENUS) void _menu_configuration_preheat_settings() { - #define _MINTEMP_ITEM(N) HEATER_##N##_MINTEMP, - #define _MAXTEMP_ITEM(N) HEATER_##N##_MAXTEMP, - #define MINTEMP_ALL _MIN(REPEAT(HOTENDS, _MINTEMP_ITEM) 999) - #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0) + #define _MIN_ITEM(N) HEATER_##N##_MINTEMP, + #define _MAX_ITEM(N) thermalManager.hotend_max_target(0), + #define MINTARGET_ALL _MIN(REPEAT(HOTENDS, _MIN_ITEM) 999) + #define MAXTARGET_ALL _MAX(REPEAT(HOTENDS, _MAX_ITEM) 0) const uint8_t m = MenuItemBase::itemIndex; START_MENU(); STATIC_ITEM_F(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT); @@ -410,7 +410,7 @@ void menu_advanced_settings(); EDIT_ITEM_N(percent, m, MSG_FAN_SPEED, &editable.uint8, 0, 255, []{ ui.material_preset[MenuItemBase::itemIndex].fan_speed = editable.uint8; }); #endif #if HAS_TEMP_HOTEND - EDIT_ITEM(int3, MSG_NOZZLE, &ui.material_preset[m].hotend_temp, MINTEMP_ALL, MAXTEMP_ALL - (HOTEND_OVERSHOOT)); + EDIT_ITEM(int3, MSG_NOZZLE, &ui.material_preset[m].hotend_temp, MINTARGET_ALL, MAXTARGET_ALL); #endif #if HAS_HEATED_BED EDIT_ITEM(int3, MSG_BED, &ui.material_preset[m].bed_temp, BED_MINTEMP, BED_MAX_TARGET); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index fc9e08fe7cac..150f382f970c 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -305,13 +305,13 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); // Sanity-check max readable temperatures #define CHECK_MAXTEMP_(N,M,S) static_assert( \ - S >= 998 || M <= _MAX(TT_NAME(S)[0].celsius, TT_NAME(S)[COUNT(TT_NAME(S)) - 1].celsius) - HOTEND_OVERSHOOT, \ + S >= 998 || M <= _MAX(TT_NAME(S)[0].celsius, TT_NAME(S)[COUNT(TT_NAME(S)) - 1].celsius) - (HOTEND_OVERSHOOT), \ "HEATER_" STRINGIFY(N) "_MAXTEMP (" STRINGIFY(M) ") is too high for thermistor_" STRINGIFY(S) ".h with HOTEND_OVERSHOOT=" STRINGIFY(HOTEND_OVERSHOOT) "."); #define CHECK_MAXTEMP(N) TERN(TEMP_SENSOR_##N##_IS_THERMISTOR, CHECK_MAXTEMP_, CODE_0)(N, HEATER_##N##_MAXTEMP, TEMP_SENSOR_##N) REPEAT(HOTENDS, CHECK_MAXTEMP) #if HAS_PREHEAT - #define CHECK_PREHEAT__(N,P,T,M) static_assert(T <= M - HOTEND_OVERSHOOT, "PREHEAT_" STRINGIFY(P) "_TEMP_HOTEND (" STRINGIFY(T) ") must be less than HEATER_" STRINGIFY(N) "_MAXTEMP (" STRINGIFY(M) ") - " STRINGIFY(HOTEND_OVERSHOOT) "."); + #define CHECK_PREHEAT__(N,P,T,M) static_assert(T <= (M) - (HOTEND_OVERSHOOT), "PREHEAT_" STRINGIFY(P) "_TEMP_HOTEND (" STRINGIFY(T) ") must be less than HEATER_" STRINGIFY(N) "_MAXTEMP (" STRINGIFY(M) ") - " STRINGIFY(HOTEND_OVERSHOOT) "."); #define CHECK_PREHEAT_(N,P) CHECK_PREHEAT__(N, P, PREHEAT_##P##_TEMP_HOTEND, HEATER_##N##_MAXTEMP) #define CHECK_PREHEAT(P) REPEAT2(HOTENDS, CHECK_PREHEAT_, P) #if PREHEAT_COUNT >= 1 @@ -1678,7 +1678,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T } float pid_output = power * 254.0f / mpc.heater_power + 1.0f; // Ensure correct quantization into a range of 0 to 127 - pid_output = constrain(pid_output, 0, MPC_MAX); + LIMIT(pid_output, 0, MPC_MAX); /* <-- add a slash to enable static uint32_t nexttime = millis() + 1000; diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 2acc1205b730..09f74bd4d70a 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -594,7 +594,7 @@ class Temperature { #if HAS_HOTEND static hotend_info_t temp_hotend[HOTENDS]; static constexpr celsius_t hotend_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); - static celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); } + static constexpr celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); } #endif #if HAS_HEATED_BED From 1dc411ecb381dc2efad3185986cd2a908fb338b8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jan 2024 22:19:40 -0600 Subject: [PATCH 5/7] add include --- Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp index e1952879f5d9..1212f715c008 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp @@ -31,7 +31,9 @@ #include "../ui_api.h" #include "../../../module/stepper.h" +#include "../../../module/temperature.h" #include "../../../module/printcounter.h" + #if ENABLED(ADVANCED_PAUSE_FEATURE) #include "../../../feature/pause.h" #endif From a9ee359358b69a266ad016f2bf70bbbcd6733f12 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jan 2024 22:22:38 -0600 Subject: [PATCH 6/7] type warn --- Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 4 ++-- Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index 9090e1343681..c953b417a53a 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -816,12 +816,12 @@ void DGUSRxHandler::pidSetTemp(DGUS_VP &vp, void *data_ptr) { #endif #if HAS_HOTEND case DGUS_Data::Heater::H0: - LIMIT(temp, HEATER_0_MINTEMP, thermalManager.hotend_max_target(0)); + LIMIT(temp, celsius_t(HEATER_0_MINTEMP), thermalManager.hotend_max_target(0)); break; #endif #if HAS_MULTI_HOTEND case DGUS_Data::Heater::H1: - LIMIT(temp, HEATER_1_MINTEMP, thermalManager.hotend_max_target(0)); + LIMIT(temp, celsius_t(HEATER_1_MINTEMP), thermalManager.hotend_max_target(0)); break; #endif } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 76aa3de8727e..703c56d1e116 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -51,7 +51,7 @@ uint16_t DGUSScreenHandler::filament_length = DGUS_DEFAULT_FILAMENT_LEN; char DGUSScreenHandler::gcode[] = ""; DGUS_Data::Heater DGUSScreenHandler::pid_heater = DGUS_Data::Heater::H0; -uint16_t DGUSScreenHandler::pid_temp = DGUS_PLA_TEMP_HOTEND; +celsius_t DGUSScreenHandler::pid_temp = DGUS_PLA_TEMP_HOTEND; uint8_t DGUSScreenHandler::pid_cycles = 5; bool DGUSScreenHandler::settings_ready = false; diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index 27f7f92517ca..e5942ad44d5b 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -106,7 +106,7 @@ class DGUSScreenHandler { static char gcode[DGUS_GCODE_LEN + 1]; static DGUS_Data::Heater pid_heater; - static uint16_t pid_temp; + static celsius_t pid_temp; static uint8_t pid_cycles; static bool wait_continue; From 921b0ed6af15bc192c3ee5ebf66d8e4b86f23b04 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 9 Jan 2024 22:30:22 -0600 Subject: [PATCH 7/7] shorten menu item --- Marlin/src/lcd/language/language_en.h | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 3af05682a7b2..03ec692e4db4 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -499,7 +499,7 @@ namespace LanguageNarrow_en { LSTR MSG_RESUME_PRINT = _UxGT("Resume Print"); LSTR MSG_STOP_PRINT = _UxGT("Stop Print"); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Power Outage"); - LSTR MSG_BED_TEMP_RECOVERY = _UxGT("Bed temp threshold"); + LSTR MSG_RESUME_BED_TEMP = _UxGT("Resume Bed Temp"); LSTR MSG_HOST_START_PRINT = _UxGT("Host Start"); LSTR MSG_PRINTING_OBJECT = _UxGT("Print Obj"); LSTR MSG_CANCEL_OBJECT = _UxGT("Cancel Obj"); diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index e37677daa5ba..44021ce35ad0 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -641,7 +641,7 @@ void menu_configuration() { #if ENABLED(POWER_LOSS_RECOVERY) EDIT_ITEM(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); #if HAS_PLR_BED_THRESHOLD - EDIT_ITEM(int3, MSG_BED_TEMP_RECOVERY, &recovery.bed_temp_threshold, 0, BED_MAX_TARGET); + EDIT_ITEM(int3, MSG_RESUME_BED_TEMP, &recovery.bed_temp_threshold, 0, BED_MAX_TARGET); #endif #endif