Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c062777

Browse files
committedJul 27, 2022
🩹 Fix lcd_preheat compile
1 parent ec9635c commit c062777

File tree

6 files changed

+38
-30
lines changed

6 files changed

+38
-30
lines changed
 

‎Marlin/src/inc/SanityCheck.h

+4
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
913913
#error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
914914
#endif
915915

916+
#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI) && !defined(MANUAL_FEEDRATE)
917+
#error "MANUAL_FEEDRATE is required for MarlinUI, ExtUI, or FTDI EVE Touch UI."
918+
#endif
919+
916920
/**
917921
* Custom Boot and Status screens
918922
*/

‎Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,11 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
606606
break;
607607
#endif
608608

609-
case VP_BED_CONTROL:
610-
preheat_temp = PREHEAT_1_TEMP_BED;
611-
break;
609+
#if HAS_HEATED_BED
610+
case VP_BED_CONTROL:
611+
preheat_temp = PREHEAT_1_TEMP_BED;
612+
break;
613+
#endif
612614
}
613615

614616
*(int16_t*)var.memadr = *(int16_t*)var.memadr > 0 ? 0 : preheat_temp;

‎Marlin/src/lcd/extui/ui_api.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ namespace ExtUI {
10761076
void coolDown() { thermalManager.cooldown(); }
10771077

10781078
bool awaitingUserConfirm() {
1079-
return TERN0(HAS_RESUME_CONTINUE, wait_for_user) || getHostKeepaliveIsPaused();
1079+
return TERN0(HAS_RESUME_CONTINUE, wait_for_user) || TERN0(HOST_KEEPALIVE_FEATURE, getHostKeepaliveIsPaused());
10801080
}
10811081
void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); }
10821082

‎Marlin/src/lcd/menu/menu_filament.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ static void _change_filament_with_temp(const uint16_t celsius) {
6565
queue.inject(cmd);
6666
}
6767

68-
static void _change_filament_with_preset() {
69-
_change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp);
70-
}
68+
#if HAS_PREHEAT
69+
static void _change_filament_with_preset() {
70+
_change_filament_with_temp(ui.material_preset[MenuItemBase::itemIndex].hotend_temp);
71+
}
72+
#endif
7173

7274
static void _change_filament_with_custom() {
7375
_change_filament_with_temp(thermalManager.degTargetHotend(MenuItemBase::itemIndex));

‎Marlin/src/lcd/menu/menu_temperature.cpp

+22-22
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,30 @@
4747
// "Temperature" submenu items
4848
//
4949

50-
void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) {
51-
UNUSED(e); UNUSED(indh); UNUSED(indb);
52-
#if HAS_HOTEND
53-
if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0)
54-
setTargetHotend(_MIN(thermalManager.hotend_max_target(e), ui.material_preset[indh].hotend_temp), e);
55-
#endif
56-
#if HAS_HEATED_BED
57-
if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp);
58-
#endif
59-
#if HAS_FAN
60-
if (indh >= 0) {
61-
const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0;
62-
if (true
63-
#if REDUNDANT_PART_COOLING_FAN
64-
&& fan_index != REDUNDANT_PART_COOLING_FAN
65-
#endif
66-
) set_fan_speed(fan_index, ui.material_preset[indh].fan_speed);
67-
}
68-
#endif
69-
ui.return_to_status();
70-
}
71-
7250
#if HAS_PREHEAT
7351

52+
void Temperature::lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb) {
53+
UNUSED(e); UNUSED(indh); UNUSED(indb);
54+
#if HAS_HOTEND
55+
if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0)
56+
setTargetHotend(_MIN(thermalManager.hotend_max_target(e), ui.material_preset[indh].hotend_temp), e);
57+
#endif
58+
#if HAS_HEATED_BED
59+
if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp);
60+
#endif
61+
#if HAS_FAN
62+
if (indh >= 0) {
63+
const uint8_t fan_index = active_extruder < (FAN_COUNT) ? active_extruder : 0;
64+
if (true
65+
#if REDUNDANT_PART_COOLING_FAN
66+
&& fan_index != REDUNDANT_PART_COOLING_FAN
67+
#endif
68+
) set_fan_speed(fan_index, ui.material_preset[indh].fan_speed);
69+
}
70+
#endif
71+
ui.return_to_status();
72+
}
73+
7474
#if HAS_TEMP_HOTEND
7575
inline void _preheat_end(const uint8_t m, const uint8_t e) { thermalManager.lcd_preheat(e, m, -1); }
7676
void do_preheat_end_m() { _preheat_end(editable.int8, 0); }

‎Marlin/src/module/temperature.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ class Temperature {
10161016
static void set_heating_message(const uint8_t, const bool=false) {}
10171017
#endif
10181018

1019-
#if HAS_MARLINUI_MENU && HAS_TEMPERATURE
1019+
#if HAS_MARLINUI_MENU && HAS_TEMPERATURE && HAS_PREHEAT
10201020
static void lcd_preheat(const uint8_t e, const int8_t indh, const int8_t indb);
10211021
#endif
10221022

0 commit comments

Comments
 (0)
Please sign in to comment.