|
@@ -43,8 +43,7 @@
|
43
|
43
|
#include "duration_t.h"
|
44
|
44
|
#endif
|
45
|
45
|
|
46
|
|
-int preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1,
|
47
|
|
- preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2;
|
|
46
|
+int lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
|
48
|
47
|
|
49
|
48
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
50
|
49
|
millis_t previous_lcd_status_ms = 0;
|
|
@@ -243,7 +242,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
243
|
242
|
*
|
244
|
243
|
* START_MENU Opening code for a screen with menu items.
|
245
|
244
|
* Scroll as-needed to keep the selected line in view.
|
246
|
|
- * 'wasClicked' indicates the controller was clicked.
|
247
|
245
|
*/
|
248
|
246
|
#define START_SCREEN() \
|
249
|
247
|
START_SCREEN_OR_MENU(LCD_HEIGHT); \
|
|
@@ -257,7 +255,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
257
|
255
|
if (encoderLine >= encoderTopLine + LCD_HEIGHT) { \
|
258
|
256
|
encoderTopLine = encoderLine - (LCD_HEIGHT - 1); \
|
259
|
257
|
} \
|
260
|
|
- bool wasClicked = LCD_CLICKED; \
|
261
|
258
|
bool _skipStatic = true; \
|
262
|
259
|
SCREEN_OR_MENU_LOOP()
|
263
|
260
|
|
|
@@ -288,8 +285,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
288
|
285
|
if (_menuLineNr == _thisItemNr) { \
|
289
|
286
|
if (lcdDrawUpdate) \
|
290
|
287
|
lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PSTR(LABEL), ## __VA_ARGS__); \
|
291
|
|
- if (wasClicked && encoderLine == _thisItemNr) { \
|
292
|
|
- lcd_quick_feedback()
|
|
288
|
+ if (lcd_clicked && encoderLine == _thisItemNr) {
|
293
|
289
|
|
294
|
290
|
#define _MENU_ITEM_PART_2(TYPE, ...) \
|
295
|
291
|
menu_action_ ## TYPE(__VA_ARGS__); \
|
|
@@ -381,9 +377,8 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
381
|
377
|
menuPosition screen_history[10];
|
382
|
378
|
uint8_t screen_history_depth = 0;
|
383
|
379
|
|
384
|
|
- bool ignore_click = false;
|
385
|
|
- bool wait_for_unclick;
|
386
|
|
- bool defer_return_to_status = false;
|
|
380
|
+ // LCD and menu clicks
|
|
381
|
+ bool lcd_clicked, wait_for_unclick, defer_return_to_status;
|
387
|
382
|
|
388
|
383
|
// Variables used when editing values.
|
389
|
384
|
const char* editLabel;
|
|
@@ -392,9 +387,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
392
|
387
|
screenFunc_t callbackFunc; // call this after editing
|
393
|
388
|
|
394
|
389
|
/**
|
395
|
|
- * General function to go directly to a menu
|
|
390
|
+ * General function to go directly to a screen
|
396
|
391
|
*/
|
397
|
|
- static void lcd_goto_screen(screenFunc_t screen, const bool feedback = false, const uint32_t encoder = 0) {
|
|
392
|
+ static void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0) {
|
398
|
393
|
if (currentScreen != screen) {
|
399
|
394
|
currentScreen = screen;
|
400
|
395
|
encoderPosition = encoder;
|
|
@@ -402,7 +397,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
402
|
397
|
defer_return_to_status = false;
|
403
|
398
|
screen_history_depth = 0;
|
404
|
399
|
}
|
405
|
|
- if (feedback) lcd_quick_feedback();
|
406
|
400
|
lcd_implementation_clear();
|
407
|
401
|
#if ENABLED(LCD_PROGRESS_BAR)
|
408
|
402
|
// For LCD_PROGRESS_BAR re-initialize custom characters
|
|
@@ -427,7 +421,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
427
|
421
|
--screen_history_depth;
|
428
|
422
|
lcd_goto_screen(
|
429
|
423
|
screen_history[screen_history_depth].menu_function,
|
430
|
|
- feedback,
|
431
|
424
|
screen_history[screen_history_depth].encoder_position
|
432
|
425
|
);
|
433
|
426
|
}
|
|
@@ -435,11 +428,6 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
435
|
428
|
lcd_return_to_status();
|
436
|
429
|
}
|
437
|
430
|
|
438
|
|
- void lcd_ignore_click(bool b) {
|
439
|
|
- ignore_click = b;
|
440
|
|
- wait_for_unclick = false;
|
441
|
|
- }
|
442
|
|
-
|
443
|
431
|
#endif // ULTIPANEL
|
444
|
432
|
|
445
|
433
|
/**
|
|
@@ -493,23 +481,7 @@ static void lcd_status_screen() {
|
493
|
481
|
|
494
|
482
|
#if ENABLED(ULTIPANEL)
|
495
|
483
|
|
496
|
|
- bool current_click = LCD_CLICKED;
|
497
|
|
-
|
498
|
|
- if (ignore_click) {
|
499
|
|
- if (wait_for_unclick) {
|
500
|
|
- if (!current_click)
|
501
|
|
- ignore_click = wait_for_unclick = false;
|
502
|
|
- else
|
503
|
|
- current_click = false;
|
504
|
|
- }
|
505
|
|
- else if (current_click) {
|
506
|
|
- lcd_quick_feedback();
|
507
|
|
- wait_for_unclick = true;
|
508
|
|
- current_click = false;
|
509
|
|
- }
|
510
|
|
- }
|
511
|
|
-
|
512
|
|
- if (current_click) {
|
|
484
|
+ if (lcd_clicked) {
|
513
|
485
|
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
514
|
486
|
previous_lcd_status_ms = millis(); // get status message to show up for a while
|
515
|
487
|
#endif
|
|
@@ -518,7 +490,7 @@ static void lcd_status_screen() {
|
518
|
490
|
false
|
519
|
491
|
#endif
|
520
|
492
|
);
|
521
|
|
- lcd_goto_screen(lcd_main_menu, true);
|
|
493
|
+ lcd_goto_screen(lcd_main_menu);
|
522
|
494
|
}
|
523
|
495
|
|
524
|
496
|
#if ENABLED(ULTIPANEL_FEEDMULTIPLY)
|
|
@@ -676,7 +648,7 @@ void kill_screen(const char* lcd_msg) {
|
676
|
648
|
long babysteps_done = 0;
|
677
|
649
|
|
678
|
650
|
static void _lcd_babystep(const AxisEnum axis, const char* msg) {
|
679
|
|
- if (LCD_CLICKED) { defer_return_to_status = false; lcd_goto_previous_menu(true); return; }
|
|
651
|
+ if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(true); }
|
680
|
652
|
ENCODER_DIRECTION_NORMAL();
|
681
|
653
|
if (encoderPosition) {
|
682
|
654
|
int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
|
|
@@ -914,29 +886,29 @@ void kill_screen(const char* lcd_msg) {
|
914
|
886
|
}
|
915
|
887
|
|
916
|
888
|
#if TEMP_SENSOR_0 != 0
|
917
|
|
- void lcd_preheat_pla0() { _lcd_preheat(0, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
|
918
|
|
- void lcd_preheat_abs0() { _lcd_preheat(0, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
|
|
889
|
+ void lcd_preheat_pla0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
|
|
890
|
+ void lcd_preheat_abs0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
|
919
|
891
|
#endif
|
920
|
892
|
|
921
|
893
|
#if HOTENDS > 1
|
922
|
|
- void lcd_preheat_pla1() { _lcd_preheat(1, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
|
923
|
|
- void lcd_preheat_abs1() { _lcd_preheat(1, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
|
|
894
|
+ void lcd_preheat_pla1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
|
|
895
|
+ void lcd_preheat_abs1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
|
924
|
896
|
#if HOTENDS > 2
|
925
|
|
- void lcd_preheat_pla2() { _lcd_preheat(2, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
|
926
|
|
- void lcd_preheat_abs2() { _lcd_preheat(2, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
|
|
897
|
+ void lcd_preheat_pla2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
|
|
898
|
+ void lcd_preheat_abs2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
|
927
|
899
|
#if HOTENDS > 3
|
928
|
|
- void lcd_preheat_pla3() { _lcd_preheat(3, preheatHotendTemp1, preheatBedTemp1, preheatFanSpeed1); }
|
929
|
|
- void lcd_preheat_abs3() { _lcd_preheat(3, preheatHotendTemp2, preheatBedTemp2, preheatFanSpeed2); }
|
|
900
|
+ void lcd_preheat_pla3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
|
|
901
|
+ void lcd_preheat_abs3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
|
930
|
902
|
#endif
|
931
|
903
|
#endif
|
932
|
904
|
|
933
|
905
|
void lcd_preheat_pla0123() {
|
934
|
906
|
#if HOTENDS > 1
|
935
|
|
- thermalManager.setTargetHotend(preheatHotendTemp1, 1);
|
|
907
|
+ thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1);
|
936
|
908
|
#if HOTENDS > 2
|
937
|
|
- thermalManager.setTargetHotend(preheatHotendTemp1, 2);
|
|
909
|
+ thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2);
|
938
|
910
|
#if HOTENDS > 3
|
939
|
|
- thermalManager.setTargetHotend(preheatHotendTemp1, 3);
|
|
911
|
+ thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3);
|
940
|
912
|
#endif
|
941
|
913
|
#endif
|
942
|
914
|
#endif
|
|
@@ -944,11 +916,11 @@ void kill_screen(const char* lcd_msg) {
|
944
|
916
|
}
|
945
|
917
|
void lcd_preheat_abs0123() {
|
946
|
918
|
#if HOTENDS > 1
|
947
|
|
- thermalManager.setTargetHotend(preheatHotendTemp2, 1);
|
|
919
|
+ thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1);
|
948
|
920
|
#if HOTENDS > 2
|
949
|
|
- thermalManager.setTargetHotend(preheatHotendTemp2, 2);
|
|
921
|
+ thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2);
|
950
|
922
|
#if HOTENDS > 3
|
951
|
|
- thermalManager.setTargetHotend(preheatHotendTemp2, 3);
|
|
923
|
+ thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3);
|
952
|
924
|
#endif
|
953
|
925
|
#endif
|
954
|
926
|
#endif
|
|
@@ -958,8 +930,8 @@ void kill_screen(const char* lcd_msg) {
|
958
|
930
|
#endif // HOTENDS > 1
|
959
|
931
|
|
960
|
932
|
#if TEMP_SENSOR_BED != 0
|
961
|
|
- void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, preheatBedTemp1, preheatFanSpeed1); }
|
962
|
|
- void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, preheatBedTemp2, preheatFanSpeed2); }
|
|
933
|
+ void lcd_preheat_pla_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); }
|
|
934
|
+ void lcd_preheat_abs_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); }
|
963
|
935
|
#endif
|
964
|
936
|
|
965
|
937
|
#if TEMP_SENSOR_0 != 0 && (TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_BED != 0)
|
|
@@ -1092,12 +1064,12 @@ void kill_screen(const char* lcd_msg) {
|
1092
|
1064
|
}
|
1093
|
1065
|
|
1094
|
1066
|
static bool debounce_click = false;
|
1095
|
|
- if (LCD_CLICKED) {
|
|
1067
|
+ if (lcd_clicked) {
|
1096
|
1068
|
if (!debounce_click) {
|
1097
|
1069
|
debounce_click = true; // ignore multiple "clicks" in a row
|
1098
|
1070
|
mbl.set_zigzag_z(_lcd_level_bed_position++, current_position[Z_AXIS]);
|
1099
|
1071
|
if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
|
1100
|
|
- lcd_goto_screen(_lcd_level_bed_done, true);
|
|
1072
|
+ lcd_goto_screen(_lcd_level_bed_done);
|
1101
|
1073
|
|
1102
|
1074
|
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT;
|
1103
|
1075
|
line_to_current(Z_AXIS);
|
|
@@ -1113,7 +1085,7 @@ void kill_screen(const char* lcd_msg) {
|
1113
|
1085
|
#endif
|
1114
|
1086
|
}
|
1115
|
1087
|
else {
|
1116
|
|
- lcd_goto_screen(_lcd_level_goto_next_point, true);
|
|
1088
|
+ lcd_goto_screen(_lcd_level_goto_next_point);
|
1117
|
1089
|
}
|
1118
|
1090
|
}
|
1119
|
1091
|
}
|
|
@@ -1171,7 +1143,7 @@ void kill_screen(const char* lcd_msg) {
|
1171
|
1143
|
*/
|
1172
|
1144
|
static void _lcd_level_bed_homing_done() {
|
1173
|
1145
|
if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING));
|
1174
|
|
- if (LCD_CLICKED) {
|
|
1146
|
+ if (lcd_clicked) {
|
1175
|
1147
|
_lcd_level_bed_position = 0;
|
1176
|
1148
|
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z
|
1177
|
1149
|
#if Z_HOME_DIR > 0
|
|
@@ -1179,7 +1151,7 @@ void kill_screen(const char* lcd_msg) {
|
1179
|
1151
|
#endif
|
1180
|
1152
|
;
|
1181
|
1153
|
planner.set_position_mm(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
1182
|
|
- lcd_goto_screen(_lcd_level_goto_next_point, true);
|
|
1154
|
+ lcd_goto_screen(_lcd_level_goto_next_point);
|
1183
|
1155
|
}
|
1184
|
1156
|
}
|
1185
|
1157
|
|
|
@@ -1385,7 +1357,7 @@ void kill_screen(const char* lcd_msg) {
|
1385
|
1357
|
*/
|
1386
|
1358
|
|
1387
|
1359
|
static void _lcd_move_xyz(const char* name, AxisEnum axis) {
|
1388
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
1360
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
1389
|
1361
|
ENCODER_DIRECTION_NORMAL();
|
1390
|
1362
|
if (encoderPosition) {
|
1391
|
1363
|
refresh_cmd_timeout();
|
|
@@ -1425,7 +1397,7 @@ void kill_screen(const char* lcd_msg) {
|
1425
|
1397
|
int8_t eindex=-1
|
1426
|
1398
|
#endif
|
1427
|
1399
|
) {
|
1428
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
1400
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
1429
|
1401
|
ENCODER_DIRECTION_NORMAL();
|
1430
|
1402
|
if (encoderPosition) {
|
1431
|
1403
|
current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
|
|
@@ -1793,20 +1765,15 @@ void kill_screen(const char* lcd_msg) {
|
1793
|
1765
|
END_MENU();
|
1794
|
1766
|
}
|
1795
|
1767
|
|
1796
|
|
- /**
|
1797
|
|
- *
|
1798
|
|
- * "Temperature" > "Preheat PLA conf" submenu
|
1799
|
|
- *
|
1800
|
|
- */
|
1801
|
|
- static void lcd_control_temperature_preheat_pla_settings_menu() {
|
|
1768
|
+ static void _lcd_control_temperature_preheat_settings_menu(uint8_t material) {
|
1802
|
1769
|
START_MENU();
|
1803
|
1770
|
MENU_BACK(MSG_TEMPERATURE);
|
1804
|
|
- MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed1, 0, 255);
|
|
1771
|
+ MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255);
|
1805
|
1772
|
#if TEMP_SENSOR_0 != 0
|
1806
|
|
- MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp1, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
|
|
1773
|
+ MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
|
1807
|
1774
|
#endif
|
1808
|
1775
|
#if TEMP_SENSOR_BED != 0
|
1809
|
|
- MENU_ITEM_EDIT(int3, MSG_BED, &preheatBedTemp1, BED_MINTEMP, BED_MAXTEMP - 15);
|
|
1776
|
+ MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15);
|
1810
|
1777
|
#endif
|
1811
|
1778
|
#if ENABLED(EEPROM_SETTINGS)
|
1812
|
1779
|
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
|
|
@@ -1816,24 +1783,17 @@ void kill_screen(const char* lcd_msg) {
|
1816
|
1783
|
|
1817
|
1784
|
/**
|
1818
|
1785
|
*
|
|
1786
|
+ * "Temperature" > "Preheat PLA conf" submenu
|
|
1787
|
+ *
|
|
1788
|
+ */
|
|
1789
|
+ static void lcd_control_temperature_preheat_pla_settings_menu() { _lcd_control_temperature_preheat_settings_menu(0); }
|
|
1790
|
+
|
|
1791
|
+ /**
|
|
1792
|
+ *
|
1819
|
1793
|
* "Temperature" > "Preheat ABS conf" submenu
|
1820
|
1794
|
*
|
1821
|
1795
|
*/
|
1822
|
|
- static void lcd_control_temperature_preheat_abs_settings_menu() {
|
1823
|
|
- START_MENU();
|
1824
|
|
- MENU_BACK(MSG_TEMPERATURE);
|
1825
|
|
- MENU_ITEM_EDIT(int3, MSG_FAN_SPEED, &preheatFanSpeed2, 0, 255);
|
1826
|
|
- #if TEMP_SENSOR_0 != 0
|
1827
|
|
- MENU_ITEM_EDIT(int3, MSG_NOZZLE, &preheatHotendTemp2, HEATER_0_MINTEMP, HEATER_0_MAXTEMP - 15);
|
1828
|
|
- #endif
|
1829
|
|
- #if TEMP_SENSOR_BED != 0
|
1830
|
|
- MENU_ITEM_EDIT(int3, MSG_BED, &preheatBedTemp2, BED_MINTEMP, BED_MAXTEMP - 15);
|
1831
|
|
- #endif
|
1832
|
|
- #if ENABLED(EEPROM_SETTINGS)
|
1833
|
|
- MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
|
1834
|
|
- #endif
|
1835
|
|
- END_MENU();
|
1836
|
|
- }
|
|
1796
|
+ static void lcd_control_temperature_preheat_abs_settings_menu() { _lcd_control_temperature_preheat_settings_menu(1); }
|
1837
|
1797
|
|
1838
|
1798
|
static void _reset_acceleration_rates() { planner.reset_acceleration_rates(); }
|
1839
|
1799
|
static void _planner_refresh_positioning() { planner.refresh_positioning(); }
|
|
@@ -1924,7 +1884,7 @@ void kill_screen(const char* lcd_msg) {
|
1924
|
1884
|
*/
|
1925
|
1885
|
#if HAS_LCD_CONTRAST
|
1926
|
1886
|
static void lcd_set_contrast() {
|
1927
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
1887
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
1928
|
1888
|
ENCODER_DIRECTION_NORMAL();
|
1929
|
1889
|
if (encoderPosition) {
|
1930
|
1890
|
set_lcd_contrast(lcd_contrast + encoderPosition);
|
|
@@ -1991,7 +1951,7 @@ void kill_screen(const char* lcd_msg) {
|
1991
|
1951
|
*/
|
1992
|
1952
|
void lcd_sdcard_menu() {
|
1993
|
1953
|
ENCODER_DIRECTION_MENUS();
|
1994
|
|
- if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return; // nothing to do (so don't thrash the SD card)
|
|
1954
|
+ if (!lcdDrawUpdate && !lcd_clicked) return; // nothing to do (so don't thrash the SD card)
|
1995
|
1955
|
uint16_t fileCnt = card.getnrfilenames();
|
1996
|
1956
|
START_MENU();
|
1997
|
1957
|
MENU_BACK(MSG_MAIN);
|
|
@@ -2037,7 +1997,7 @@ void kill_screen(const char* lcd_msg) {
|
2037
|
1997
|
*
|
2038
|
1998
|
*/
|
2039
|
1999
|
static void lcd_info_stats_menu() {
|
2040
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
2000
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
2041
|
2001
|
|
2042
|
2002
|
char buffer[21];
|
2043
|
2003
|
printStatistics stats = print_job_timer.getStats();
|
|
@@ -2071,7 +2031,7 @@ void kill_screen(const char* lcd_msg) {
|
2071
|
2031
|
*
|
2072
|
2032
|
*/
|
2073
|
2033
|
static void lcd_info_thermistors_menu() {
|
2074
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
2034
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
2075
|
2035
|
START_SCREEN();
|
2076
|
2036
|
#define THERMISTOR_ID TEMP_SENSOR_0
|
2077
|
2037
|
#include "thermistornames.h"
|
|
@@ -2123,7 +2083,7 @@ void kill_screen(const char* lcd_msg) {
|
2123
|
2083
|
*
|
2124
|
2084
|
*/
|
2125
|
2085
|
static void lcd_info_board_menu() {
|
2126
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
2086
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
2127
|
2087
|
START_SCREEN();
|
2128
|
2088
|
STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
|
2129
|
2089
|
STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
|
|
@@ -2144,7 +2104,7 @@ void kill_screen(const char* lcd_msg) {
|
2144
|
2104
|
*
|
2145
|
2105
|
*/
|
2146
|
2106
|
static void lcd_info_printer_menu() {
|
2147
|
|
- if (LCD_CLICKED) { lcd_goto_previous_menu(true); return; }
|
|
2107
|
+ if (lcd_clicked) { return lcd_goto_previous_menu(true); }
|
2148
|
2108
|
START_SCREEN();
|
2149
|
2109
|
STATIC_ITEM(MSG_MARLIN, true, true); // Marlin
|
2150
|
2110
|
STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch
|
|
@@ -2334,16 +2294,15 @@ void kill_screen(const char* lcd_msg) {
|
2334
|
2294
|
#define menu_edit_type(_type, _name, _strFunc, scale) \
|
2335
|
2295
|
bool _menu_edit_ ## _name () { \
|
2336
|
2296
|
ENCODER_DIRECTION_NORMAL(); \
|
2337
|
|
- bool isClicked = LCD_CLICKED; \
|
2338
|
2297
|
if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
|
2339
|
2298
|
if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \
|
2340
|
2299
|
if (lcdDrawUpdate) \
|
2341
|
2300
|
lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
|
2342
|
|
- if (isClicked) { \
|
|
2301
|
+ if (lcd_clicked) { \
|
2343
|
2302
|
*((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
|
2344
|
2303
|
lcd_goto_previous_menu(true); \
|
2345
|
2304
|
} \
|
2346
|
|
- return isClicked; \
|
|
2305
|
+ return lcd_clicked; \
|
2347
|
2306
|
} \
|
2348
|
2307
|
void menu_edit_ ## _name () { _menu_edit_ ## _name(); } \
|
2349
|
2308
|
void menu_edit_callback_ ## _name () { if (_menu_edit_ ## _name ()) (*callbackFunc)(); } \
|
|
@@ -2614,9 +2573,20 @@ void lcd_update() {
|
2614
|
2573
|
#if ENABLED(ULTIPANEL)
|
2615
|
2574
|
static millis_t return_to_status_ms = 0;
|
2616
|
2575
|
manage_manual_move();
|
2617
|
|
- #endif
|
2618
|
2576
|
|
2619
|
|
- lcd_buttons_update();
|
|
2577
|
+ lcd_buttons_update();
|
|
2578
|
+
|
|
2579
|
+ // If the action button is pressed...
|
|
2580
|
+ if (LCD_CLICKED) {
|
|
2581
|
+ if (!wait_for_unclick) { // If not waiting for a debounce release:
|
|
2582
|
+ wait_for_unclick = true; // Set debounce flag to ignore continous clicks
|
|
2583
|
+ lcd_clicked = !wait_for_user; // Keep the click if not waiting for a user-click
|
|
2584
|
+ wait_for_user = false; // Any click clears wait for user
|
|
2585
|
+ lcd_quick_feedback(); // Always make a click sound
|
|
2586
|
+ }
|
|
2587
|
+ }
|
|
2588
|
+ else wait_for_unclick = false;
|
|
2589
|
+ #endif
|
2620
|
2590
|
|
2621
|
2591
|
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
|
2622
|
2592
|
|
|
@@ -2691,7 +2661,7 @@ void lcd_update() {
|
2691
|
2661
|
#endif // REPRAPWORLD_KEYPAD
|
2692
|
2662
|
|
2693
|
2663
|
bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
|
2694
|
|
- if (encoderPastThreshold || LCD_CLICKED) {
|
|
2664
|
+ if (encoderPastThreshold || lcd_clicked) {
|
2695
|
2665
|
if (encoderPastThreshold) {
|
2696
|
2666
|
int32_t encoderMultiplier = 1;
|
2697
|
2667
|
|
|
@@ -2757,7 +2727,7 @@ void lcd_update() {
|
2757
|
2727
|
}
|
2758
|
2728
|
|
2759
|
2729
|
#if ENABLED(ULTIPANEL)
|
2760
|
|
- #define CURRENTSCREEN() (*currentScreen)()
|
|
2730
|
+ #define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false
|
2761
|
2731
|
#else
|
2762
|
2732
|
#define CURRENTSCREEN() lcd_status_screen()
|
2763
|
2733
|
#endif
|
|
@@ -3020,8 +2990,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
3020
|
2990
|
#endif
|
3021
|
2991
|
}
|
3022
|
2992
|
|
3023
|
|
- bool lcd_clicked() { return LCD_CLICKED; }
|
3024
|
|
-
|
3025
|
2993
|
#endif // ULTIPANEL
|
3026
|
2994
|
|
3027
|
2995
|
#endif // ULTRA_LCD
|