Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions Marlin/src/lcd/menu/menu_bed_leveling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ void do_level_hint(){
LCD_MESSAGEPGM(MSG_LEVEL_STATE);
}
void lcd_G29() {
#if ENABLED(PREHEAT_BEFORE_LEVELING)
const celsius_t hotendPreheat = (LEVELING_NOZZLE_TEMP-2) > thermalManager.degTargetHotend(0) ? LEVELING_NOZZLE_TEMP : 0;
const celsius_t bedPreheat = (LEVELING_BED_TEMP-2) > thermalManager.degTargetBed() ? LEVELING_BED_TEMP : 0;
if (hotendPreheat || bedPreheat) {
Expand All @@ -243,14 +244,23 @@ void lcd_G29() {
queue.inject_P(all_axes_trusted() ? PSTR("G29") : PSTR("G29N"));
ui.return_to_status();
}
}
#else
queue.inject_P(all_axes_trusted() ? PSTR("G29") : PSTR("G29N"));
ui.return_to_status();

#endif
}

#if ENABLED(PREHEAT_BEFORE_LEVELING)
void do_home_hint(){
thermalManager.setTargetHotend(LEVELING_NOZZLE_TEMP, 0);
thermalManager.setTargetBed(LEVELING_BED_TEMP);
ui.return_to_status();
}
}
#endif

void lcd_G28(){
#if ENABLED(PREHEAT_BEFORE_LEVELING)
const celsius_t hotendPreheat = (LEVELING_NOZZLE_TEMP-2) > thermalManager.temp_hotend[0].celsius ? LEVELING_NOZZLE_TEMP : 0;
const celsius_t bedPreheat = (LEVELING_BED_TEMP-2) > thermalManager.temp_bed.celsius ? LEVELING_BED_TEMP : 0;
if (hotendPreheat || bedPreheat) {
Expand All @@ -267,9 +277,16 @@ void lcd_G28(){
thermalManager.setTargetBed(LEVELING_BED_TEMP);
queue.inject_P(PSTR("G28\nG1 F240 Z0"));
ui.return_to_status();
}
}

#else
queue.inject_P(PSTR("G28\nG1 F240 Z0"));
ui.return_to_status();

#endif
}


/**
* Step 1: Bed Level entry-point
*
Expand Down