Browse Source

Changes for parity with 2.0.x

Scott Lahteine 7 years ago
parent
commit
1063b3b2b8

+ 22
- 24
Marlin/G26_Mesh_Validation_Tool.cpp View File

@@ -164,6 +164,7 @@
164 164
   static int8_t g26_prime_flag;
165 165
 
166 166
   #if ENABLED(NEWPANEL)
167
+
167 168
     /**
168 169
      * Detect is_lcd_clicked, debounce it, and return true for cancel
169 170
      */
@@ -185,28 +186,27 @@
185 186
       lcd_reset_status();
186 187
       return true;
187 188
     }
188
-  #endif
189 189
 
190
-  #if ENABLED(NEWPANEL)
191 190
     bool exit_from_g26() {
192 191
       lcd_setstatusPGM(PSTR("Leaving G26"), -1);
193 192
       wait_for_release();
194 193
       return G26_ERR;
195 194
     }
195
+
196 196
   #endif
197 197
 
198 198
   void G26_line_to_destination(const float &feed_rate) {
199 199
     const float save_feedrate = feedrate_mm_s;
200 200
     feedrate_mm_s = feed_rate;      // use specified feed rate
201
-    prepare_move_to_destination();  // will ultimately call ubl.line_to_destination_cartesian for UBL or ubl.prepare_linear_move_to for UBL_DELTA
201
+    prepare_move_to_destination();  // will ultimately call ubl.line_to_destination_cartesian or ubl.prepare_linear_move_to for UBL_DELTA
202 202
     feedrate_mm_s = save_feedrate;  // restore global feed rate
203 203
   }
204 204
 
205
-  void move_to(const float &x, const float &y, const float &z, const float &e_delta) {
205
+  void move_to(const float &rx, const float &ry, const float &z, const float &e_delta) {
206 206
     float feed_value;
207 207
     static float last_z = -999.99;
208 208
 
209
-    bool has_xy_component = (x != current_position[X_AXIS] || y != current_position[Y_AXIS]); // Check if X or Y is involved in the movement.
209
+    bool has_xy_component = (rx != current_position[X_AXIS] || ry != current_position[Y_AXIS]); // Check if X or Y is involved in the movement.
210 210
 
211 211
     if (z != last_z) {
212 212
       last_z = z;
@@ -229,8 +229,8 @@
229 229
 
230 230
     if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value);
231 231
 
232
-    destination[X_AXIS] = x;
233
-    destination[Y_AXIS] = y;
232
+    destination[X_AXIS] = rx;
233
+    destination[Y_AXIS] = ry;
234 234
     destination[E_AXIS] += e_delta;
235 235
 
236 236
     G26_line_to_destination(feed_value);
@@ -292,13 +292,11 @@
292 292
 
293 293
         wait_for_release();
294 294
 
295
-        #if ENABLED(ULTRA_LCD)
296
-          strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatusPGM() without having it continue;
297
-                                                              // So... We cheat to get a message up.
298
-          lcd_setstatusPGM(PSTR("Done Priming"), 99);
299
-          lcd_quick_feedback();
300
-          lcd_external_control = false;
301
-        #endif
295
+        strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatusPGM() without having it continue;
296
+                                                            // So... We cheat to get a message up.
297
+        lcd_setstatusPGM(PSTR("Done Priming"), 99);
298
+        lcd_quick_feedback();
299
+        lcd_external_control = false;
302 300
       }
303 301
       else
304 302
     #endif
@@ -490,17 +488,11 @@
490 488
     return false;
491 489
   }
492 490
 
493
-  float valid_trig_angle(float d) {
494
-    while (d > 360.0) d -= 360.0;
495
-    while (d < 0.0) d += 360.0;
496
-    return d;
497
-  }
498
-
499 491
   /**
500 492
    * Turn on the bed and nozzle heat and
501 493
    * wait for them to get up to temperature.
502 494
    */
503
-  bool turn_on_heaters() {
495
+  inline bool turn_on_heaters() {
504 496
     millis_t next = millis() + 5000UL;
505 497
     #if HAS_TEMP_BED
506 498
       #if ENABLED(ULTRA_LCD)
@@ -554,10 +546,16 @@
554 546
     return G26_OK;
555 547
   }
556 548
 
549
+  float valid_trig_angle(float d) {
550
+    while (d > 360.0) d -= 360.0;
551
+    while (d < 0.0) d += 360.0;
552
+    return d;
553
+  }
554
+
557 555
   /**
558 556
    * G26: Mesh Validation Pattern generation.
559 557
    *
560
-   * Used to interactively edit UBL's Mesh by placing the
558
+   * Used to interactively edit the mesh by placing the
561 559
    * nozzle in a problem area and doing a G29 P4 R command.
562 560
    */
563 561
   void gcode_G26() {
@@ -703,12 +701,12 @@
703 701
       set_current_from_destination();
704 702
     }
705 703
 
706
-    if (turn_on_heaters()) goto LEAVE;
704
+    if (turn_on_heaters() != G26_OK) goto LEAVE;
707 705
 
708 706
     current_position[E_AXIS] = 0.0;
709 707
     sync_plan_position_e();
710 708
 
711
-    if (g26_prime_flag && prime_nozzle()) goto LEAVE;
709
+    if (g26_prime_flag && prime_nozzle() != G26_OK) goto LEAVE;
712 710
 
713 711
     /**
714 712
      *  Bed is preheated

+ 4
- 0
Marlin/SanityCheck.h View File

@@ -298,11 +298,15 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
298 298
 #if ENABLED(LCD_PROGRESS_BAR)
299 299
   #if DISABLED(SDSUPPORT)
300 300
     #error "LCD_PROGRESS_BAR requires SDSUPPORT."
301
+  #elif DISABLED(ULTRA_LCD)
302
+    #error "LCD_PROGRESS_BAR requires a character LCD."
301 303
   #elif ENABLED(DOGLCD)
302 304
     #error "LCD_PROGRESS_BAR does not apply to graphical displays."
303 305
   #elif ENABLED(FILAMENT_LCD_DISPLAY)
304 306
     #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both."
305 307
   #endif
308
+#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && DISABLED(DOGLCD)
309
+  #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD."
306 310
 #endif
307 311
 
308 312
 /**

+ 2
- 2
Marlin/language_en.h View File

@@ -813,8 +813,8 @@
813 813
 #ifndef MSG_DELTA_HEIGHT_CALIBRATE
814 814
   #define MSG_DELTA_HEIGHT_CALIBRATE          _UxGT("Set Delta Height")
815 815
 #endif
816
-#ifndef MSG_DELTA_DIAG_ROG
817
-  #define MSG_DELTA_DIAG_ROG                  _UxGT("Diag Rod")
816
+#ifndef MSG_DELTA_DIAG_ROD
817
+  #define MSG_DELTA_DIAG_ROD                  _UxGT("Diag Rod")
818 818
 #endif
819 819
 #ifndef MSG_DELTA_HEIGHT
820 820
   #define MSG_DELTA_HEIGHT                    _UxGT("Height")

+ 9
- 4
Marlin/planner.cpp View File

@@ -124,15 +124,20 @@ float Planner::min_feedrate_mm_s,
124 124
           Planner::inverse_z_fade_height,
125 125
           Planner::last_fade_z;
126 126
   #endif
127
+#else
128
+  constexpr bool Planner::leveling_active;
127 129
 #endif
128 130
 
129 131
 #if ENABLED(SKEW_CORRECTION)
130 132
   #if ENABLED(SKEW_CORRECTION_GCODE)
131
-    // Initialized by settings.load()
132 133
     float Planner::xy_skew_factor;
133
-    #if ENABLED(SKEW_CORRECTION_FOR_Z)
134
-      float Planner::xz_skew_factor, Planner::yz_skew_factor;
135
-    #endif
134
+  #else
135
+    constexpr float Planner::xy_skew_factor;
136
+  #endif
137
+  #if ENABLED(SKEW_CORRECTION_FOR_Z) && ENABLED(SKEW_CORRECTION_GCODE)
138
+    float Planner::xz_skew_factor, Planner::yz_skew_factor;
139
+  #else
140
+    constexpr float Planner::xz_skew_factor, Planner::yz_skew_factor;
136 141
   #endif
137 142
 #endif
138 143
 

+ 1
- 1
Marlin/temperature.cpp View File

@@ -1273,7 +1273,7 @@ void Temperature::init() {
1273 1273
    * their target temperature by a configurable margin.
1274 1274
    * This is called when the temperature is set. (M104, M109)
1275 1275
    */
1276
-  void Temperature::start_watching_heater(uint8_t e) {
1276
+  void Temperature::start_watching_heater(const uint8_t e) {
1277 1277
     #if HOTENDS == 1
1278 1278
       UNUSED(e);
1279 1279
     #endif

+ 3
- 3
Marlin/temperature.h View File

@@ -370,14 +370,14 @@ class Temperature {
370 370
     static int16_t degTargetBed() { return target_temperature_bed; }
371 371
 
372 372
     #if WATCH_HOTENDS
373
-      static void start_watching_heater(uint8_t e = 0);
373
+      static void start_watching_heater(const uint8_t e = 0);
374 374
     #endif
375 375
 
376 376
     #if WATCH_THE_BED
377 377
       static void start_watching_bed();
378 378
     #endif
379 379
 
380
-    static void setTargetHotend(const int16_t celsius, uint8_t e) {
380
+    static void setTargetHotend(const int16_t celsius, const uint8_t e) {
381 381
       #if HOTENDS == 1
382 382
         UNUSED(e);
383 383
       #endif
@@ -455,7 +455,7 @@ class Temperature {
455 455
 
456 456
     #if ENABLED(BABYSTEPPING)
457 457
 
458
-      static void babystep_axis(const AxisEnum axis, const int distance) {
458
+      static void babystep_axis(const AxisEnum axis, const int16_t distance) {
459 459
         if (axis_known_position[axis]) {
460 460
           #if IS_CORE
461 461
             #if ENABLED(BABYSTEP_XY)

+ 1
- 1
Marlin/ubl.h View File

@@ -84,7 +84,7 @@
84 84
       #if ENABLED(NEWPANEL)
85 85
         static void move_z_with_encoder(const float &multiplier);
86 86
         static float measure_point_with_encoder();
87
-        static float measure_business_card_thickness(float);
87
+        static float measure_business_card_thickness(const float&);
88 88
         static void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool);
89 89
         static void fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map);
90 90
       #endif

+ 12
- 14
Marlin/ubl_G29.cpp View File

@@ -45,7 +45,7 @@
45 45
 
46 46
   #if ENABLED(NEWPANEL)
47 47
     void lcd_return_to_status();
48
-    void lcd_mesh_edit_setup(float initial);
48
+    void lcd_mesh_edit_setup(const float initial);
49 49
     float lcd_mesh_edit();
50 50
     void lcd_z_offset_edit_setup(float);
51 51
     extern void _lcd_ubl_output_map_lcd();
@@ -57,8 +57,9 @@
57 57
   extern float probe_pt(const float &rx, const float &ry, const bool, const uint8_t, const bool=true);
58 58
   extern bool set_probe_deployed(bool);
59 59
   extern void set_bed_leveling_enabled(bool);
60
+
60 61
   typedef void (*screenFunc_t)();
61
-  extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
62
+  extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0);
62 63
 
63 64
   #define SIZE_OF_LITTLE_RAISE 1
64 65
   #define BIG_RAISE_NOT_NEEDED 0
@@ -644,8 +645,8 @@
644 645
               SERIAL_ECHOPAIR(" J ", y);
645 646
               SERIAL_ECHOPGM(" Z ");
646 647
               SERIAL_ECHO_F(z_values[x][y], 6);
647
-              SERIAL_ECHOPAIR(" ; X ", mesh_index_to_xpos(x));
648
-              SERIAL_ECHOPAIR(", Y ", mesh_index_to_ypos(y));
648
+              SERIAL_ECHOPAIR(" ; X ", LOGICAL_X_POSITION(mesh_index_to_xpos(x)));
649
+              SERIAL_ECHOPAIR(", Y ", LOGICAL_Y_POSITION(mesh_index_to_ypos(y)));
649 650
               SERIAL_EOL();
650 651
             }
651 652
         return;
@@ -799,7 +800,6 @@
799 800
           z_values[location.x_index][location.y_index] = measured_z;
800 801
         }
801 802
 
802
-
803 803
       } while (location.x_index >= 0 && --max_iterations);
804 804
 
805 805
       STOW_PROBE();
@@ -914,6 +914,7 @@
914 914
         }
915 915
       }
916 916
     }
917
+
917 918
   #endif // HAS_BED_PROBE
918 919
 
919 920
   #if ENABLED(NEWPANEL)
@@ -938,7 +939,7 @@
938 939
 
939 940
     static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); }
940 941
 
941
-    float unified_bed_leveling::measure_business_card_thickness(float in_height) {
942
+    float unified_bed_leveling::measure_business_card_thickness(const float &in_height) {
942 943
       lcd_external_control = true;
943 944
       save_ubl_active_state_and_disable();   // Disable bed level correction for probing
944 945
 
@@ -971,8 +972,6 @@
971 972
         SERIAL_PROTOCOLLNPGM("mm thick.");
972 973
       }
973 974
 
974
-      in_height = current_position[Z_AXIS]; // do manual probing at lower height
975
-
976 975
       lcd_external_control = false;
977 976
 
978 977
       restore_ubl_active_state_and_leave();
@@ -1460,10 +1459,9 @@
1460 1459
 
1461 1460
           float distance = HYPOT(px - mx, py - my);
1462 1461
 
1463
-            // factor in the distance from the current location for the normal case
1464
-            // so the nozzle isn't running all over the bed.
1465
-            distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1;
1466
-
1462
+          // factor in the distance from the current location for the normal case
1463
+          // so the nozzle isn't running all over the bed.
1464
+          distance += HYPOT(current_position[X_AXIS] - mx, current_position[Y_AXIS] - my) * 0.1;
1467 1465
           if (distance < best_so_far) {
1468 1466
             best_so_far = distance;   // We found a closer location with
1469 1467
             out_mesh.x_index = i;     // the specified type of mesh value.
@@ -1518,8 +1516,8 @@
1518 1516
 
1519 1517
         if (location.x_index < 0) break; // stop when we can't find any more reachable points.
1520 1518
 
1521
-        bitmap_clear(not_done, location.x_index, location.y_index);  // Mark this location as 'adjusted' so we will find a
1522
-                                                                  // different location the next time through the loop
1519
+        bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so we will find a
1520
+                                                                    // different location the next time through the loop
1523 1521
 
1524 1522
         const float rawx = mesh_index_to_xpos(location.x_index),
1525 1523
                     rawy = mesh_index_to_ypos(location.y_index);

+ 27
- 29
Marlin/ultralcd.cpp View File

@@ -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
 

+ 5
- 3
Marlin/ultralcd.h View File

@@ -23,10 +23,12 @@
23 23
 #ifndef ULTRALCD_H
24 24
 #define ULTRALCD_H
25 25
 
26
-#include "Marlin.h"
26
+#include "MarlinConfig.h"
27 27
 
28 28
 #if ENABLED(ULTRA_LCD)
29 29
 
30
+  #include "Marlin.h"
31
+
30 32
   #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
31 33
     extern bool lcd_external_control;
32 34
     #if ENABLED(G26_MESH_VALIDATION)
@@ -57,7 +59,7 @@
57 59
   inline void lcd_refresh() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; }
58 60
 
59 61
   #if HAS_BUZZER
60
-    void lcd_buzz(long duration, uint16_t freq);
62
+    void lcd_buzz(const long duration, const uint16_t freq);
61 63
   #endif
62 64
 
63 65
   #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
@@ -205,7 +207,7 @@
205 207
 void lcd_reset_status();
206 208
 
207 209
 #if ENABLED(AUTO_BED_LEVELING_UBL)
208
-  void lcd_mesh_edit_setup(float initial);
210
+  void lcd_mesh_edit_setup(const float initial);
209 211
   float lcd_mesh_edit();
210 212
   void lcd_z_offset_edit_setup(float);
211 213
   float lcd_z_offset_edit();

Loading…
Cancel
Save