From 367cea0d0dfdf71464faf1422f46417388139306 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 17 Mar 2025 22:35:20 -0400 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=9A=B8=20Chamber=20Preheat=20completi?= =?UTF-8?q?on=20(#26864)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #21156 Co-authored-by: Scott Lahteine --- Marlin/src/gcode/lcd/M145.cpp | 5 +++ Marlin/src/gcode/temp/M141_M191.cpp | 9 ++++- Marlin/src/lcd/extui/ui_api.cpp | 3 ++ Marlin/src/lcd/extui/ui_api.h | 3 ++ Marlin/src/lcd/language/language_en.h | 3 ++ Marlin/src/lcd/marlinui.cpp | 8 ++--- Marlin/src/lcd/marlinui.h | 3 ++ Marlin/src/lcd/menu/menu_configuration.cpp | 3 ++ Marlin/src/lcd/menu/menu_temperature.cpp | 39 +++++++++++++--------- Marlin/src/module/settings.cpp | 10 ++++-- Marlin/src/module/temperature.h | 2 +- 11 files changed, 64 insertions(+), 24 deletions(-) diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 3cc6130dfd..a0aa340d0d 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -37,6 +37,7 @@ * S * H * B + * C * F */ void GcodeSuite::M145() { @@ -53,6 +54,10 @@ void GcodeSuite::M145() { if (parser.seenval('B')) mat.bed_temp = constrain(parser.value_int(), BED_MINTEMP, BED_MAX_TARGET); #endif + #if HAS_HEATED_CHAMBER + if (parser.seenval('C')) + mat.chamber_temp = constrain(parser.value_int(), CHAMBER_MINTEMP, CHAMBER_MAX_TARGET); + #endif #if HAS_FAN if (parser.seenval('F')) mat.fan_speed = constrain(parser.value_int(), 0, 255); diff --git a/Marlin/src/gcode/temp/M141_M191.cpp b/Marlin/src/gcode/temp/M141_M191.cpp index 81a078318a..3364fbc22e 100644 --- a/Marlin/src/gcode/temp/M141_M191.cpp +++ b/Marlin/src/gcode/temp/M141_M191.cpp @@ -39,9 +39,16 @@ */ void GcodeSuite::M141() { if (DEBUGGING(DRYRUN)) return; + // Accept 'I' if temperature presets are defined + #if HAS_PREHEAT + if (parser.seenval('I')) { + const uint8_t index = parser.value_byte(); + thermalManager.setTargetChamber(ui.material_preset[_MIN(index, PREHEAT_COUNT - 1)].chamber_temp); + return; + } + #endif if (parser.seenval('S')) { thermalManager.setTargetChamber(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) /** * Stop the timer at the end of print. Hotend, bed target, and chamber diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index a53b5f5dba..5b6caf378a 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -811,6 +811,9 @@ namespace ExtUI { #if HAS_HEATED_BED uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; } #endif + #if HAS_HEATED_CHAMBER + uint16_t getMaterial_preset_C(const uint16_t index) { return ui.material_preset[index].chamber_temp; } + #endif #endif feedRate_t getFeedrate_mm_s() { return feedrate_mm_s; } diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 2676d72aea..dfe393e39a 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -214,6 +214,9 @@ namespace ExtUI { #if HAS_HEATED_BED uint16_t getMaterial_preset_B(const uint16_t); #endif + #if HAS_HEATED_CHAMBER + uint16_t getMaterial_preset_C(const uint16_t); + #endif #endif // IDEX Machine Mode diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index b033dc3c74..6076c6fb30 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -155,6 +155,7 @@ namespace LanguageNarrow_en { LSTR MSG_PREHEAT_M_END_E = _UxGT("Preheat $ End ~"); LSTR MSG_PREHEAT_M_ALL = _UxGT("Preheat $ All"); LSTR MSG_PREHEAT_M_BEDONLY = _UxGT("Preheat $ Bed"); + LSTR MSG_PREHEAT_M_CHAMBER = _UxGT("Preheat $ Chmb"); LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Preheat $ Conf"); LSTR MSG_PREHEAT_HOTEND = _UxGT("Preheat Hotend"); @@ -1109,6 +1110,8 @@ namespace LanguageWide_en { LSTR MSG_HOMING_FEEDRATE_Y = _UxGT("Y Homing Feedrate"); LSTR MSG_HOMING_FEEDRATE_Z = _UxGT("Z Homing Feedrate"); LSTR MSG_EEPROM_INITIALIZED = _UxGT("Default Settings Restored"); + LSTR MSG_PREHEAT_M_CHAMBER = _UxGT("Preheat $ Chamber"); + LSTR MSG_PREHEAT_M_SETTINGS = _UxGT("Preheat $ Config"); #endif } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index e8946edb28..bd974d8d0a 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -150,10 +150,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; void MarlinUI::apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e/*=active_extruder*/) { const preheat_t &pre = material_preset[m]; - TERN_(HAS_HOTEND, if (TEST(pmask, PT_HOTEND)) thermalManager.setTargetHotend(pre.hotend_temp, e)); - TERN_(HAS_HEATED_BED, if (TEST(pmask, PT_BED)) thermalManager.setTargetBed(pre.bed_temp)); - //TERN_(HAS_HEATED_CHAMBER, if (TEST(pmask, PT_CHAMBER)) thermalManager.setTargetChamber(pre.chamber_temp)); - TERN_(HAS_FAN, if (TEST(pmask, PT_FAN)) thermalManager.set_fan_speed(0, pre.fan_speed)); + TERN_(HAS_HOTEND, if (TEST(pmask, PT_HOTEND)) thermalManager.setTargetHotend(pre.hotend_temp, e)); + TERN_(HAS_HEATED_BED, if (TEST(pmask, PT_BED)) thermalManager.setTargetBed(pre.bed_temp)); + TERN_(HAS_HEATED_CHAMBER, if (TEST(pmask, PT_CHAMBER)) thermalManager.setTargetChamber(pre.chamber_temp)); + TERN_(HAS_FAN, if (TEST(pmask, PT_FAN)) thermalManager.set_fan_speed(0, pre.fan_speed)); } #endif diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index a47096a3bf..26b559e6bc 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -118,6 +118,9 @@ typedef bool (*statusResetFunc_t)(); #if HAS_HEATED_BED celsius_t bed_temp; #endif + #if HAS_HEATED_CHAMBER + celsius_t chamber_temp; + #endif #if HAS_FAN uint16_t fan_speed; #endif diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 65a2f222ce..c581bab4e3 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -451,6 +451,9 @@ void menu_advanced_settings(); #if HAS_HEATED_BED EDIT_ITEM(int3, MSG_BED, &ui.material_preset[m].bed_temp, BED_MINTEMP, BED_MAX_TARGET); #endif + #if HAS_HEATED_CHAMBER + EDIT_ITEM(int3, MSG_CHAMBER, &ui.material_preset[m].chamber_temp, CHAMBER_MINTEMP, CHAMBER_MAX_TARGET); + #endif #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); #endif diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index e8a7b25dcb..1a43b121ce 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -45,15 +45,17 @@ #if HAS_PREHEAT - void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) { - UNUSED(e); UNUSED(indh); UNUSED(indb); + void Temperature::lcd_preheat(const uint8_t e, const int8_t indh/*=-1*/, const int8_t indb/*=-1*/, const int8_t indc/*=-1*/) { + UNUSED(e); UNUSED(indh); UNUSED(indb); UNUSED(indc); #if HAS_HOTEND - if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) - setTargetHotend(_MIN(thermalManager.hotend_max_target(e), ui.material_preset[indh].hotend_temp), e); + if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) setTargetHotend(ui.material_preset[indh].hotend_temp, e); #endif #if HAS_HEATED_BED if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); #endif + #if HAS_HEATED_CHAMBER + if (indc >= 0 && ui.material_preset[indc].chamber_temp > 0) setTargetChamber(ui.material_preset[indc].chamber_temp); + #endif #if HAS_FAN if (indh >= 0) { const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0; @@ -68,30 +70,33 @@ } #if HAS_TEMP_HOTEND - inline void _preheat_end(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); } - void do_preheat_end_m() { _preheat_end(editable.int8, 0); } + inline void _preheat_end(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(e, m); } + void do_preheat_end_m() { _preheat_end(0, editable.int8); } #endif #if HAS_HEATED_BED inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(0, -1, m); } #endif + #if HAS_HEATED_CHAMBER + inline void _preheat_chamber(const uint8_t m) { thermalManager.lcd_preheat(0, -1, -1, m); } + #endif #if HAS_COOLER - inline void _precool_laser(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); } - void do_precool_laser_m() { _precool_laser(editable.int8, thermalManager.temp_cooler.target); } + inline void _precool_laser(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(e, m); } + void do_precool_laser_m() { _precool_laser(thermalManager.temp_cooler.target, editable.int8); } #endif - #if HAS_TEMP_HOTEND && HAS_HEATED_BED - inline void _preheat_both(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, m); } + #if HAS_TEMP_HOTEND && (HAS_HEATED_BED || HAS_HEATED_CHAMBER) + inline void _preheat_all(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(e, m, m, m); } // Indexed "Preheat ABC" and "Heat Bed" items #define PREHEAT_ITEMS(M,E) do{ \ - ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_both(M, MenuItemBase::itemIndex); }); \ - ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(M, MenuItemBase::itemIndex); }); \ + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_all(MenuItemBase::itemIndex, M); }); \ + ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_END_E, []{ _preheat_end(MenuItemBase::itemIndex, M); }); \ }while(0) #elif HAS_MULTI_HOTEND // No heated bed, so just indexed "Preheat ABC" items - #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(M, MenuItemBase::itemIndex); }) + #define PREHEAT_ITEMS(M,E) ACTION_ITEM_N_f(E, ui.get_preheat_label(M), MSG_PREHEAT_M_H, []{ _preheat_end(MenuItemBase::itemIndex, M); }) #endif @@ -107,8 +112,8 @@ #if HOTENDS == 1 - #if HAS_HEATED_BED - ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_both(editable.int8, 0); }); + #if HAS_HEATED_BED || HAS_HEATED_CHAMBER + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, []{ _preheat_all(0, editable.int8); }); ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_END, do_preheat_end_m); #else ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M, do_preheat_end_m); @@ -129,6 +134,10 @@ ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_BEDONLY, []{ _preheat_bed(editable.int8); }); #endif + #if HAS_HEATED_CHAMBER + ACTION_ITEM_f(ui.get_preheat_label(m), MSG_PREHEAT_M_CHAMBER, []{ _preheat_chamber(editable.int8); }); + #endif + END_MENU(); } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 485d01066a..8c33e73f00 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3564,13 +3564,17 @@ void MarlinSettings::reset() { #if HAS_HEATED_BED constexpr uint16_t bpre[] = { REPEAT2_S(1, INCREMENT(PREHEAT_COUNT), _PITEM, TEMP_BED) }; #endif + #if HAS_HEATED_CHAMBER + constexpr uint16_t cpre[] = { REPEAT2_S(1, INCREMENT(PREHEAT_COUNT), _PITEM, TEMP_CHAMBER) }; + #endif #if HAS_FAN constexpr uint8_t fpre[] = { REPEAT2_S(1, INCREMENT(PREHEAT_COUNT), _PITEM, FAN_SPEED) }; #endif for (uint8_t i = 0; i < PREHEAT_COUNT; ++i) { - TERN_(HAS_HOTEND, ui.material_preset[i].hotend_temp = hpre[i]); - TERN_(HAS_HEATED_BED, ui.material_preset[i].bed_temp = bpre[i]); - TERN_(HAS_FAN, ui.material_preset[i].fan_speed = fpre[i]); + TERN_(HAS_HOTEND, ui.material_preset[i].hotend_temp = hpre[i]); + TERN_(HAS_HEATED_BED, ui.material_preset[i].bed_temp = bpre[i]); + TERN_(HAS_HEATED_CHAMBER, ui.material_preset[i].chamber_temp = cpre[i]); + TERN_(HAS_FAN, ui.material_preset[i].fan_speed = fpre[i]); } #endif diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 27e28f07a8..cc25cfad14 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -1335,7 +1335,7 @@ class Temperature { #endif #if HAS_MARLINUI_MENU && HAS_TEMPERATURE && HAS_PREHEAT - static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb); + static void lcd_preheat(const uint8_t e, const int8_t indh=-1, const int8_t indb=-1, const int8_t indc=-1); #endif private: From 4ad6fa59df95d175c0acb49c33c2cf83fee5d449 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 18 Mar 2025 18:22:22 -0500 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20More=20?= =?UTF-8?q?extensible=20Temperature::lcd=5Fpreheat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_temperature.cpp | 32 +++++++++++++++--------- Marlin/src/module/temperature.h | 12 ++++++++- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 1a43b121ce..0a376494e5 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -45,47 +45,55 @@ #if HAS_PREHEAT - void Temperature::lcd_preheat(const uint8_t e, const int8_t indh/*=-1*/, const int8_t indb/*=-1*/, const int8_t indc/*=-1*/) { - UNUSED(e); UNUSED(indh); UNUSED(indb); UNUSED(indc); + /** + * @fn Temperature::lcd_preheat + * @brief Apply the "preheat" parameters for a material preset to the + * hotend (or laser), bed, chamber, or all of the above. + * @param m Material index + * @param targets Bit mask of targets to "preheat" (or turn off) + * @param e Extruder index (if needed) + */ + void Temperature::lcd_preheat(const uint8_t m, const uint8_t targets, const uint8_t e/*=0*/) { + UNUSED(e); #if HAS_HOTEND - if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) setTargetHotend(ui.material_preset[indh].hotend_temp, e); + if (targets & PreheatTarget::HOTEND) setTargetHotend(ui.material_preset[m].hotend_temp, e); #endif #if HAS_HEATED_BED - if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); + if (targets & PreheatTarget::BED) setTargetBed(ui.material_preset[m].bed_temp); #endif #if HAS_HEATED_CHAMBER - if (indc >= 0 && ui.material_preset[indc].chamber_temp > 0) setTargetChamber(ui.material_preset[indc].chamber_temp); + if (targets & PreheatTarget::CHAMBER) setTargetChamber(ui.material_preset[m].chamber_temp); #endif #if HAS_FAN - if (indh >= 0) { + if (targets & PreheatTarget::HOTEND) { const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0; if (true #if REDUNDANT_PART_COOLING_FAN && fan_index != REDUNDANT_PART_COOLING_FAN #endif - ) set_fan_speed(fan_index, ui.material_preset[indh].fan_speed); + ) set_fan_speed(fan_index, ui.material_preset[m].fan_speed); } #endif ui.return_to_status(); } #if HAS_TEMP_HOTEND - inline void _preheat_end(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(e, m); } + inline void _preheat_end(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::HOTEND, e); } void do_preheat_end_m() { _preheat_end(0, editable.int8); } #endif #if HAS_HEATED_BED - inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(0, -1, m); } + inline void _preheat_bed(const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::BED); } #endif #if HAS_HEATED_CHAMBER - inline void _preheat_chamber(const uint8_t m) { thermalManager.lcd_preheat(0, -1, -1, m); } + inline void _preheat_chamber(const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::CHAMBER); } #endif #if HAS_COOLER - inline void _precool_laser(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(e, m); } + inline void _precool_laser(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::HOTEND, e); } void do_precool_laser_m() { _precool_laser(thermalManager.temp_cooler.target, editable.int8); } #endif #if HAS_TEMP_HOTEND && (HAS_HEATED_BED || HAS_HEATED_CHAMBER) - inline void _preheat_all(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(e, m, m, m); } + inline void _preheat_all(const uint8_t e, const uint8_t m) { thermalManager.lcd_preheat(m, PreheatTarget::ALL, e); } // Indexed "Preheat ABC" and "Heat Bed" items #define PREHEAT_ITEMS(M,E) do{ \ diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index cc25cfad14..5f7ea8daf4 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -599,6 +599,15 @@ typedef struct { raw_adc_t raw_min, raw_max; celsius_t mintemp, maxtemp; } temp_ #define HAS_FAN_LOGIC 1 #endif +#if HAS_MARLINUI_MENU && HAS_TEMPERATURE && HAS_PREHEAT + enum PreheatTarget : uint8_t { + HOTEND = (1 << 0), + BED = (1 << 1), + CHAMBER = (1 << 2), + ALL = 0xFF + }; +#endif + class Temperature { public: @@ -1335,7 +1344,8 @@ class Temperature { #endif #if HAS_MARLINUI_MENU && HAS_TEMPERATURE && HAS_PREHEAT - static void lcd_preheat(const uint8_t e, const int8_t indh=-1, const int8_t indb=-1, const int8_t indc=-1); + // Apply the "preheat" parameters for a material preset to the hotend (or laser), bed, chamber, or all of the above + static void lcd_preheat(const uint8_t m, const uint8_t targets, const uint8_t e=0); #endif private: From 23fa94178e1b1d00869058575eee0e7f06602839 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 19 Mar 2025 00:31:12 +0000 Subject: [PATCH 3/6] [cron] Bump distribution date (2025-03-19) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 6f5abc50e1..d2f7ac3ffd 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2025-03-18" +//#define STRING_DISTRIBUTION_DATE "2025-03-19" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a36c00865f..fbdc9cdd04 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2025-03-18" + #define STRING_DISTRIBUTION_DATE "2025-03-19" #endif /** From 15ee0d0e081fd42cf00a5b26b289a2ea14ddd9f5 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 19 Mar 2025 14:39:24 +1300 Subject: [PATCH 4/6] =?UTF-8?q?=E2=9C=A8=20MAG=5FMOUNTED=5FPROBE=5FSERVO?= =?UTF-8?q?=5FNR=20(#27551)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gjdodd --- Marlin/Configuration.h | 14 ++++++++++++++ Marlin/src/inc/Conditionals-3-etc.h | 5 ++++- Marlin/src/inc/Conditionals-4-adv.h | 4 ++++ Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/module/probe.cpp | 24 ++++++++++++++++++++++-- Marlin/src/module/servo.h | 7 +++++++ buildroot/tests/LPC1769 | 2 +- 7 files changed, 53 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6e16dc5caf..1202bc1e53 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1540,6 +1540,20 @@ #define PROBE_DEPLOY_FEEDRATE (133*60) // (mm/min) Probe deploy speed #define PROBE_STOW_FEEDRATE (133*60) // (mm/min) Probe stow speed + /** + * Magnetically Mounted Probe with a Servo mechanism + * Probe Deploy and Stow both follow the same basic sequence: + * - Rotate the SERVO to its Deployed angle + * - Perform XYZ moves to deploy or stow the PROBE + * - Rotate the SERVO to its Stowed angle + */ + //#define MAG_MOUNTED_PROBE_SERVO_NR 0 // Servo Number for this probe + #ifdef MAG_MOUNTED_PROBE_SERVO_NR + #define MAG_MOUNTED_PROBE_SERVO_ANGLES { 90, 0 } // Servo Angles for Deployed, Stowed + #define MAG_MOUNTED_PRE_DEPLOY { PROBE_DEPLOY_FEEDRATE, { 15, 160, 30 } } // Safe position for servo activation + #define MAG_MOUNTED_PRE_STOW { PROBE_DEPLOY_FEEDRATE, { 15, 160, 30 } } // Safe position for servo deactivation + #endif + #define MAG_MOUNTED_DEPLOY_1 { PROBE_DEPLOY_FEEDRATE, { 245, 114, 30 } } // Move to side Dock & Attach probe #define MAG_MOUNTED_DEPLOY_2 { PROBE_DEPLOY_FEEDRATE, { 210, 114, 30 } } // Move probe off dock #define MAG_MOUNTED_DEPLOY_3 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed diff --git a/Marlin/src/inc/Conditionals-3-etc.h b/Marlin/src/inc/Conditionals-3-etc.h index 7f005c3539..e4dcdda58f 100644 --- a/Marlin/src/inc/Conditionals-3-etc.h +++ b/Marlin/src/inc/Conditionals-3-etc.h @@ -135,7 +135,10 @@ #ifdef Z_PROBE_SERVO_NR #define HAS_Z_SERVO_PROBE 1 #endif -#if ANY(HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE) +#ifdef MAG_MOUNTED_PROBE_SERVO_NR + #define HAS_MAG_MOUNTED_SERVO_PROBE 1 +#endif +#if ANY(HAS_Z_SERVO_PROBE, HAS_MAG_MOUNTED_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE) #define HAS_SERVO_ANGLES 1 #endif #if !HAS_SERVO_ANGLES diff --git a/Marlin/src/inc/Conditionals-4-adv.h b/Marlin/src/inc/Conditionals-4-adv.h index 103de78865..b697f22a20 100644 --- a/Marlin/src/inc/Conditionals-4-adv.h +++ b/Marlin/src/inc/Conditionals-4-adv.h @@ -53,6 +53,10 @@ #undef NUM_SERVOS #define NUM_SERVOS INCREMENT(Z_PROBE_SERVO_NR) #endif + #if HAS_MAG_MOUNTED_SERVO_PROBE && NUM_SERVOS <= MAG_MOUNTED_PROBE_SERVO_NR + #undef NUM_SERVOS + #define NUM_SERVOS INCREMENT(MAG_MOUNTED_PROBE_SERVO_NR) + #endif #if ENABLED(CHAMBER_VENT) && NUM_SERVOS <= CHAMBER_VENT_SERVO_NR #undef NUM_SERVOS #define NUM_SERVOS INCREMENT(CHAMBER_VENT_SERVO_NR) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e07fa78173..0029980ada 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -982,7 +982,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i /** * Servo deactivation depends on servo endstops, switching nozzle, or switching extruder */ -#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && NONE(HAS_Z_SERVO_PROBE, POLARGRAPH) && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR) +#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) && NONE(HAS_Z_SERVO_PROBE, POLARGRAPH) && !defined(SWITCHING_NOZZLE_SERVO_NR) && !defined(SWITCHING_EXTRUDER_SERVO_NR) && !defined(SWITCHING_TOOLHEAD_SERVO_NR) && !defined(MAG_MOUNTED_PROBE_SERVO_NR) #error "Z_PROBE_SERVO_NR, switching nozzle, switching toolhead, switching extruder, or POLARGRAPH is required for DEACTIVATE_SERVOS_AFTER_MOVE." #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index a66c11a782..e121bca812 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -82,7 +82,7 @@ #include "../feature/host_actions.h" // for PROMPT_USER_CONTINUE #endif -#if HAS_Z_SERVO_PROBE +#if HAS_Z_SERVO_PROBE || HAS_MAG_MOUNTED_SERVO_PROBE #include "servo.h" #endif @@ -272,6 +272,13 @@ xyz_pos_t Probe::offset; // Initialized by settings.load typedef struct { float fr_mm_min; xyz_pos_t where; } mag_probe_move_t; inline void run_deploy_moves() { + #ifdef MAG_MOUNTED_PRE_DEPLOY + constexpr mag_probe_move_t pre_deploy = MAG_MOUNTED_PRE_DEPLOY; + do_blocking_move_to(pre_deploy.where, MMM_TO_MMS(pre_deploy.fr_mm_min)); + #endif + #if HAS_MAG_MOUNTED_SERVO_PROBE + servo[MAG_MOUNTED_PROBE_SERVO_NR].move(servo_angles[MAG_MOUNTED_PROBE_SERVO_NR][0]); + #endif #ifdef MAG_MOUNTED_DEPLOY_1 constexpr mag_probe_move_t deploy_1 = MAG_MOUNTED_DEPLOY_1; do_blocking_move_to(deploy_1.where, MMM_TO_MMS(deploy_1.fr_mm_min)); @@ -292,9 +299,19 @@ xyz_pos_t Probe::offset; // Initialized by settings.load constexpr mag_probe_move_t deploy_5 = MAG_MOUNTED_DEPLOY_5; do_blocking_move_to(deploy_5.where, MMM_TO_MMS(deploy_5.fr_mm_min)); #endif + #if HAS_MAG_MOUNTED_SERVO_PROBE + servo[MAG_MOUNTED_PROBE_SERVO_NR].move(servo_angles[MAG_MOUNTED_PROBE_SERVO_NR][1]); + #endif } inline void run_stow_moves() { + #ifdef MAG_MOUNTED_PRE_STOW + constexpr mag_probe_move_t pre_stow = MAG_MOUNTED_PRE_STOW; + do_blocking_move_to(pre_stow.where, MMM_TO_MMS(pre_stow.fr_mm_min)); + #endif + #if HAS_MAG_MOUNTED_SERVO_PROBE + servo[MAG_MOUNTED_PROBE_SERVO_NR].move(servo_angles[MAG_MOUNTED_PROBE_SERVO_NR][0]); + #endif #ifdef MAG_MOUNTED_STOW_1 constexpr mag_probe_move_t stow_1 = MAG_MOUNTED_STOW_1; do_blocking_move_to(stow_1.where, MMM_TO_MMS(stow_1.fr_mm_min)); @@ -315,6 +332,9 @@ xyz_pos_t Probe::offset; // Initialized by settings.load constexpr mag_probe_move_t stow_5 = MAG_MOUNTED_STOW_5; do_blocking_move_to(stow_5.where, MMM_TO_MMS(stow_5.fr_mm_min)); #endif + #if HAS_MAG_MOUNTED_SERVO_PROBE + servo[MAG_MOUNTED_PROBE_SERVO_NR].move(servo_angles[MAG_MOUNTED_PROBE_SERVO_NR][1]); + #endif } #endif // MAG_MOUNTED_PROBE @@ -541,7 +561,7 @@ bool Probe::set_deployed(const bool deploy, const bool no_return/*=false*/) { #if ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) // Only deploy/stow if needed - if (PROBE_TRIGGERED() == deploy) { + if (PROBE_TRIGGERED() == deploy || !deploy) { if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early // otherwise an Allen-Key probe can't be stowed. probe_specific_action(deploy); diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index 3b6c33a8f7..f35a8c3930 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -63,6 +63,9 @@ #endif constexpr uint16_t sazp[] = Z_SERVO_ANGLES; static_assert(COUNT(sazp) == 2, "Z_SERVO_ANGLES needs 2 angles."); + #elif defined(MAG_MOUNTED_PROBE_SERVO_ANGLES) + constexpr uint16_t sazp[] = MAG_MOUNTED_PROBE_SERVO_ANGLES; + static_assert(COUNT(sazp) == 2, "MAG_MOUNTED_PROBE_SERVO_ANGLES needs 2 angles."); #else constexpr uint16_t sazp[2] = { 0 }; #endif @@ -82,6 +85,9 @@ #ifndef Z_PROBE_SERVO_NR #define Z_PROBE_SERVO_NR -1 #endif + #ifndef MAG_MOUNTED_PROBE_SERVO_NR + #define MAG_MOUNTED_PROBE_SERVO_NR -1 + #endif #define SASN(J,I) TERN(SWITCHING_NOZZLE_TWO_SERVOS, sasn[J][I], sasn[I]) @@ -91,6 +97,7 @@ : N == SWITCHING_NOZZLE_SERVO_NR ? SASN(0,I) \ : N == SWITCHING_NOZZLE_E1_SERVO_NR ? SASN(1,I) \ : N == Z_PROBE_SERVO_NR ? sazp[I] \ + : N == MAG_MOUNTED_PROBE_SERVO_NR ? sazp[I] \ : 0 ) #if ENABLED(EDITABLE_SERVO_ANGLES) diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769 index ad14e3353d..a97790e988 100755 --- a/buildroot/tests/LPC1769 +++ b/buildroot/tests/LPC1769 @@ -15,7 +15,7 @@ exec_test $1 $2 "Azteeg X5GT Example Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \ EXTRUDERS 2 TEMP_SENSOR_0 -5 TEMP_SENSOR_1 -4 TEMP_SENSOR_BED 5 TEMP_0_CS_PIN P1_29 \ - GRID_MAX_POINTS_X 16 \ + MAG_MOUNTED_PROBE_SERVO_NR 0 GRID_MAX_POINTS_X 16 \ NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING REPORT_ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \ From 719bb9c03bb0bc53d324f14bb6eef982e8cea4b1 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:14:58 +1300 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=94=A7=20LCD=5FPINS=5FENABLE=20=3D>?= =?UTF-8?q?=20LCD=5FPINS=5FEN=20(#27700)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/rp2040/pins_RP2040.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/pins/rp2040/pins_RP2040.h b/Marlin/src/pins/rp2040/pins_RP2040.h index 1b88ce347b..48e37e4e1f 100644 --- a/Marlin/src/pins/rp2040/pins_RP2040.h +++ b/Marlin/src/pins/rp2040/pins_RP2040.h @@ -320,13 +320,13 @@ #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define LCD_PINS_RS 49 // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE 51 // SID (MOSI) + #define LCD_PINS_EN 51 // SID (MOSI) #define LCD_PINS_D4 52 // SCK (CLK) clock #elif ALL(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS 40 - #define LCD_PINS_ENABLE 42 + #define LCD_PINS_EN 42 #define LCD_PINS_D4 65 #define LCD_PINS_D5 66 #define LCD_PINS_D6 44 @@ -337,7 +337,7 @@ #if ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS 27 - #define LCD_PINS_ENABLE 29 + #define LCD_PINS_EN 29 #define LCD_PINS_D4 25 #if !IS_NEWPANEL @@ -347,7 +347,7 @@ #elif ENABLED(ZONESTAR_LCD) #define LCD_PINS_RS 64 - #define LCD_PINS_ENABLE 44 + #define LCD_PINS_EN 44 #define LCD_PINS_D4 63 #define LCD_PINS_D5 40 #define LCD_PINS_D6 42 @@ -365,7 +365,7 @@ #define DOGLCD_A0 LCD_PINS_DC #else #define LCD_PINS_RS 16 - #define LCD_PINS_ENABLE 17 + #define LCD_PINS_EN 17 #define LCD_PINS_D4 23 #define LCD_PINS_D5 25 #define LCD_PINS_D6 27 From 4f3279fa315b4664349eeae96af62b505e8227ea Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Wed, 19 Mar 2025 03:21:30 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=9A=B8=20Move=20About=20/=20Games=20t?= =?UTF-8?q?o=20menu=20bottom=20(#26820)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_main.cpp | 56 ++++++++++++++----------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 6142e0e153..60f5c271c6 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -234,16 +234,6 @@ void menu_configuration(); #endif // CUSTOM_MENU_MAIN -#if ENABLED(ADVANCED_PAUSE_FEATURE) - // This menu item is last with an encoder. Otherwise, somewhere in the middle. - #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) - #define FILAMENT_CHANGE_ITEM() YESNO_ITEM(MSG_FILAMENTCHANGE, menu_change_filament, nullptr, \ - GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")) - #else - #define FILAMENT_CHANGE_ITEM() SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament) - #endif -#endif - void menu_main() { const bool busy = printingIsActive(); #if HAS_MEDIA @@ -348,7 +338,11 @@ void menu_main() { #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - FILAMENT_CHANGE_ITEM(); + #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) + YESNO_ITEM(MSG_FILAMENTCHANGE, menu_change_filament, nullptr, GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")); + #else + SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament); + #endif #endif #if HAS_TEMPERATURE @@ -381,10 +375,6 @@ void menu_main() { } #endif - #if ENABLED(LCD_INFO_MENU) - SUBMENU(MSG_INFO_MENU, menu_info); - #endif - #if ENABLED(LED_CONTROL_MENU) SUBMENU(MSG_LIGHTS, menu_led); #elif ALL(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) @@ -412,7 +402,6 @@ void menu_main() { #endif #if HAS_MEDIA && DISABLED(MEDIA_MENU_AT_TOP) - // BEGIN MEDIA MENU if (card_detected) { if (!card_open) { #if ENABLED(MENU_ADDAUTOSTART) @@ -449,7 +438,6 @@ void menu_main() { #endif #endif } - // END MEDIA MENU #endif #if HAS_SERVICE_INTERVALS @@ -482,7 +470,26 @@ void menu_main() { #endif #endif - #if HAS_GAMES && DISABLED(LCD_INFO_MENU) + #if HAS_MULTI_LANGUAGE + SUBMENU(LANGUAGE, menu_language); + #endif + + #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) + SUBMENU(MSG_HOST_SHUTDOWN, []{ + MenuItem_confirm::select_screen( + GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL), + []{ ui.return_to_status(); hostui.shutdown(); }, nullptr, + GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?") + ); + }); + #endif + + #if ENABLED(LCD_INFO_MENU) + + SUBMENU(MSG_INFO_MENU, menu_info); + + #elif HAS_GAMES + #if ENABLED(GAMES_EASTER_EGG) SKIP_ITEM(); SKIP_ITEM(); @@ -504,20 +511,7 @@ void menu_main() { #endif ); } - #endif - #if HAS_MULTI_LANGUAGE - SUBMENU(LANGUAGE, menu_language); - #endif - - #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - SUBMENU(MSG_HOST_SHUTDOWN, []{ - MenuItem_confirm::select_screen( - GET_TEXT_F(MSG_BUTTON_PROCEED), GET_TEXT_F(MSG_BUTTON_CANCEL), - []{ ui.return_to_status(); hostui.shutdown(); }, nullptr, - GET_TEXT_F(MSG_HOST_SHUTDOWN), (const char *)nullptr, F("?") - ); - }); #endif END_MENU();