Show lcd_babystep_zoffset screen if DOUBLECLICK_FOR_Z_BABYSTEPPING is enabled and HAS_BED_PROBE is defined

This commit is contained in:
Thomas Moore 2017-04-14 23:00:35 -05:00 committed by Scott Lahteine
parent 3a40e637cd
commit 8dd0492e68

View File

@ -51,7 +51,11 @@ int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2
#if ENABLED(BABYSTEPPING)
long babysteps_done = 0;
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
static void lcd_babystep_zoffset();
#else
static void lcd_babystep_z();
#endif
#endif
uint8_t lcd_status_message_level;
@ -431,7 +435,13 @@ uint16_t max_display_update_time = 0;
doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL;
}
else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms))
screen = lcd_babystep_z;
screen =
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
lcd_babystep_zoffset
#else
lcd_babystep_z
#endif
;
#endif
currentScreen = screen;
@ -851,7 +861,7 @@ void kill_screen(const char* lcd_msg) {
void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; }
#endif
#if HAS_BED_PROBE
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
void lcd_babystep_zoffset() {
if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
@ -876,14 +886,14 @@ void kill_screen(const char* lcd_msg) {
lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));
}
#else // !HAS_BED_PROBE
#else // !BABYSTEP_ZPROBE_OFFSET
void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEPPING_Z)); }
void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; defer_return_to_status = true; }
#endif // HAS_BED_PROBE
#endif // !BABYSTEP_ZPROBE_OFFSET
#endif //BABYSTEPPING
#endif // BABYSTEPPING
#if ENABLED(AUTO_BED_LEVELING_UBL)
@ -1072,10 +1082,10 @@ void kill_screen(const char* lcd_msg) {
MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N4, &flow_percentage[3], 10, 999);
#if EXTRUDERS > 4
MENU_ITEM_EDIT(int3, MSG_FLOW MSG_N5, &flow_percentage[4], 10, 999);
#endif //EXTRUDERS > 4
#endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1
#endif // EXTRUDERS > 4
#endif // EXTRUDERS > 3
#endif // EXTRUDERS > 2
#endif // EXTRUDERS > 1
//
// Babystep X:
@ -1087,7 +1097,9 @@ void kill_screen(const char* lcd_msg) {
MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x);
MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y);
#endif
#if DISABLED(BABYSTEP_ZPROBE_OFFSET)
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
#else
MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z);
#endif
#endif