Cleanup LCD interface, add lcd_reset_status

2.0.x
Scott Lahteine 8 years ago
parent ca99d67ede
commit 46b32e4548

@ -191,7 +191,7 @@
// ask the user to resolve the issue // ask the user to resolve the issue
lcd_setstatusPGM(PSTR("Release button"), 99); // will never appear... lcd_setstatusPGM(PSTR("Release button"), 99); // will never appear...
while (ubl_lcd_clicked()) idle(); // unless this loop happens while (ubl_lcd_clicked()) idle(); // unless this loop happens
lcd_setstatusPGM(PSTR(""), -1); lcd_reset_status();
return true; return true;
} }
@ -771,7 +771,7 @@
} }
#if ENABLED(ULTRA_LCD) #if ENABLED(ULTRA_LCD)
lcd_setstatusPGM(PSTR(""), -1); lcd_reset_status();
lcd_quick_feedback(); lcd_quick_feedback();
#endif #endif

@ -40,8 +40,6 @@
extern float destination[XYZE], current_position[XYZE]; extern float destination[XYZE], current_position[XYZE];
void lcd_return_to_status(); void lcd_return_to_status();
bool lcd_clicked();
void lcd_implementation_clear();
void lcd_mesh_edit_setup(float initial); void lcd_mesh_edit_setup(float initial);
float lcd_mesh_edit(); float lcd_mesh_edit();
void lcd_z_offset_edit_setup(float); void lcd_z_offset_edit_setup(float);
@ -54,12 +52,6 @@
#define SIZE_OF_LITTLE_RAISE 1 #define SIZE_OF_LITTLE_RAISE 1
#define BIG_RAISE_NOT_NEEDED 0 #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, int unified_bed_leveling::g29_verbose_level,
unified_bed_leveling::g29_phase_value, unified_bed_leveling::g29_phase_value,
unified_bed_leveling::g29_repetition_cnt, 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 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 // 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 // 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); lcd_z_offset_edit_setup(measured_z);
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
@ -698,7 +690,7 @@
state.z_offset = measured_z; state.z_offset = measured_z;
lcd_implementation_clear(); lcd_refresh();
restore_ubl_active_state_and_leave(); restore_ubl_active_state_and_leave();
} }
} }
@ -940,7 +932,7 @@
SERIAL_PROTOCOLPGM("Place shim under nozzle"); SERIAL_PROTOCOLPGM("Place shim under nozzle");
LCD_MESSAGEPGM("Place shim & measure"); // TODO: Make translatable string LCD_MESSAGEPGM("Place shim & measure"); // TODO: Make translatable string
lcd_goto_screen(lcd_status_screen); lcd_return_to_status();
echo_and_take_a_measurement(); echo_and_take_a_measurement();
const float z1 = measure_point_with_encoder(); const float z1 = measure_point_with_encoder();
@ -979,7 +971,7 @@
do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES);
do_blocking_move_to_xy(lx, ly); do_blocking_move_to_xy(lx, ly);
lcd_goto_screen(lcd_status_screen); lcd_return_to_status();
mesh_index_pair location; mesh_index_pair location;
do { do {
location = find_closest_mesh_point_of_type(INVALID, lx, ly, USE_NOZZLE_AS_REFERENCE, NULL, false); 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 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); lcd_mesh_edit_setup(new_z);
@ -1497,7 +1489,7 @@
z_values[location.x_index][location.y_index] = new_z; z_values[location.x_index][location.y_index] = new_z;
lcd_implementation_clear(); lcd_refresh();
} while (location.x_index >= 0 && --g29_repetition_cnt > 0); } while (location.x_index >= 0 && --g29_repetition_cnt > 0);

@ -626,6 +626,8 @@ void lcd_status_screen() {
lcd_implementation_status_screen(); lcd_implementation_status_screen();
} }
void lcd_reset_status() { lcd_setstatusPGM(PSTR(""), -1); }
/** /**
* *
* draw the kill screen * draw the kill screen
@ -633,7 +635,7 @@ void lcd_status_screen() {
*/ */
void kill_screen(const char* lcd_msg) { void kill_screen(const char* lcd_msg) {
lcd_init(); lcd_init();
lcd_setalertstatuspgm(lcd_msg); lcd_setalertstatusPGM(lcd_msg);
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
u8g.firstPage(); u8g.firstPage();
do { do {
@ -705,7 +707,7 @@ void kill_screen(const char* lcd_msg) {
card.startFileprint(); card.startFileprint();
print_job_timer.start(); print_job_timer.start();
#endif #endif
lcd_setstatusPGM(PSTR(""), -1); lcd_reset_status();
} }
void lcd_sdcard_stop() { 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); lcd_finishstatus(level > 0);
} }
void lcd_setalertstatuspgm(const char * const message) { void lcd_setalertstatusPGM(const char * const message) {
lcd_setstatusPGM(message, 1); lcd_setstatusPGM(message, 1);
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
lcd_return_to_status(); lcd_return_to_status();

@ -39,8 +39,8 @@
bool lcd_hasstatus(); bool lcd_hasstatus();
void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatus(const char* message, const bool persist=false);
void lcd_setstatusPGM(const char* message, const int8_t level=0); 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_status_printf_P(const uint8_t level, const char * const fmt, ...);
void lcd_setalertstatuspgm(const char* message);
void lcd_reset_alert_level(); void lcd_reset_alert_level();
void lcd_kill_screen(); void lcd_kill_screen();
void kill_screen(const char* lcd_msg); void kill_screen(const char* lcd_msg);
@ -64,9 +64,6 @@
void bootscreen(); void bootscreen();
#endif #endif
#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x))
#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
#define LCD_UPDATE_INTERVAL 100 #define LCD_UPDATE_INTERVAL 100
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
@ -152,22 +149,26 @@
#endif #endif
#else // no LCD #else // no LCD
inline void lcd_update() {} inline void lcd_update() {}
inline void lcd_init() {} inline void lcd_init() {}
inline bool lcd_hasstatus() { return false; } 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_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_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_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); }
inline void lcd_buttons_update() {} inline void lcd_buttons_update() {}
inline void lcd_reset_alert_level() {} inline void lcd_reset_alert_level() {}
inline bool lcd_detected() { return true; } inline bool lcd_detected() { return true; }
inline void lcd_refresh() {} inline void lcd_refresh() {}
#define LCD_MESSAGEPGM(x) NOOP
#define LCD_ALERTMESSAGEPGM(x) NOOP
#endif // ULTRA_LCD #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) #if ENABLED(AUTO_BED_LEVELING_UBL)
void lcd_mesh_edit_setup(float initial); void lcd_mesh_edit_setup(float initial);
float lcd_mesh_edit(); float lcd_mesh_edit();

Loading…
Cancel
Save