|
@@ -57,16 +57,12 @@
|
57
|
57
|
#endif
|
58
|
58
|
|
59
|
59
|
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
|
60
|
|
- bool lcd_external_control;
|
|
60
|
+ bool lcd_external_control; // = false
|
61
|
61
|
#endif
|
62
|
62
|
|
63
|
63
|
// Initialized by settings.load()
|
64
|
64
|
int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
|
65
|
65
|
|
66
|
|
-#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
|
67
|
|
- uint8_t progress_bar_percent;
|
68
|
|
-#endif
|
69
|
|
-
|
70
|
66
|
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
|
71
|
67
|
millis_t previous_lcd_status_ms = 0;
|
72
|
68
|
#endif
|
|
@@ -92,6 +88,10 @@ char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kan
|
92
|
88
|
uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash;
|
93
|
89
|
#endif
|
94
|
90
|
|
|
91
|
+#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
|
|
92
|
+ uint8_t progress_bar_percent;
|
|
93
|
+#endif
|
|
94
|
+
|
95
|
95
|
#if ENABLED(DOGLCD)
|
96
|
96
|
#include "ultralcd_impl_DOGM.h"
|
97
|
97
|
#include <U8glib.h>
|
|
@@ -259,10 +259,6 @@ uint16_t max_display_update_time = 0;
|
259
|
259
|
//////////// Menu System Macros ////////////
|
260
|
260
|
////////////////////////////////////////////
|
261
|
261
|
|
262
|
|
- #ifndef ENCODER_FEEDRATE_DEADZONE
|
263
|
|
- #define ENCODER_FEEDRATE_DEADZONE 6
|
264
|
|
- #endif
|
265
|
|
-
|
266
|
262
|
/**
|
267
|
263
|
* MENU_ITEM generates draw & handler code for a menu item, potentially calling:
|
268
|
264
|
*
|
|
@@ -734,7 +730,7 @@ void kill_screen(const char* lcd_msg) {
|
734
|
730
|
* Audio feedback for controller clicks
|
735
|
731
|
*
|
736
|
732
|
*/
|
737
|
|
- void lcd_buzz(long duration, uint16_t freq) {
|
|
733
|
+ void lcd_buzz(const long duration, const uint16_t freq) {
|
738
|
734
|
#if ENABLED(LCD_USE_I2C_BUZZER)
|
739
|
735
|
lcd.buzz(duration, freq);
|
740
|
736
|
#elif PIN_EXISTS(BEEPER)
|
|
@@ -1180,7 +1176,7 @@ void kill_screen(const char* lcd_msg) {
|
1180
|
1176
|
return mesh_edit_value;
|
1181
|
1177
|
}
|
1182
|
1178
|
|
1183
|
|
- void lcd_mesh_edit_setup(float initial) {
|
|
1179
|
+ void lcd_mesh_edit_setup(const float initial) {
|
1184
|
1180
|
mesh_edit_value = mesh_edit_accumulator = initial;
|
1185
|
1181
|
lcd_goto_screen(_lcd_mesh_edit_NOP);
|
1186
|
1182
|
}
|
|
@@ -1332,9 +1328,9 @@ void kill_screen(const char* lcd_msg) {
|
1332
|
1328
|
#if FAN_COUNT > 0
|
1333
|
1329
|
#if HAS_FAN0
|
1334
|
1330
|
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fanSpeeds[0], 0, 255);
|
1335
|
|
- #if ENABLED(EXTRA_FAN_SPEED)
|
|
1331
|
+ #if ENABLED(EXTRA_FAN_SPEED)
|
1336
|
1332
|
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fanSpeeds[0], 3, 255);
|
1337
|
|
- #endif
|
|
1333
|
+ #endif
|
1338
|
1334
|
#endif
|
1339
|
1335
|
#if HAS_FAN1
|
1340
|
1336
|
MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED " 2", &fanSpeeds[1], 0, 255);
|
|
@@ -1836,7 +1832,6 @@ void kill_screen(const char* lcd_msg) {
|
1836
|
1832
|
/**
|
1837
|
1833
|
* Step 6: Display "Next point: 1 / 9" while waiting for move to finish
|
1838
|
1834
|
*/
|
1839
|
|
-
|
1840
|
1835
|
void _lcd_level_bed_moving() {
|
1841
|
1836
|
if (lcdDrawUpdate) {
|
1842
|
1837
|
char msg[10];
|
|
@@ -2649,7 +2644,7 @@ void kill_screen(const char* lcd_msg) {
|
2649
|
2644
|
|
2650
|
2645
|
void lcd_move_z();
|
2651
|
2646
|
|
2652
|
|
- void _man_probe_pt(const float rx, const float ry) {
|
|
2647
|
+ void _man_probe_pt(const float &rx, const float &ry) {
|
2653
|
2648
|
#if HAS_LEVELING
|
2654
|
2649
|
reset_bed_level(); // After calibration bed-level data is no longer valid
|
2655
|
2650
|
#endif
|
|
@@ -2712,7 +2707,7 @@ void kill_screen(const char* lcd_msg) {
|
2712
|
2707
|
void lcd_delta_settings() {
|
2713
|
2708
|
START_MENU();
|
2714
|
2709
|
MENU_BACK(MSG_DELTA_CALIBRATE);
|
2715
|
|
- MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_DIAG_ROG, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, recalc_delta_settings);
|
|
2710
|
+ MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5.0, delta_diagonal_rod + 5.0, recalc_delta_settings);
|
2716
|
2711
|
MENU_ITEM_EDIT_CALLBACK(float52, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10.0, delta_height + 10.0, recalc_delta_settings);
|
2717
|
2712
|
MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5.0, 5.0, recalc_delta_settings);
|
2718
|
2713
|
MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5.0, 5.0, recalc_delta_settings);
|
|
@@ -2785,10 +2780,7 @@ void kill_screen(const char* lcd_msg) {
|
2785
|
2780
|
manual_move_offset = 0.0;
|
2786
|
2781
|
manual_move_axis = (int8_t)NO_AXIS;
|
2787
|
2782
|
|
2788
|
|
- // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to
|
2789
|
|
- // move_to_destination. This will cause idle() to be called, which can then call this function while the
|
2790
|
|
- // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while
|
2791
|
|
- // processing_manual_move is true or the planner will get out of sync.
|
|
2783
|
+ // Set a blocking flag so no new moves can be added until all segments are done
|
2792
|
2784
|
processing_manual_move = true;
|
2793
|
2785
|
prepare_move_to_destination(); // will call set_current_from_destination()
|
2794
|
2786
|
processing_manual_move = false;
|
|
@@ -2868,7 +2860,6 @@ void kill_screen(const char* lcd_msg) {
|
2868
|
2860
|
#if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
|
2869
|
2861
|
max = soft_endstop_max[Z_AXIS];
|
2870
|
2862
|
#endif
|
2871
|
|
- break;
|
2872
|
2863
|
default: break;
|
2873
|
2864
|
}
|
2874
|
2865
|
#endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS
|
|
@@ -3142,7 +3133,7 @@ void kill_screen(const char* lcd_msg) {
|
3142
|
3133
|
MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
|
3143
|
3134
|
|
3144
|
3135
|
#if HAS_LCD_CONTRAST
|
3145
|
|
- MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, (int*)&lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true);
|
|
3136
|
+ MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true);
|
3146
|
3137
|
#endif
|
3147
|
3138
|
#if ENABLED(FWRETRACT)
|
3148
|
3139
|
MENU_ITEM(submenu, MSG_RETRACT, lcd_control_retract_menu);
|
|
@@ -4339,6 +4330,7 @@ void kill_screen(const char* lcd_msg) {
|
4339
|
4330
|
} \
|
4340
|
4331
|
typedef void _name
|
4341
|
4332
|
|
|
4333
|
+ DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01);
|
4342
|
4334
|
DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1);
|
4343
|
4335
|
DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1);
|
4344
|
4336
|
DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1.0);
|
|
@@ -4348,7 +4340,6 @@ void kill_screen(const char* lcd_msg) {
|
4348
|
4340
|
DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10.0);
|
4349
|
4341
|
DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52sign, 100.0);
|
4350
|
4342
|
DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100.0);
|
4351
|
|
- DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01);
|
4352
|
4343
|
|
4353
|
4344
|
/**
|
4354
|
4345
|
*
|
|
@@ -4611,8 +4602,13 @@ void lcd_update() {
|
4611
|
4602
|
|
4612
|
4603
|
#if ENABLED(ULTIPANEL)
|
4613
|
4604
|
static millis_t return_to_status_ms = 0;
|
|
4605
|
+
|
|
4606
|
+ // Handle any queued Move Axis motion
|
4614
|
4607
|
manage_manual_move();
|
4615
|
4608
|
|
|
4609
|
+ // Update button states for LCD_CLICKED, etc.
|
|
4610
|
+ // After state changes the next button update
|
|
4611
|
+ // may be delayed 300-500ms.
|
4616
|
4612
|
lcd_buttons_update();
|
4617
|
4613
|
|
4618
|
4614
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
@@ -4947,7 +4943,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
4947
|
4943
|
#define encrot3 1
|
4948
|
4944
|
#endif
|
4949
|
4945
|
|
4950
|
|
- #define GET_BUTTON_STATES(DST) \
|
|
4946
|
+ #define GET_SHIFT_BUTTON_STATES(DST) \
|
4951
|
4947
|
uint8_t new_##DST = 0; \
|
4952
|
4948
|
WRITE(SHIFT_LD, LOW); \
|
4953
|
4949
|
WRITE(SHIFT_LD, HIGH); \
|
|
@@ -4966,7 +4962,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
4966
|
4962
|
*/
|
4967
|
4963
|
void lcd_buttons_update() {
|
4968
|
4964
|
static uint8_t lastEncoderBits;
|
4969
|
|
- millis_t now = millis();
|
|
4965
|
+ const millis_t now = millis();
|
4970
|
4966
|
if (ELAPSED(now, next_button_update_ms)) {
|
4971
|
4967
|
|
4972
|
4968
|
#if ENABLED(NEWPANEL)
|
|
@@ -5047,13 +5043,15 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
5047
|
5043
|
|
5048
|
5044
|
#elif ENABLED(REPRAPWORLD_KEYPAD)
|
5049
|
5045
|
|
5050
|
|
- GET_BUTTON_STATES(buttons_reprapworld_keypad);
|
|
5046
|
+ GET_SHIFT_BUTTON_STATES(buttons_reprapworld_keypad);
|
5051
|
5047
|
|
5052
|
5048
|
#endif
|
5053
|
5049
|
|
5054
|
|
- #else
|
5055
|
|
- GET_BUTTON_STATES(buttons);
|
5056
|
|
- #endif // !NEWPANEL
|
|
5050
|
+ #else // !NEWPANEL
|
|
5051
|
+
|
|
5052
|
+ GET_SHIFT_BUTTON_STATES(buttons);
|
|
5053
|
+
|
|
5054
|
+ #endif
|
5057
|
5055
|
|
5058
|
5056
|
} // next_button_update_ms
|
5059
|
5057
|
|