|
@@ -85,12 +85,13 @@ int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_spe
|
85
|
85
|
#endif
|
86
|
86
|
|
87
|
87
|
uint8_t lcd_status_update_delay = 1, // First update one loop delayed
|
88
|
|
- lcd_status_message_level; // Higher level overrides lower
|
|
88
|
+ lcd_status_message_level; // Higher level blocks lower level
|
89
|
89
|
char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
|
90
|
90
|
|
91
|
91
|
#if ENABLED(STATUS_MESSAGE_SCROLLING)
|
92
|
92
|
uint8_t status_scroll_pos = 0;
|
93
|
93
|
#endif
|
|
94
|
+
|
94
|
95
|
#if ENABLED(SCROLL_LONG_FILENAMES)
|
95
|
96
|
uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash;
|
96
|
97
|
#endif
|
|
@@ -163,8 +164,6 @@ uint16_t max_display_update_time = 0;
|
163
|
164
|
extern bool powersupply_on;
|
164
|
165
|
#endif
|
165
|
166
|
|
166
|
|
- float move_menu_scale;
|
167
|
|
-
|
168
|
167
|
////////////////////////////////////////////
|
169
|
168
|
///////////////// Menu Tree ////////////////
|
170
|
169
|
////////////////////////////////////////////
|
|
@@ -244,7 +243,6 @@ uint16_t max_display_update_time = 0;
|
244
|
243
|
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=false); \
|
245
|
244
|
typedef void _name##_void
|
246
|
245
|
|
247
|
|
- DECLARE_MENU_EDIT_TYPE(uint32_t, long5);
|
248
|
246
|
DECLARE_MENU_EDIT_TYPE(int16_t, int3);
|
249
|
247
|
DECLARE_MENU_EDIT_TYPE(uint8_t, int8);
|
250
|
248
|
DECLARE_MENU_EDIT_TYPE(float, float3);
|
|
@@ -254,6 +252,7 @@ uint16_t max_display_update_time = 0;
|
254
|
252
|
DECLARE_MENU_EDIT_TYPE(float, float51);
|
255
|
253
|
DECLARE_MENU_EDIT_TYPE(float, float52);
|
256
|
254
|
DECLARE_MENU_EDIT_TYPE(float, float62);
|
|
255
|
+ DECLARE_MENU_EDIT_TYPE(uint32_t, long5);
|
257
|
256
|
|
258
|
257
|
void menu_action_setting_edit_bool(const char* pstr, bool* ptr);
|
259
|
258
|
void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc);
|
|
@@ -566,10 +565,9 @@ uint16_t max_display_update_time = 0;
|
566
|
565
|
static bool no_reentry = false;
|
567
|
566
|
if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message);
|
568
|
567
|
if (no_reentry) return;
|
569
|
|
-
|
570
|
568
|
// Make this the current handler till all moves are done
|
571
|
569
|
no_reentry = true;
|
572
|
|
- screenFunc_t old_screen = currentScreen;
|
|
570
|
+ const screenFunc_t old_screen = currentScreen;
|
573
|
571
|
lcd_goto_screen(_lcd_synchronize);
|
574
|
572
|
stepper.synchronize();
|
575
|
573
|
no_reentry = false;
|
|
@@ -997,7 +995,7 @@ void kill_screen(const char* lcd_msg) {
|
997
|
995
|
#if ENABLED(SDSUPPORT)
|
998
|
996
|
if (card.cardOK) {
|
999
|
997
|
if (card.isFileOpen()) {
|
1000
|
|
- if (IS_SD_PRINTING)
|
|
998
|
+ if (card.sdprinting)
|
1001
|
999
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
|
1002
|
1000
|
else
|
1003
|
1001
|
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
|
|
@@ -1074,7 +1072,7 @@ void kill_screen(const char* lcd_msg) {
|
1074
|
1072
|
if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp);
|
1075
|
1073
|
|
1076
|
1074
|
// Draw cw/ccw indicator and up/down arrows.
|
1077
|
|
- if (PAGE_CONTAINS(47,62)) {
|
|
1075
|
+ if (PAGE_CONTAINS(47, 62)) {
|
1078
|
1076
|
u8g.drawBitmapP(left + 0, 47, 3, 16, rot_down);
|
1079
|
1077
|
u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up);
|
1080
|
1078
|
u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp);
|
|
@@ -1115,6 +1113,8 @@ void kill_screen(const char* lcd_msg) {
|
1115
|
1113
|
ENCODER_DIRECTION_NORMAL();
|
1116
|
1114
|
if (encoderPosition) {
|
1117
|
1115
|
const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR);
|
|
1116
|
+ encoderPosition = 0;
|
|
1117
|
+
|
1118
|
1118
|
const float new_zoffset = zprobe_zoffset + planner.steps_to_mm[Z_AXIS] * babystep_increment;
|
1119
|
1119
|
if (WITHIN(new_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
|
1120
|
1120
|
|
|
@@ -1124,7 +1124,6 @@ void kill_screen(const char* lcd_msg) {
|
1124
|
1124
|
zprobe_zoffset = new_zoffset;
|
1125
|
1125
|
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
|
1126
|
1126
|
}
|
1127
|
|
- encoderPosition = 0;
|
1128
|
1127
|
}
|
1129
|
1128
|
if (lcdDrawUpdate) {
|
1130
|
1129
|
lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));
|
|
@@ -1164,11 +1163,12 @@ void kill_screen(const char* lcd_msg) {
|
1164
|
1163
|
mesh_edit_value = float(rounded - (rounded % 5L)) / 1000.0;
|
1165
|
1164
|
}
|
1166
|
1165
|
|
1167
|
|
- if (lcdDrawUpdate)
|
|
1166
|
+ if (lcdDrawUpdate) {
|
1168
|
1167
|
lcd_implementation_drawedit(msg, ftostr43sign(mesh_edit_value));
|
1169
|
1168
|
#if ENABLED(MESH_EDIT_GFX_OVERLAY)
|
1170
|
1169
|
_lcd_zoffset_overlay_gfx(mesh_edit_value);
|
1171
|
1170
|
#endif
|
|
1171
|
+ }
|
1172
|
1172
|
}
|
1173
|
1173
|
|
1174
|
1174
|
void _lcd_mesh_edit_NOP() {
|
|
@@ -1182,7 +1182,7 @@ void kill_screen(const char* lcd_msg) {
|
1182
|
1182
|
return mesh_edit_value;
|
1183
|
1183
|
}
|
1184
|
1184
|
|
1185
|
|
- void lcd_mesh_edit_setup(float initial) {
|
|
1185
|
+ void lcd_mesh_edit_setup(const float initial) {
|
1186
|
1186
|
mesh_edit_value = mesh_edit_accumulator = initial;
|
1187
|
1187
|
lcd_goto_screen(_lcd_mesh_edit_NOP);
|
1188
|
1188
|
}
|
|
@@ -1203,6 +1203,7 @@ void kill_screen(const char* lcd_msg) {
|
1203
|
1203
|
|
1204
|
1204
|
#endif // AUTO_BED_LEVELING_UBL
|
1205
|
1205
|
|
|
1206
|
+
|
1206
|
1207
|
/**
|
1207
|
1208
|
* Watch temperature callbacks
|
1208
|
1209
|
*/
|
|
@@ -2030,8 +2031,8 @@ void kill_screen(const char* lcd_msg) {
|
2030
|
2031
|
*/
|
2031
|
2032
|
void _lcd_ubl_adjust_height_cmd() {
|
2032
|
2033
|
char UBL_LCD_GCODE[16];
|
2033
|
|
- const int ind = ubl_height_amount < 0 ? 6 : 7;
|
2034
|
|
- strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6-"));
|
|
2034
|
+ const int ind = ubl_height_amount > 0 ? 9 : 10;
|
|
2035
|
+ strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -"));
|
2035
|
2036
|
sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), abs(ubl_height_amount));
|
2036
|
2037
|
enqueue_and_echo_command(UBL_LCD_GCODE);
|
2037
|
2038
|
}
|
|
@@ -2047,8 +2048,7 @@ void kill_screen(const char* lcd_msg) {
|
2047
|
2048
|
void _lcd_ubl_height_adjust_menu() {
|
2048
|
2049
|
START_MENU();
|
2049
|
2050
|
MENU_BACK(MSG_UBL_EDIT_MESH_MENU);
|
2050
|
|
- MENU_ITEM_EDIT(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9);
|
2051
|
|
- MENU_ITEM(function, MSG_UBL_MESH_HEIGHT_ADJUST, _lcd_ubl_adjust_height_cmd);
|
|
2051
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd);
|
2052
|
2052
|
MENU_ITEM(function, MSG_WATCH, lcd_return_to_status);
|
2053
|
2053
|
END_MENU();
|
2054
|
2054
|
}
|
|
@@ -2184,8 +2184,7 @@ void kill_screen(const char* lcd_msg) {
|
2184
|
2184
|
void _lcd_ubl_fillin_menu() {
|
2185
|
2185
|
START_MENU();
|
2186
|
2186
|
MENU_BACK(MSG_UBL_BUILD_MESH_MENU);
|
2187
|
|
- MENU_ITEM_EDIT(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9);
|
2188
|
|
- MENU_ITEM(function, MSG_UBL_FILLIN_MESH, _lcd_ubl_fillin_amount_cmd);
|
|
2187
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd);
|
2189
|
2188
|
MENU_ITEM(function, MSG_UBL_SMART_FILLIN, _lcd_ubl_smart_fillin_cmd);
|
2190
|
2189
|
MENU_ITEM(gcode, MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0"));
|
2191
|
2190
|
MENU_ITEM(function, MSG_WATCH, lcd_return_to_status);
|
|
@@ -2644,6 +2643,8 @@ void kill_screen(const char* lcd_msg) {
|
2644
|
2643
|
END_MENU();
|
2645
|
2644
|
}
|
2646
|
2645
|
|
|
2646
|
+ float move_menu_scale;
|
|
2647
|
+
|
2647
|
2648
|
#if ENABLED(DELTA_CALIBRATION_MENU) || (ENABLED(DELTA_AUTO_CALIBRATION) && !HAS_BED_PROBE)
|
2648
|
2649
|
|
2649
|
2650
|
void lcd_move_z();
|
|
@@ -2653,13 +2654,11 @@ void kill_screen(const char* lcd_msg) {
|
2653
|
2654
|
reset_bed_level(); // After calibration bed-level data is no longer valid
|
2654
|
2655
|
#endif
|
2655
|
2656
|
|
2656
|
|
- float z_dest = (Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
|
2657
|
|
- line_to_z(z_dest);
|
|
2657
|
+ line_to_z((Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5);
|
2658
|
2658
|
current_position[X_AXIS] = rx;
|
2659
|
2659
|
current_position[Y_AXIS] = ry;
|
2660
|
2660
|
line_to_current_z();
|
2661
|
|
- z_dest = Z_CLEARANCE_BETWEEN_PROBES;
|
2662
|
|
- line_to_z(z_dest);
|
|
2661
|
+ line_to_z(Z_CLEARANCE_BETWEEN_PROBES);
|
2663
|
2662
|
|
2664
|
2663
|
lcd_synchronize();
|
2665
|
2664
|
move_menu_scale = PROBE_MANUALLY_STEP;
|
|
@@ -2813,7 +2812,6 @@ void kill_screen(const char* lcd_msg) {
|
2813
|
2812
|
#endif
|
2814
|
2813
|
manual_move_e_index = eindex >= 0 ? eindex : active_extruder;
|
2815
|
2814
|
#endif
|
2816
|
|
-
|
2817
|
2815
|
manual_move_start_time = millis() + (move_menu_scale < 0.99 ? 0UL : 250UL); // delay for bigger moves
|
2818
|
2816
|
manual_move_axis = (int8_t)axis;
|
2819
|
2817
|
}
|
|
@@ -2830,6 +2828,7 @@ void kill_screen(const char* lcd_msg) {
|
2830
|
2828
|
if (encoderPosition && !processing_manual_move) {
|
2831
|
2829
|
gcode.refresh_cmd_timeout();
|
2832
|
2830
|
|
|
2831
|
+ // Start with no limits to movement
|
2833
|
2832
|
float min = current_position[axis] - 1000,
|
2834
|
2833
|
max = current_position[axis] + 1000;
|
2835
|
2834
|
|
|
@@ -2867,7 +2866,7 @@ void kill_screen(const char* lcd_msg) {
|
2867
|
2866
|
// This assumes the center is 0,0
|
2868
|
2867
|
#if ENABLED(DELTA)
|
2869
|
2868
|
if (axis != Z_AXIS) {
|
2870
|
|
- max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis]));
|
|
2869
|
+ max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis
|
2871
|
2870
|
min = -max;
|
2872
|
2871
|
}
|
2873
|
2872
|
#endif
|
|
@@ -3131,7 +3130,7 @@ void kill_screen(const char* lcd_msg) {
|
3131
|
3130
|
MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
|
3132
|
3131
|
|
3133
|
3132
|
#if HAS_LCD_CONTRAST
|
3134
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, (int16_t*)&lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true);
|
|
3133
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true);
|
3135
|
3134
|
#endif
|
3136
|
3135
|
#if ENABLED(FWRETRACT)
|
3137
|
3136
|
MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
|
|
@@ -3724,7 +3723,7 @@ void kill_screen(const char* lcd_msg) {
|
3724
|
3723
|
|
3725
|
3724
|
lcd_goto_screen(lcd_sdcard_menu, last_sdfile_encoderPosition);
|
3726
|
3725
|
defer_return_to_status = true;
|
3727
|
|
- last_sdfile_encoderPosition == 0xFFFF;
|
|
3726
|
+ last_sdfile_encoderPosition = 0xFFFF;
|
3728
|
3727
|
|
3729
|
3728
|
#if ENABLED(DOGLCD)
|
3730
|
3729
|
lcd_update();
|
|
@@ -3749,29 +3748,27 @@ void kill_screen(const char* lcd_msg) {
|
3749
|
3748
|
MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
|
3750
|
3749
|
}
|
3751
|
3750
|
|
3752
|
|
- if (fileCnt) {
|
3753
|
|
- for (uint16_t i = 0; i < fileCnt; i++) {
|
3754
|
|
- if (_menuLineNr == _thisItemNr) {
|
3755
|
|
- const uint16_t nr =
|
3756
|
|
- #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)
|
3757
|
|
- fileCnt - 1 -
|
3758
|
|
- #endif
|
3759
|
|
- i;
|
3760
|
|
-
|
3761
|
|
- #if ENABLED(SDCARD_SORT_ALPHA)
|
3762
|
|
- card.getfilename_sorted(nr);
|
3763
|
|
- #else
|
3764
|
|
- card.getfilename(nr);
|
|
3751
|
+ for (uint16_t i = 0; i < fileCnt; i++) {
|
|
3752
|
+ if (_menuLineNr == _thisItemNr) {
|
|
3753
|
+ const uint16_t nr =
|
|
3754
|
+ #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)
|
|
3755
|
+ fileCnt - 1 -
|
3765
|
3756
|
#endif
|
|
3757
|
+ i;
|
3766
|
3758
|
|
3767
|
|
- if (card.filenameIsDir)
|
3768
|
|
- MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
|
3769
|
|
- else
|
3770
|
|
- MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
|
3771
|
|
- }
|
3772
|
|
- else {
|
3773
|
|
- MENU_ITEM_DUMMY();
|
3774
|
|
- }
|
|
3759
|
+ #if ENABLED(SDCARD_SORT_ALPHA)
|
|
3760
|
+ card.getfilename_sorted(nr);
|
|
3761
|
+ #else
|
|
3762
|
+ card.getfilename(nr);
|
|
3763
|
+ #endif
|
|
3764
|
+
|
|
3765
|
+ if (card.filenameIsDir)
|
|
3766
|
+ MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
|
|
3767
|
+ else
|
|
3768
|
+ MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
|
|
3769
|
+ }
|
|
3770
|
+ else {
|
|
3771
|
+ MENU_ITEM_DUMMY();
|
3775
|
3772
|
}
|
3776
|
3773
|
}
|
3777
|
3774
|
END_MENU();
|
|
@@ -4476,13 +4473,14 @@ void lcd_init() {
|
4476
|
4473
|
lcd_implementation_init();
|
4477
|
4474
|
|
4478
|
4475
|
#if ENABLED(NEWPANEL)
|
4479
|
|
-
|
4480
|
4476
|
#if BUTTON_EXISTS(EN1)
|
4481
|
4477
|
SET_INPUT_PULLUP(BTN_EN1);
|
4482
|
4478
|
#endif
|
|
4479
|
+
|
4483
|
4480
|
#if BUTTON_EXISTS(EN2)
|
4484
|
4481
|
SET_INPUT_PULLUP(BTN_EN2);
|
4485
|
4482
|
#endif
|
|
4483
|
+
|
4486
|
4484
|
#if BUTTON_EXISTS(ENC)
|
4487
|
4485
|
SET_INPUT_PULLUP(BTN_ENC);
|
4488
|
4486
|
#endif
|
|
@@ -4684,7 +4682,7 @@ void lcd_update() {
|
4684
|
4682
|
|
4685
|
4683
|
#endif
|
4686
|
4684
|
|
4687
|
|
- bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
|
|
4685
|
+ const bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
|
4688
|
4686
|
if (encoderPastThreshold || lcd_clicked) {
|
4689
|
4687
|
if (encoderPastThreshold) {
|
4690
|
4688
|
int32_t encoderMultiplier = 1;
|
|
@@ -4979,11 +4977,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
4979
|
4977
|
if (BUTTON_PRESSED(ENC)) newbutton |= EN_C;
|
4980
|
4978
|
#endif
|
4981
|
4979
|
|
4982
|
|
- buttons = newbutton;
|
4983
|
|
- #if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
4984
|
|
- buttons |= slow_buttons;
|
4985
|
|
- #endif
|
4986
|
|
-
|
4987
|
4980
|
//
|
4988
|
4981
|
// Directional buttons
|
4989
|
4982
|
//
|
|
@@ -5032,6 +5025,11 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
5032
|
5025
|
|
5033
|
5026
|
#endif // LCD_HAS_DIRECTIONAL_BUTTONS
|
5034
|
5027
|
|
|
5028
|
+ buttons = newbutton;
|
|
5029
|
+ #if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
|
5030
|
+ buttons |= slow_buttons;
|
|
5031
|
+ #endif
|
|
5032
|
+
|
5035
|
5033
|
#if ENABLED(ADC_KEYPAD)
|
5036
|
5034
|
|
5037
|
5035
|
uint8_t newbutton_reprapworld_keypad = 0;
|