From 90b56452238f8ab673f564b657b979fd6a3a224b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 26 Jul 2022 21:15:44 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20lcd=5Fpreheat=20compile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 4 ++ .../src/lcd/extui/dgus/DGUSScreenHandler.cpp | 8 ++-- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu_filament.cpp | 8 ++-- Marlin/src/lcd/menu/menu_temperature.cpp | 44 +++++++++---------- Marlin/src/module/temperature.h | 2 +- 6 files changed, 38 insertions(+), 30 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 5286b9e61c..ed223cb6ec 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -913,6 +913,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu." #endif +#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI) && !defined(MANUAL_FEEDRATE) + #error "MANUAL_FEEDRATE is required for MarlinUI, ExtUI, or FTDI EVE Touch UI." +#endif + /** * Custom Boot and Status screens */ diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 88326466c0..0f34d76cfa 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -606,9 +606,11 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr break; #endif - case VP_BED_CONTROL: - preheat_temp = PREHEAT_1_TEMP_BED; - break; + #if HAS_HEATED_BED + case VP_BED_CONTROL: + preheat_temp = PREHEAT_1_TEMP_BED; + break; + #endif } *(int16_t*)var.memadr = *(int16_t*)var.memadr > 0 ? 0 : preheat_temp; diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 57822279c5..a711e6dd57 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -1076,7 +1076,7 @@ namespace ExtUI { void coolDown() { thermalManager.cooldown(); } bool awaitingUserConfirm() { - return TERN0(HAS_RESUME_CONTINUE, wait_for_user) || getHostKeepaliveIsPaused(); + return TERN0(HAS_RESUME_CONTINUE, wait_for_user) || TERN0(HOST_KEEPALIVE_FEATURE, getHostKeepaliveIsPaused()); } void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); } diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 5902a2f63f..122f0c4050 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -65,9 +65,11 @@ static void _change_filament_with_temp(const uint16_t celsius) { queue.inject(cmd); } -static void _change_filament_with_preset() { - _change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp); -} +#if HAS_PREHEAT + static void _change_filament_with_preset() { + _change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp); + } +#endif static void _change_filament_with_custom() { _change_filament_with_temp(thermalManager.degTargetHotend(MenuItemBase::itemIndex)); diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index e493972a97..2e5b8f1e54 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -47,30 +47,30 @@ // "Temperature" submenu items // -void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) { - UNUSED(e); UNUSED(indh); UNUSED(indb); - #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); - #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_FAN - if (indh >= 0) { - 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); - } - #endif - ui.return_to_status(); -} - #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); + #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); + #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_FAN + if (indh >= 0) { + 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); + } + #endif + ui.return_to_status(); + } + #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); } diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 80d15ce39e..feec318050 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -1016,7 +1016,7 @@ class Temperature { static void set_heating_message(const uint8_t, const bool=false) {} #endif - #if HAS_MARLINUI_MENU && HAS_TEMPERATURE + #if HAS_MARLINUI_MENU && HAS_TEMPERATURE && HAS_PREHEAT static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb); #endif