|
@@ -125,15 +125,15 @@ uint16_t max_display_update_time = 0;
|
125
|
125
|
#if ENABLED(ULTIPANEL)
|
126
|
126
|
|
127
|
127
|
#define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \
|
128
|
|
- inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
|
|
128
|
+ inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, _type * const data, ...) { \
|
129
|
129
|
UNUSED(pstr2); \
|
130
|
130
|
DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \
|
131
|
131
|
} \
|
132
|
|
- inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
|
|
132
|
+ inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, _type * const data, ...) { \
|
133
|
133
|
UNUSED(pstr2); \
|
134
|
134
|
DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \
|
135
|
135
|
} \
|
136
|
|
- inline void lcd_implementation_drawmenu_setting_edit_accessor_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type (*pget)(), void (*pset)(_type), ...) { \
|
|
136
|
+ inline void lcd_implementation_drawmenu_setting_edit_accessor_ ## _name (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, _type (*pget)(), void (*pset)(_type), ...) { \
|
137
|
137
|
UNUSED(pstr2); UNUSED(pset); \
|
138
|
138
|
DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(pget())); \
|
139
|
139
|
} \
|
|
@@ -254,16 +254,16 @@ uint16_t max_display_update_time = 0;
|
254
|
254
|
#define menu_action_back(dummy) _menu_action_back()
|
255
|
255
|
void _menu_action_back();
|
256
|
256
|
void menu_action_submenu(screenFunc_t data);
|
257
|
|
- void menu_action_gcode(const char* pgcode);
|
|
257
|
+ void menu_action_gcode(PGM_P pgcode);
|
258
|
258
|
void menu_action_function(menuAction_t data);
|
259
|
259
|
|
260
|
260
|
#define DECLARE_MENU_EDIT_TYPE(_type, _name) \
|
261
|
261
|
bool _menu_edit_ ## _name(); \
|
262
|
262
|
void menu_edit_ ## _name(); \
|
263
|
263
|
void menu_edit_callback_ ## _name(); \
|
264
|
|
- void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue); \
|
265
|
|
- void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue); \
|
266
|
|
- void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback=NULL, const bool live=false); \
|
|
264
|
+ void _menu_action_setting_edit_ ## _name(PGM_P const pstr, _type* const ptr, const _type minValue, const _type maxValue); \
|
|
265
|
+ void menu_action_setting_edit_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue); \
|
|
266
|
+ void menu_action_setting_edit_callback_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback=NULL, const bool live=false); \
|
267
|
267
|
typedef void _name##_void
|
268
|
268
|
|
269
|
269
|
DECLARE_MENU_EDIT_TYPE(int16_t, int3);
|
|
@@ -277,8 +277,8 @@ uint16_t max_display_update_time = 0;
|
277
|
277
|
DECLARE_MENU_EDIT_TYPE(float, float62);
|
278
|
278
|
DECLARE_MENU_EDIT_TYPE(uint32_t, long5);
|
279
|
279
|
|
280
|
|
- void menu_action_setting_edit_bool(const char* pstr, bool* ptr);
|
281
|
|
- void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc);
|
|
280
|
+ void menu_action_setting_edit_bool(PGM_P pstr, bool* ptr);
|
|
281
|
+ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t callbackFunc);
|
282
|
282
|
|
283
|
283
|
#if ENABLED(SDSUPPORT)
|
284
|
284
|
void lcd_sdcard_menu();
|
|
@@ -466,7 +466,7 @@ uint16_t max_display_update_time = 0;
|
466
|
466
|
bool screen_changed, defer_return_to_status;
|
467
|
467
|
|
468
|
468
|
// Value Editing
|
469
|
|
- const char *editLabel;
|
|
469
|
+ PGM_P editLabel;
|
470
|
470
|
void *editValue;
|
471
|
471
|
int32_t minEditValue, maxEditValue;
|
472
|
472
|
screenFunc_t callbackFunc;
|
|
@@ -570,7 +570,7 @@ uint16_t max_display_update_time = 0;
|
570
|
570
|
* Show "Moving..." till moves are done, then revert to previous display.
|
571
|
571
|
*/
|
572
|
572
|
static const char moving[] PROGMEM = MSG_MOVING;
|
573
|
|
- static const char *sync_message = moving;
|
|
573
|
+ static PGM_P sync_message = moving;
|
574
|
574
|
|
575
|
575
|
//
|
576
|
576
|
// Display the synchronize screen until moves are
|
|
@@ -591,7 +591,7 @@ uint16_t max_display_update_time = 0;
|
591
|
591
|
|
592
|
592
|
// Display the synchronize screen with a custom message
|
593
|
593
|
// ** This blocks the command queue! **
|
594
|
|
- void lcd_synchronize(const char * const msg=NULL) {
|
|
594
|
+ void lcd_synchronize(PGM_P const msg=NULL) {
|
595
|
595
|
sync_message = msg ? msg : moving;
|
596
|
596
|
_lcd_synchronize();
|
597
|
597
|
}
|
|
@@ -772,7 +772,7 @@ void lcd_reset_status() {
|
772
|
772
|
static const char paused[] PROGMEM = MSG_PRINT_PAUSED;
|
773
|
773
|
static const char printing[] PROGMEM = MSG_PRINTING;
|
774
|
774
|
static const char welcome[] PROGMEM = WELCOME_MSG;
|
775
|
|
- const char *msg;
|
|
775
|
+ PGM_P msg;
|
776
|
776
|
if (print_job_timer.isPaused())
|
777
|
777
|
msg = paused;
|
778
|
778
|
#if ENABLED(SDSUPPORT)
|
|
@@ -792,7 +792,7 @@ void lcd_reset_status() {
|
792
|
792
|
* draw the kill screen
|
793
|
793
|
*
|
794
|
794
|
*/
|
795
|
|
-void kill_screen(const char* lcd_msg) {
|
|
795
|
+void kill_screen(PGM_P lcd_msg) {
|
796
|
796
|
lcd_init();
|
797
|
797
|
lcd_setalertstatusPGM(lcd_msg);
|
798
|
798
|
lcd_kill_screen();
|
|
@@ -1080,7 +1080,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
1080
|
1080
|
#define _DONE_SCRIPT ""
|
1081
|
1081
|
#endif
|
1082
|
1082
|
|
1083
|
|
- void _lcd_user_gcode(const char * const cmd) {
|
|
1083
|
+ void _lcd_user_gcode(PGM_P const cmd) {
|
1084
|
1084
|
enqueue_and_echo_commands_P(cmd);
|
1085
|
1085
|
#if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK)
|
1086
|
1086
|
lcd_completion_feedback();
|
|
@@ -1288,7 +1288,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
1288
|
1288
|
|
1289
|
1289
|
#if ENABLED(BABYSTEPPING)
|
1290
|
1290
|
|
1291
|
|
- void _lcd_babystep(const AxisEnum axis, const char* msg) {
|
|
1291
|
+ void _lcd_babystep(const AxisEnum axis, PGM_P msg) {
|
1292
|
1292
|
if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
|
1293
|
1293
|
ENCODER_DIRECTION_NORMAL();
|
1294
|
1294
|
if (encoderPosition) {
|
|
@@ -1373,7 +1373,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
1373
|
1373
|
// separate value that doesn't lose precision.
|
1374
|
1374
|
static int16_t ubl_encoderPosition = 0;
|
1375
|
1375
|
|
1376
|
|
- static void _lcd_mesh_fine_tune(const char* msg) {
|
|
1376
|
+ static void _lcd_mesh_fine_tune(PGM_P msg) {
|
1377
|
1377
|
defer_return_to_status = true;
|
1378
|
1378
|
if (ubl.encoder_diff) {
|
1379
|
1379
|
ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1;
|
|
@@ -1937,7 +1937,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
1937
|
1937
|
no_reentry = false;
|
1938
|
1938
|
}
|
1939
|
1939
|
|
1940
|
|
- void lcd_enqueue_commands_P(const char * const cmd) {
|
|
1940
|
+ void lcd_enqueue_commands_P(PGM_P const cmd) {
|
1941
|
1941
|
no_reentry = true;
|
1942
|
1942
|
enqueue_and_echo_commands_now_P(cmd);
|
1943
|
1943
|
no_reentry = false;
|
|
@@ -3030,7 +3030,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
3030
|
3030
|
*
|
3031
|
3031
|
*/
|
3032
|
3032
|
|
3033
|
|
- void _lcd_move_xyz(const char* name, AxisEnum axis) {
|
|
3033
|
+ void _lcd_move_xyz(PGM_P name, AxisEnum axis) {
|
3034
|
3034
|
if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
|
3035
|
3035
|
ENCODER_DIRECTION_NORMAL();
|
3036
|
3036
|
if (encoderPosition && !processing_manual_move) {
|
|
@@ -4508,7 +4508,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
4508
|
4508
|
static AdvancedPauseMode _change_filament_temp_mode;
|
4509
|
4509
|
static int8_t _change_filament_temp_extruder;
|
4510
|
4510
|
|
4511
|
|
- static const char* _change_filament_temp_command() {
|
|
4511
|
+ static PGM_P _change_filament_temp_command() {
|
4512
|
4512
|
switch (_change_filament_temp_mode) {
|
4513
|
4513
|
case ADVANCED_PAUSE_MODE_LOAD_FILAMENT:
|
4514
|
4514
|
return PSTR("M701 T%d");
|
|
@@ -4531,7 +4531,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
4531
|
4531
|
void _lcd_change_filament_temp_2_menu() { _change_filament_temp(PREHEAT_2_TEMP_HOTEND); }
|
4532
|
4532
|
void _lcd_change_filament_temp_custom_menu() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); }
|
4533
|
4533
|
|
4534
|
|
- static const char* change_filament_header(const AdvancedPauseMode mode) {
|
|
4534
|
+ static PGM_P change_filament_header(const AdvancedPauseMode mode) {
|
4535
|
4535
|
switch (mode) {
|
4536
|
4536
|
case ADVANCED_PAUSE_MODE_LOAD_FILAMENT:
|
4537
|
4537
|
return PSTR(MSG_FILAMENTLOAD);
|
|
@@ -4779,7 +4779,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
4779
|
4779
|
static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT;
|
4780
|
4780
|
static uint8_t hotend_status_extruder = 0;
|
4781
|
4781
|
|
4782
|
|
- static const char* advanced_pause_header() {
|
|
4782
|
+ static PGM_P advanced_pause_header() {
|
4783
|
4783
|
switch (advanced_pause_mode) {
|
4784
|
4784
|
case ADVANCED_PAUSE_MODE_LOAD_FILAMENT:
|
4785
|
4785
|
return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD);
|
|
@@ -5061,9 +5061,9 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
5061
|
5061
|
* bool _menu_edit_int3();
|
5062
|
5062
|
* void menu_edit_int3(); // edit int16_t (interactively)
|
5063
|
5063
|
* void menu_edit_callback_int3(); // edit int16_t (interactively) with callback on completion
|
5064
|
|
- * void _menu_action_setting_edit_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue);
|
5065
|
|
- * void menu_action_setting_edit_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue);
|
5066
|
|
- * void menu_action_setting_edit_callback_int3(const char * const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback, const bool live); // edit int16_t with callback
|
|
5064
|
+ * void _menu_action_setting_edit_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue);
|
|
5065
|
+ * void menu_action_setting_edit_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue);
|
|
5066
|
+ * void menu_action_setting_edit_callback_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback, const bool live); // edit int16_t with callback
|
5067
|
5067
|
*
|
5068
|
5068
|
* You can then use one of the menu macros to present the edit interface:
|
5069
|
5069
|
* MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
|
|
@@ -5090,7 +5090,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
5090
|
5090
|
return use_click(); \
|
5091
|
5091
|
} \
|
5092
|
5092
|
void menu_edit_ ## _name() { _menu_edit_ ## _name(); } \
|
5093
|
|
- void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue) { \
|
|
5093
|
+ void _menu_action_setting_edit_ ## _name(PGM_P const pstr, _type* const ptr, const _type minValue, const _type maxValue) { \
|
5094
|
5094
|
lcd_save_previous_screen(); \
|
5095
|
5095
|
lcd_refresh(); \
|
5096
|
5096
|
\
|
|
@@ -5100,13 +5100,13 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
5100
|
5100
|
maxEditValue = maxValue * _scale - minEditValue; \
|
5101
|
5101
|
encoderPosition = (*ptr) * _scale - minEditValue; \
|
5102
|
5102
|
} \
|
5103
|
|
- void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \
|
|
5103
|
+ void menu_action_setting_edit_callback_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \
|
5104
|
5104
|
_menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
|
5105
|
5105
|
currentScreen = menu_edit_ ## _name; \
|
5106
|
5106
|
callbackFunc = callback; \
|
5107
|
5107
|
liveEdit = live; \
|
5108
|
5108
|
} \
|
5109
|
|
- FORCE_INLINE void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \
|
|
5109
|
+ FORCE_INLINE void menu_action_setting_edit_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \
|
5110
|
5110
|
menu_action_setting_edit_callback_ ## _name(pstr, ptr, minValue, maxValue); \
|
5111
|
5111
|
} \
|
5112
|
5112
|
typedef void _name##_void
|
|
@@ -5219,7 +5219,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
5219
|
5219
|
*/
|
5220
|
5220
|
void _menu_action_back() { lcd_goto_previous_menu(); }
|
5221
|
5221
|
void menu_action_submenu(screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); }
|
5222
|
|
- void menu_action_gcode(const char* pgcode) { enqueue_and_echo_commands_P(pgcode); }
|
|
5222
|
+ void menu_action_gcode(PGM_P pgcode) { enqueue_and_echo_commands_P(pgcode); }
|
5223
|
5223
|
void menu_action_function(screenFunc_t func) { (*func)(); }
|
5224
|
5224
|
|
5225
|
5225
|
#if ENABLED(SDSUPPORT)
|
|
@@ -5246,8 +5246,8 @@ void lcd_quick_feedback(const bool clear_buttons) {
|
5246
|
5246
|
|
5247
|
5247
|
#endif // SDSUPPORT
|
5248
|
5248
|
|
5249
|
|
- void menu_action_setting_edit_bool(const char* pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); }
|
5250
|
|
- void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callback) {
|
|
5249
|
+ void menu_action_setting_edit_bool(PGM_P pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); }
|
|
5250
|
+ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t callback) {
|
5251
|
5251
|
menu_action_setting_edit_bool(pstr, ptr);
|
5252
|
5252
|
(*callback)();
|
5253
|
5253
|
}
|
|
@@ -5694,7 +5694,7 @@ void lcd_setstatus(const char * const message, const bool persist) {
|
5694
|
5694
|
lcd_finishstatus(persist);
|
5695
|
5695
|
}
|
5696
|
5696
|
|
5697
|
|
-void lcd_setstatusPGM(const char * const message, int8_t level) {
|
|
5697
|
+void lcd_setstatusPGM(PGM_P const message, int8_t level) {
|
5698
|
5698
|
if (level < 0) level = lcd_status_message_level = 0;
|
5699
|
5699
|
if (level < lcd_status_message_level) return;
|
5700
|
5700
|
lcd_status_message_level = level;
|
|
@@ -5704,7 +5704,7 @@ void lcd_setstatusPGM(const char * const message, int8_t level) {
|
5704
|
5704
|
// that there is no cutting in the middle of a multibyte character!
|
5705
|
5705
|
|
5706
|
5706
|
// Get a pointer to the null terminator
|
5707
|
|
- const char* pend = message + strlen_P(message);
|
|
5707
|
+ PGM_P pend = message + strlen_P(message);
|
5708
|
5708
|
|
5709
|
5709
|
// If length of supplied UTF8 string is greater than
|
5710
|
5710
|
// our buffer size, start cutting whole UTF8 chars
|
|
@@ -5721,7 +5721,7 @@ void lcd_setstatusPGM(const char * const message, int8_t level) {
|
5721
|
5721
|
lcd_finishstatus(level > 0);
|
5722
|
5722
|
}
|
5723
|
5723
|
|
5724
|
|
-void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) {
|
|
5724
|
+void lcd_status_printf_P(const uint8_t level, PGM_P const fmt, ...) {
|
5725
|
5725
|
if (level < lcd_status_message_level) return;
|
5726
|
5726
|
lcd_status_message_level = level;
|
5727
|
5727
|
va_list args;
|
|
@@ -5731,7 +5731,7 @@ void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) {
|
5731
|
5731
|
lcd_finishstatus(level > 0);
|
5732
|
5732
|
}
|
5733
|
5733
|
|
5734
|
|
-void lcd_setalertstatusPGM(const char * const message) {
|
|
5734
|
+void lcd_setalertstatusPGM(PGM_P const message) {
|
5735
|
5735
|
lcd_setstatusPGM(message, 1);
|
5736
|
5736
|
#if ENABLED(ULTIPANEL)
|
5737
|
5737
|
lcd_return_to_status();
|