diff --git a/Marlin/G26_Mesh_Validation_Tool.cpp b/Marlin/G26_Mesh_Validation_Tool.cpp index 56f2059bb..23bb34198 100644 --- a/Marlin/G26_Mesh_Validation_Tool.cpp +++ b/Marlin/G26_Mesh_Validation_Tool.cpp @@ -191,7 +191,7 @@ // ask the user to resolve the issue lcd_setstatusPGM(PSTR("Release button"), 99); // will never appear... while (ubl_lcd_clicked()) idle(); // unless this loop happens - lcd_setstatusPGM(PSTR(""), -1); + lcd_reset_status(); return true; } @@ -771,7 +771,7 @@ } #if ENABLED(ULTRA_LCD) - lcd_setstatusPGM(PSTR(""), -1); + lcd_reset_status(); lcd_quick_feedback(); #endif diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index c4f77dceb..d6453a948 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -40,8 +40,6 @@ extern float destination[XYZE], current_position[XYZE]; void lcd_return_to_status(); - bool lcd_clicked(); - void lcd_implementation_clear(); void lcd_mesh_edit_setup(float initial); float lcd_mesh_edit(); void lcd_z_offset_edit_setup(float); @@ -54,12 +52,6 @@ #define SIZE_OF_LITTLE_RAISE 1 #define BIG_RAISE_NOT_NEEDED 0 - extern void lcd_status_screen(); - typedef void (*screenFunc_t)(); - extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0); - extern void lcd_setstatus(const char* message, const bool persist); - extern void lcd_setstatusPGM(const char* message, const int8_t level); - int unified_bed_leveling::g29_verbose_level, unified_bed_leveling::g29_phase_value, unified_bed_leveling::g29_repetition_cnt, @@ -662,7 +654,7 @@ do_blocking_move_to_z(measured_z); // Get close to the bed, but leave some space so we don't damage anything // The user is not going to be locking in a new Z-Offset very often so // it won't be that painful to spin the Encoder Wheel for 1.5mm - lcd_implementation_clear(); + lcd_refresh(); lcd_z_offset_edit_setup(measured_z); KEEPALIVE_STATE(PAUSED_FOR_USER); @@ -698,7 +690,7 @@ state.z_offset = measured_z; - lcd_implementation_clear(); + lcd_refresh(); restore_ubl_active_state_and_leave(); } } @@ -940,7 +932,7 @@ SERIAL_PROTOCOLPGM("Place shim under nozzle"); LCD_MESSAGEPGM("Place shim & measure"); // TODO: Make translatable string - lcd_goto_screen(lcd_status_screen); + lcd_return_to_status(); echo_and_take_a_measurement(); const float z1 = measure_point_with_encoder(); @@ -979,7 +971,7 @@ do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); do_blocking_move_to_xy(lx, ly); - lcd_goto_screen(lcd_status_screen); + lcd_return_to_status(); mesh_index_pair location; do { location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false); @@ -1456,7 +1448,7 @@ if (do_ubl_mesh_map) display_map(g29_map_type); // show the user which point is being adjusted - lcd_implementation_clear(); + lcd_refresh(); lcd_mesh_edit_setup(new_z); @@ -1497,7 +1489,7 @@ z_values[location.x_index][location.y_index] = new_z; - lcd_implementation_clear(); + lcd_refresh(); } while (location.x_index >= 0 && --g29_repetition_cnt > 0); diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index c27784438..e5eebff05 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -626,6 +626,8 @@ void lcd_status_screen() { lcd_implementation_status_screen(); } +void lcd_reset_status() { lcd_setstatusPGM(PSTR(""), -1); } + /** * * draw the kill screen @@ -633,7 +635,7 @@ void lcd_status_screen() { */ void kill_screen(const char* lcd_msg) { lcd_init(); - lcd_setalertstatuspgm(lcd_msg); + lcd_setalertstatusPGM(lcd_msg); #if ENABLED(DOGLCD) u8g.firstPage(); do { @@ -705,7 +707,7 @@ void kill_screen(const char* lcd_msg) { card.startFileprint(); print_job_timer.start(); #endif - lcd_setstatusPGM(PSTR(""), -1); + lcd_reset_status(); } void lcd_sdcard_stop() { @@ -4160,7 +4162,7 @@ void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { lcd_finishstatus(level > 0); } -void lcd_setalertstatuspgm(const char * const message) { +void lcd_setalertstatusPGM(const char * const message) { lcd_setstatusPGM(message, 1); #if ENABLED(ULTIPANEL) lcd_return_to_status(); diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 13da79e8a..a6226652e 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -39,8 +39,8 @@ bool lcd_hasstatus(); void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatusPGM(const char* message, const int8_t level=0); + void lcd_setalertstatusPGM(const char* message); void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...); - void lcd_setalertstatuspgm(const char* message); void lcd_reset_alert_level(); void lcd_kill_screen(); void kill_screen(const char* lcd_msg); @@ -64,9 +64,6 @@ void bootscreen(); #endif - #define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) - #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x)) - #define LCD_UPDATE_INTERVAL 100 #if ENABLED(ULTIPANEL) @@ -152,22 +149,26 @@ #endif #else // no LCD + inline void lcd_update() {} inline void lcd_init() {} inline bool lcd_hasstatus() { return false; } inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } inline void lcd_setstatusPGM(const char* const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } + inline void lcd_setalertstatusPGM(const char* message) { UNUSED(message); } inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); } inline void lcd_buttons_update() {} inline void lcd_reset_alert_level() {} inline bool lcd_detected() { return true; } inline void lcd_refresh() {} - #define LCD_MESSAGEPGM(x) NOOP - #define LCD_ALERTMESSAGEPGM(x) NOOP - #endif // ULTRA_LCD +#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) +#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x)) + +void lcd_reset_status(); + #if ENABLED(AUTO_BED_LEVELING_UBL) void lcd_mesh_edit_setup(float initial); float lcd_mesh_edit();