|
@@ -125,7 +125,7 @@ uint16_t max_display_update_time = 0;
|
125
|
125
|
|
126
|
126
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
127
|
127
|
extern bool ubl_has_control_of_lcd_panel;
|
128
|
|
- extern uint8_t ubl_encoderDiff;
|
|
128
|
+ extern int8_t ubl_encoderDiff;
|
129
|
129
|
#endif
|
130
|
130
|
|
131
|
131
|
#if HAS_POWER_SWITCH
|
|
@@ -859,21 +859,23 @@ void kill_screen(const char* lcd_msg) {
|
859
|
859
|
static int ubl_encoderPosition = 0;
|
860
|
860
|
|
861
|
861
|
static void _lcd_mesh_fine_tune(const char* msg) {
|
862
|
|
- static millis_t next_click = 0;
|
|
862
|
+
|
|
863
|
+
|
863
|
864
|
int16_t last_digit;
|
864
|
865
|
int32_t rounded;
|
865
|
866
|
|
866
|
867
|
defer_return_to_status = true;
|
867
|
868
|
if (ubl_encoderDiff) {
|
868
|
|
-
|
869
|
|
- ubl_encoderPosition = ELAPSED(millis(), next_click)
|
870
|
|
- ? ubl_encoderDiff > 0 ? 1 : -1
|
871
|
|
- : ubl_encoderDiff * 2;
|
|
869
|
+ if ( ubl_encoderDiff > 0 )
|
|
870
|
+ ubl_encoderPosition = 1;
|
|
871
|
+ else {
|
|
872
|
+ ubl_encoderPosition = -1;
|
|
873
|
+ }
|
872
|
874
|
|
873
|
875
|
ubl_encoderDiff = 0;
|
874
|
|
- next_click = millis() + 200L;
|
|
876
|
+
|
875
|
877
|
|
876
|
|
- mesh_edit_accumulator += float((int32_t)ubl_encoderPosition) * .005 / 2.0;
|
|
878
|
+ mesh_edit_accumulator += ( (float) (ubl_encoderPosition)) * .005 / 2.0 ;
|
877
|
879
|
mesh_edit_value = mesh_edit_accumulator;
|
878
|
880
|
encoderPosition = 0;
|
879
|
881
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
|
@@ -881,7 +883,6 @@ void kill_screen(const char* lcd_msg) {
|
881
|
883
|
rounded = (int32_t)(mesh_edit_value * 1000.0);
|
882
|
884
|
last_digit = rounded % 5L;
|
883
|
885
|
rounded -= last_digit;
|
884
|
|
- last_digit = rounded % 5L;
|
885
|
886
|
mesh_edit_value = float(rounded) / 1000.0;
|
886
|
887
|
}
|
887
|
888
|
|
|
@@ -890,19 +891,28 @@ void kill_screen(const char* lcd_msg) {
|
890
|
891
|
}
|
891
|
892
|
|
892
|
893
|
|
|
894
|
+ void _lcd_mesh_edit_NOP() {
|
|
895
|
+ defer_return_to_status = true;
|
|
896
|
+ }
|
|
897
|
+
|
|
898
|
+
|
893
|
899
|
void _lcd_mesh_edit() {
|
894
|
900
|
_lcd_mesh_fine_tune(PSTR("Mesh Editor: "));
|
895
|
901
|
defer_return_to_status = true;
|
896
|
902
|
}
|
897
|
903
|
|
898
|
904
|
float lcd_mesh_edit() {
|
899
|
|
- lcd_goto_screen(_lcd_mesh_edit);
|
|
905
|
+ lcd_goto_screen(_lcd_mesh_edit_NOP);
|
|
906
|
+ _lcd_mesh_fine_tune(PSTR("Mesh Editor: "));
|
|
907
|
+ defer_return_to_status = true;
|
900
|
908
|
return mesh_edit_value;
|
901
|
909
|
}
|
902
|
910
|
|
903
|
911
|
void lcd_mesh_edit_setup(float initial) {
|
904
|
912
|
mesh_edit_value = mesh_edit_accumulator = initial;
|
905
|
|
- lcd_goto_screen(_lcd_mesh_edit);
|
|
913
|
+ lcd_goto_screen(_lcd_mesh_edit_NOP);
|
|
914
|
+ mesh_edit_value = mesh_edit_accumulator = initial;
|
|
915
|
+ defer_return_to_status = true;
|
906
|
916
|
}
|
907
|
917
|
|
908
|
918
|
void _lcd_z_offset_edit() {
|