|
@@ -319,7 +319,10 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const ui
|
319
|
319
|
encoderPosition = encoder;
|
320
|
320
|
if (feedback) lcd_quick_feedback();
|
321
|
321
|
#endif
|
322
|
|
- if (menu == lcd_status_screen) menu_history_depth = 0;
|
|
322
|
+ if (menu == lcd_status_screen) {
|
|
323
|
+ defer_return_to_status = false;
|
|
324
|
+ menu_history_depth = 0;
|
|
325
|
+ }
|
323
|
326
|
#if ENABLED(LCD_PROGRESS_BAR)
|
324
|
327
|
// For LCD_PROGRESS_BAR re-initialize custom characters
|
325
|
328
|
lcd_set_custom_characters(menu == lcd_status_screen);
|
|
@@ -327,10 +330,7 @@ static void lcd_goto_menu(menuFunc_t menu, const bool feedback = false, const ui
|
327
|
330
|
}
|
328
|
331
|
}
|
329
|
332
|
|
330
|
|
-static void lcd_return_to_status() {
|
331
|
|
- defer_return_to_status = false;
|
332
|
|
- lcd_goto_menu(lcd_status_screen);
|
333
|
|
-}
|
|
333
|
+static void lcd_return_to_status() { lcd_goto_menu(lcd_status_screen); }
|
334
|
334
|
|
335
|
335
|
inline void lcd_save_previous_menu() {
|
336
|
336
|
if (menu_history_depth < COUNT(menu_history)) {
|
|
@@ -432,13 +432,13 @@ static void lcd_status_screen() {
|
432
|
432
|
}
|
433
|
433
|
|
434
|
434
|
#if ENABLED(ULTIPANEL_FEEDMULTIPLY)
|
|
435
|
+ int new_frm = feedrate_multiplier + int(encoderPosition);
|
435
|
436
|
// Dead zone at 100% feedrate
|
436
|
|
- if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) ||
|
437
|
|
- (feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) {
|
438
|
|
- encoderPosition = 0;
|
|
437
|
+ if ((feedrate_multiplier < 100 && new_frm > 100) || (feedrate_multiplier > 100 && new_frm < 100)) {
|
439
|
438
|
feedrate_multiplier = 100;
|
|
439
|
+ encoderPosition = 0;
|
440
|
440
|
}
|
441
|
|
- if (feedrate_multiplier == 100) {
|
|
441
|
+ else if (feedrate_multiplier == 100) {
|
442
|
442
|
if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) {
|
443
|
443
|
feedrate_multiplier += int(encoderPosition) - (ENCODER_FEEDRATE_DEADZONE);
|
444
|
444
|
encoderPosition = 0;
|
|
@@ -449,7 +449,7 @@ static void lcd_status_screen() {
|
449
|
449
|
}
|
450
|
450
|
}
|
451
|
451
|
else {
|
452
|
|
- feedrate_multiplier += int(encoderPosition);
|
|
452
|
+ feedrate_multiplier = new_frm;
|
453
|
453
|
encoderPosition = 0;
|
454
|
454
|
}
|
455
|
455
|
#endif // ULTIPANEL_FEEDMULTIPLY
|
|
@@ -583,7 +583,7 @@ void lcd_set_home_offsets() {
|
583
|
583
|
#endif
|
584
|
584
|
}
|
585
|
585
|
if (lcdDrawUpdate) lcd_implementation_drawedit(msg, NULL);
|
586
|
|
- if (LCD_CLICKED) lcd_goto_previous_menu();
|
|
586
|
+ if (LCD_CLICKED) lcd_goto_previous_menu(true);
|
587
|
587
|
}
|
588
|
588
|
|
589
|
589
|
#if ENABLED(BABYSTEP_XY)
|
|
@@ -901,7 +901,7 @@ void lcd_cooldown() {
|
901
|
901
|
ENCODER_DIRECTION_NORMAL();
|
902
|
902
|
|
903
|
903
|
// Encoder wheel adjusts the Z position
|
904
|
|
- if (encoderPosition != 0 && movesplanned() <= 3) {
|
|
904
|
+ if (encoderPosition && movesplanned() <= 3) {
|
905
|
905
|
refresh_cmd_timeout();
|
906
|
906
|
current_position[Z_AXIS] += float((int)encoderPosition) * (MBL_Z_STEP);
|
907
|
907
|
if (min_software_endstops) NOLESS(current_position[Z_AXIS], Z_MIN_POS);
|
|
@@ -978,7 +978,7 @@ void lcd_cooldown() {
|
978
|
978
|
current_position[Y_AXIS] = MESH_MIN_Y;
|
979
|
979
|
line_to_current(manual_feedrate[X_AXIS] <= manual_feedrate[Y_AXIS] ? X_AXIS : Y_AXIS);
|
980
|
980
|
_lcd_level_bed_position = 0;
|
981
|
|
- lcd_goto_menu(_lcd_level_bed_procedure);
|
|
981
|
+ lcd_goto_menu(_lcd_level_bed_procedure, true);
|
982
|
982
|
}
|
983
|
983
|
}
|
984
|
984
|
|
|
@@ -1121,9 +1121,8 @@ static void lcd_prepare_menu() {
|
1121
|
1121
|
*/
|
1122
|
1122
|
|
1123
|
1123
|
float move_menu_scale;
|
1124
|
|
-static void lcd_move_menu_axis();
|
1125
|
1124
|
|
1126
|
|
-static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
|
|
1125
|
+static void _lcd_move(const char* name, AxisEnum axis, float min, float max) {
|
1127
|
1126
|
ENCODER_DIRECTION_NORMAL();
|
1128
|
1127
|
if ((encoderPosition != 0) && (movesplanned() <= 3)) {
|
1129
|
1128
|
refresh_cmd_timeout();
|
|
@@ -1135,18 +1134,18 @@ static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
|
1135
|
1134
|
lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
|
1136
|
1135
|
}
|
1137
|
1136
|
if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis]));
|
1138
|
|
- if (LCD_CLICKED) lcd_goto_previous_menu();
|
|
1137
|
+ if (LCD_CLICKED) lcd_goto_previous_menu(true);
|
1139
|
1138
|
}
|
1140
|
1139
|
#if ENABLED(DELTA)
|
1141
|
1140
|
static float delta_clip_radius_2 = (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS);
|
1142
|
1141
|
static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); }
|
1143
|
|
- static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(X_MIN_POS, -clip), min(X_MAX_POS, clip)); }
|
1144
|
|
- static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(Y_MIN_POS, -clip), min(Y_MAX_POS, clip)); }
|
|
1142
|
+ static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(min_pos[X_AXIS], -clip), min(max_pos[X_AXIS], clip)); }
|
|
1143
|
+ static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(min_pos[Y_AXIS], -clip), min(max_pos[Y_AXIS], clip)); }
|
1145
|
1144
|
#else
|
1146
|
|
- static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, X_MIN_POS, X_MAX_POS); }
|
1147
|
|
- static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }
|
|
1145
|
+ static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, min_pos[X_AXIS], max_pos[X_AXIS]); }
|
|
1146
|
+ static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, min_pos[Y_AXIS], max_pos[Y_AXIS]); }
|
1148
|
1147
|
#endif
|
1149
|
|
-static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, Z_MIN_POS, Z_MAX_POS); }
|
|
1148
|
+static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, min_pos[Z_AXIS], max_pos[Z_AXIS]); }
|
1150
|
1149
|
static void lcd_move_e(
|
1151
|
1150
|
#if EXTRUDERS > 1
|
1152
|
1151
|
uint8_t e
|
|
@@ -1181,7 +1180,7 @@ static void lcd_move_e(
|
1181
|
1180
|
#endif //EXTRUDERS > 1
|
1182
|
1181
|
lcd_implementation_drawedit(pos_label, ftostr31(current_position[E_AXIS]));
|
1183
|
1182
|
}
|
1184
|
|
- if (LCD_CLICKED) lcd_goto_previous_menu();
|
|
1183
|
+ if (LCD_CLICKED) lcd_goto_previous_menu(true);
|
1185
|
1184
|
#if EXTRUDERS > 1
|
1186
|
1185
|
active_extruder = original_active_extruder;
|
1187
|
1186
|
#endif
|
|
@@ -1204,7 +1203,7 @@ static void lcd_move_e(
|
1204
|
1203
|
*
|
1205
|
1204
|
*/
|
1206
|
1205
|
|
1207
|
|
-static void lcd_move_menu_axis() {
|
|
1206
|
+static void _lcd_move_menu_axis() {
|
1208
|
1207
|
START_MENU();
|
1209
|
1208
|
MENU_ITEM(back, MSG_MOVE_AXIS);
|
1210
|
1209
|
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
|
|
@@ -1229,15 +1228,15 @@ static void lcd_move_menu_axis() {
|
1229
|
1228
|
|
1230
|
1229
|
static void lcd_move_menu_10mm() {
|
1231
|
1230
|
move_menu_scale = 10.0;
|
1232
|
|
- lcd_move_menu_axis();
|
|
1231
|
+ _lcd_move_menu_axis();
|
1233
|
1232
|
}
|
1234
|
1233
|
static void lcd_move_menu_1mm() {
|
1235
|
1234
|
move_menu_scale = 1.0;
|
1236
|
|
- lcd_move_menu_axis();
|
|
1235
|
+ _lcd_move_menu_axis();
|
1237
|
1236
|
}
|
1238
|
1237
|
static void lcd_move_menu_01mm() {
|
1239
|
1238
|
move_menu_scale = 0.1;
|
1240
|
|
- lcd_move_menu_axis();
|
|
1239
|
+ _lcd_move_menu_axis();
|
1241
|
1240
|
}
|
1242
|
1241
|
|
1243
|
1242
|
/**
|
|
@@ -1649,7 +1648,7 @@ static void lcd_control_volumetric_menu() {
|
1649
|
1648
|
lcd_implementation_drawedit(PSTR(MSG_CONTRAST), itostr2(lcd_contrast));
|
1650
|
1649
|
#endif
|
1651
|
1650
|
}
|
1652
|
|
- if (LCD_CLICKED) lcd_goto_previous_menu();
|
|
1651
|
+ if (LCD_CLICKED) lcd_goto_previous_menu(true);
|
1653
|
1652
|
}
|
1654
|
1653
|
#endif // HAS_LCD_CONTRAST
|
1655
|
1654
|
|
|
@@ -1778,8 +1777,9 @@ static void lcd_control_volumetric_menu() {
|
1778
|
1777
|
void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \
|
1779
|
1778
|
void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \
|
1780
|
1779
|
static void _menu_action_setting_edit_ ## _name (const char* pstr, _type* ptr, _type minValue, _type maxValue) { \
|
|
1780
|
+ lcd_save_previous_menu(); \
|
|
1781
|
+ \
|
1781
|
1782
|
lcdDrawUpdate = LCD_DRAW_UPDATE_CLEAR_CALL_REDRAW; \
|
1782
|
|
- currentMenu = menu_edit_ ## _name; \
|
1783
|
1783
|
\
|
1784
|
1784
|
editLabel = pstr; \
|
1785
|
1785
|
editValue = ptr; \
|
|
@@ -1796,14 +1796,14 @@ static void lcd_control_volumetric_menu() {
|
1796
|
1796
|
currentMenu = menu_edit_callback_ ## _name; \
|
1797
|
1797
|
callbackFunc = callback; \
|
1798
|
1798
|
}
|
1799
|
|
-menu_edit_type(int, int3, itostr3, 1)
|
1800
|
|
-menu_edit_type(float, float3, ftostr3, 1)
|
1801
|
|
-menu_edit_type(float, float32, ftostr32, 100)
|
1802
|
|
-menu_edit_type(float, float43, ftostr43, 1000)
|
1803
|
|
-menu_edit_type(float, float5, ftostr5, 0.01)
|
1804
|
|
-menu_edit_type(float, float51, ftostr51, 10)
|
1805
|
|
-menu_edit_type(float, float52, ftostr52, 100)
|
1806
|
|
-menu_edit_type(unsigned long, long5, ftostr5, 0.01)
|
|
1799
|
+menu_edit_type(int, int3, itostr3, 1);
|
|
1800
|
+menu_edit_type(float, float3, ftostr3, 1);
|
|
1801
|
+menu_edit_type(float, float32, ftostr32, 100);
|
|
1802
|
+menu_edit_type(float, float43, ftostr43, 1000);
|
|
1803
|
+menu_edit_type(float, float5, ftostr5, 0.01);
|
|
1804
|
+menu_edit_type(float, float51, ftostr51, 10);
|
|
1805
|
+menu_edit_type(float, float52, ftostr52, 100);
|
|
1806
|
+menu_edit_type(unsigned long, long5, ftostr5, 0.01);
|
1807
|
1807
|
|
1808
|
1808
|
/**
|
1809
|
1809
|
*
|
|
@@ -2182,7 +2182,7 @@ void lcd_update() {
|
2182
|
2182
|
// Return to Status Screen after a timeout
|
2183
|
2183
|
if (defer_return_to_status)
|
2184
|
2184
|
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
|
2185
|
|
- else if (currentMenu != lcd_status_screen && millis() > return_to_status_ms) {
|
|
2185
|
+ else if (currentMenu != lcd_status_screen && ms > return_to_status_ms) {
|
2186
|
2186
|
lcd_return_to_status();
|
2187
|
2187
|
}
|
2188
|
2188
|
|