🎨 Apply F() to status message

This commit is contained in:
Scott Lahteine
2021-09-25 17:05:11 -05:00
committed by Scott Lahteine
parent 433eedd50f
commit 360311f232
44 changed files with 194 additions and 196 deletions

View File

@ -736,7 +736,7 @@ void unified_bed_leveling::shift_mesh_height() {
const uint8_t point_num = (GRID_MAX_POINTS - count) + 1;
SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, ".");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS)));
#if HAS_LCD_MENU
if (ui.button_pressed()) {
@ -789,12 +789,12 @@ void unified_bed_leveling::shift_mesh_height() {
#endif // HAS_BED_PROBE
void set_message_with_feedback(PGM_P const msg_P) {
void set_message_with_feedback(FSTR_P const fstr) {
#if HAS_LCD_MENU
ui.set_status_P(msg_P);
ui.set_status(fstr);
ui.quick_feedback();
#else
UNUSED(msg_P);
UNUSED(fstr);
#endif
}
@ -850,7 +850,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
planner.synchronize();
SERIAL_ECHOPGM("Place shim under nozzle");
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
LCD_MESSAGE(MSG_UBL_BC_INSERT);
ui.return_to_status();
echo_and_take_a_measurement();
@ -859,7 +859,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
planner.synchronize();
SERIAL_ECHOPGM("Remove shim");
LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE);
LCD_MESSAGE(MSG_UBL_BC_REMOVE);
echo_and_take_a_measurement();
const float z2 = measure_point_with_encoder();
@ -905,7 +905,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
if (!position_is_reachable(ppos)) break; // SHOULD NOT OCCUR (find_closest_mesh_point only returns reachable points)
LCD_MESSAGEPGM(MSG_UBL_MOVING_TO_NEXT);
LCD_MESSAGE(MSG_UBL_MOVING_TO_NEXT);
do_blocking_move_to(ppos);
do_z_clearance(z_clearance);
@ -917,11 +917,11 @@ void set_message_with_feedback(PGM_P const msg_P) {
if (parser.seen_test('B')) {
SERIAL_ECHOPGM("Place Shim & Measure");
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT);
LCD_MESSAGE(MSG_UBL_BC_INSERT);
}
else {
SERIAL_ECHOPGM("Measure");
LCD_MESSAGEPGM(MSG_UBL_BC_INSERT2);
LCD_MESSAGE(MSG_UBL_BC_INSERT2);
}
const float z_step = 0.01f; // 0.01mm per encoder tick, occasionally step
@ -974,7 +974,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
save_ubl_active_state_and_disable();
LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH);
LCD_MESSAGE(MSG_UBL_FINE_TUNE_MESH);
ui.capture(); // Take over control of the LCD encoder
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance
@ -1039,7 +1039,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
if (_click_and_hold([]{
ui.return_to_status();
do_z_clearance(Z_CLEARANCE_BETWEEN_PROBES);
set_message_with_feedback(GET_TEXT(MSG_EDITING_STOPPED));
set_message_with_feedback(GET_TEXT_F(MSG_EDITING_STOPPED));
})) break;
// TODO: Disable leveling here so the Z value becomes the 'native' Z value.
@ -1060,7 +1060,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
do_blocking_move_to_xy_z(pos, Z_CLEARANCE_BETWEEN_PROBES);
LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH);
LCD_MESSAGE(MSG_UBL_DONE_EDITING_MESH);
SERIAL_ECHOLNPGM("Done Editing Mesh");
if (lcd_map_control)
@ -1077,7 +1077,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
bool unified_bed_leveling::G29_parse_parameters() {
bool err_flag = false;
set_message_with_feedback(GET_TEXT(MSG_UBL_DOING_G29));
set_message_with_feedback(GET_TEXT_F(MSG_UBL_DOING_G29));
param.C_constant = 0;
param.R_repetition = 0;
@ -1200,7 +1200,7 @@ void unified_bed_leveling::save_ubl_active_state_and_disable() {
ubl_state_recursion_chk++;
if (ubl_state_recursion_chk != 1) {
SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row.");
set_message_with_feedback(GET_TEXT(MSG_UBL_SAVE_ERROR));
set_message_with_feedback(GET_TEXT_F(MSG_UBL_SAVE_ERROR));
return;
}
#endif
@ -1213,7 +1213,7 @@ void unified_bed_leveling::restore_ubl_active_state_and_leave() {
#if ENABLED(UBL_DEVEL_DEBUGGING)
if (--ubl_state_recursion_chk) {
SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times.");
set_message_with_feedback(GET_TEXT(MSG_UBL_RESTORE_ERROR));
set_message_with_feedback(GET_TEXT_F(MSG_UBL_RESTORE_ERROR));
return;
}
#endif
@ -1438,7 +1438,7 @@ void unified_bed_leveling::smart_fill_mesh() {
if (do_3_pt_leveling) {
SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
if (isnan(measured_z))
@ -1457,7 +1457,7 @@ void unified_bed_leveling::smart_fill_mesh() {
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
#ifdef VALIDATE_MESH_TILT
@ -1477,7 +1477,7 @@ void unified_bed_leveling::smart_fill_mesh() {
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity);
#ifdef VALIDATE_MESH_TILT
@ -1518,7 +1518,7 @@ void unified_bed_leveling::smart_fill_mesh() {
if (!abort_flag) {
SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling

View File

@ -46,7 +46,7 @@ void CancelObject::set_active_object(const int8_t obj) {
#if BOTH(HAS_STATUS_MESSAGE, CANCEL_OBJECTS_REPORTING)
if (active_object >= 0)
ui.status_printf_P(0, PSTR(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object));
ui.status_printf(0, F(S_FMT " %i"), GET_TEXT(MSG_PRINTING_OBJECT), int(active_object));
else
ui.reset_status();
#endif

View File

@ -77,7 +77,7 @@ void HotendIdleProtection::check() {
void HotendIdleProtection::timed_out() {
next_protect_ms = 0;
SERIAL_ECHOLNPGM("Hotend Idle Timeout");
LCD_MESSAGEPGM(MSG_HOTEND_IDLE_TIMEOUT);
LCD_MESSAGE(MSG_HOTEND_IDLE_TIMEOUT);
HOTEND_LOOP() {
if ((HOTEND_IDLE_NOZZLE_TARGET) < thermalManager.degTargetHotend(e))
thermalManager.setTargetHotend(HOTEND_IDLE_NOZZLE_TARGET, e);

View File

@ -451,7 +451,7 @@ void MMU2::check_version() {
}
static void mmu2_not_responding() {
LCD_MESSAGEPGM(MSG_MMU2_NOT_RESPONDING);
LCD_MESSAGE(MSG_MMU2_NOT_RESPONDING);
BUZZ(100, 659);
BUZZ(200, 698);
BUZZ(100, 659);
@ -487,7 +487,7 @@ static void mmu2_not_responding() {
if (index != extruder) {
stepper.disable_extruder();
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
command(MMU_CMD_T0 + index);
manage_response(true, true);
@ -573,7 +573,7 @@ static void mmu2_not_responding() {
command(MMU_CMD_U0);
manage_response(true, true);
}
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
mmu_loading_flag = true;
command(MMU_CMD_T0 + index);
manage_response(true, true);
@ -671,7 +671,7 @@ static void mmu2_not_responding() {
if (index != extruder) {
stepper.disable_extruder();
ui.status_printf_P(0, GET_TEXT(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
command(MMU_CMD_T0 + index);
manage_response(true, true);
command(MMU_CMD_C0);
@ -808,14 +808,14 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
if (turn_off_nozzle && resume_hotend_temp) {
thermalManager.setTargetHotend(resume_hotend_temp, active_extruder);
LCD_MESSAGEPGM(MSG_HEATING);
LCD_MESSAGE(MSG_HEATING);
BUZZ(200, 40);
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000);
}
if (move_axes && all_axes_homed()) {
LCD_MESSAGEPGM(MSG_MMU2_RESUMING);
LCD_MESSAGE(MSG_MMU2_RESUMING);
BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404);
// Move XY to starting position, then Z
@ -826,7 +826,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
}
else {
BUZZ(198, 404); BUZZ(4, 0); BUZZ(198, 404);
LCD_MESSAGEPGM(MSG_MMU2_RESUMING);
LCD_MESSAGE(MSG_MMU2_RESUMING);
}
}
}
@ -908,7 +908,7 @@ bool MMU2::load_filament_to_nozzle(const uint8_t index) {
if (thermalManager.tooColdToExtrude(active_extruder)) {
BUZZ(200, 404);
LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD);
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
return false;
}
@ -944,11 +944,11 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
if (thermalManager.tooColdToExtrude(active_extruder)) {
BUZZ(200, 404);
LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD);
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
return false;
}
LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT);
LCD_MESSAGE(MSG_MMU2_EJECTING_FILAMENT);
stepper.enable_extruder();
current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
@ -958,7 +958,7 @@ bool MMU2::eject_filament(const uint8_t index, const bool recover) {
manage_response(false, false);
if (recover) {
LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
LCD_MESSAGE(MSG_MMU2_EJECT_RECOVER);
BUZZ(200, 404);
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover")));
@ -993,7 +993,7 @@ bool MMU2::unload() {
if (thermalManager.tooColdToExtrude(active_extruder)) {
BUZZ(200, 404);
LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD);
LCD_ALERTMESSAGE(MSG_HOTEND_TOO_COLD);
return false;
}

View File

@ -538,7 +538,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
TERN_(EXTENSIBLE_UI, ExtUI::onStatusChanged_P(GET_TEXT(MSG_REHEATING)));
TERN_(DWIN_CREALITY_LCD_ENHANCED, ui.set_status_P(GET_TEXT(MSG_REHEATING)));
TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATING));
// Re-enable the heaters if they timed out
HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
@ -556,7 +556,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
TERN_(HOST_PROMPT_SUPPORT, host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_REHEATDONE), CONTINUE_STR));
TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_REHEATDONE)));
TERN_(DWIN_CREALITY_LCD_ENHANCED, ui.set_status_P(GET_TEXT(MSG_REHEATDONE)));
TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_REHEATDONE));
IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true);

View File

@ -32,7 +32,7 @@ void stepper_driver_backward_error(PGM_P str) {
SERIAL_ERROR_START();
SERIAL_ECHOPGM_P(str);
SERIAL_ECHOLNPGM(" driver is backward!");
ui.status_printf_P(2, PSTR(S_FMT S_FMT), str, GET_TEXT(MSG_DRIVER_BACKWARD));
ui.status_printf(2, F(S_FMT S_FMT), str, GET_TEXT(MSG_DRIVER_BACKWARD));
}
void stepper_driver_backward_check() {

View File

@ -1341,7 +1341,7 @@ void test_tmc_connection(LOGICAL_AXIS_ARGS(const bool)) {
#endif
}
if (axis_connection) LCD_MESSAGEPGM(MSG_ERROR_TMC);
if (axis_connection) LCD_MESSAGE(MSG_ERROR_TMC);
}
#endif // HAS_TRINAMIC_CONFIG