Pārlūkot izejas kodu

Followup to Menu Refactor (#12275)

Scott Lahteine 5 gadus atpakaļ
vecāks
revīzija
3583e2b449
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
45 mainītis faili ar 245 papildinājumiem un 274 dzēšanām
  1. 3
    3
      Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp
  2. 2
    2
      Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp
  3. 1
    1
      Marlin/src/HAL/HAL_LPC1768/spi_pins.h
  4. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
  5. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
  6. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction
  7. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp
  8. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp
  9. 2
    2
      Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
  10. 0
    1
      Marlin/src/HAL/HAL_STM32F7/HAL.cpp
  11. 1
    1
      Marlin/src/Marlin.cpp
  12. 1
    1
      Marlin/src/feature/bedlevel/ubl/ubl.cpp
  13. 1
    1
      Marlin/src/feature/bedlevel/ubl/ubl.h
  14. 1
    1
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  15. 19
    19
      Marlin/src/feature/pause.cpp
  16. 13
    13
      Marlin/src/gcode/bedlevel/G26.cpp
  17. 2
    2
      Marlin/src/gcode/calibrate/G33.cpp
  18. 1
    1
      Marlin/src/gcode/control/M17_M18_M84.cpp
  19. 3
    3
      Marlin/src/gcode/control/M80_M81.cpp
  20. 2
    2
      Marlin/src/gcode/feature/pause/M600.cpp
  21. 5
    5
      Marlin/src/gcode/feature/pause/M701_M702.cpp
  22. 1
    1
      Marlin/src/gcode/gcode.cpp
  23. 1
    1
      Marlin/src/gcode/gcode.h
  24. 3
    3
      Marlin/src/gcode/lcd/M0_M1.cpp
  25. 2
    2
      Marlin/src/gcode/lcd/M145.cpp
  26. 2
    2
      Marlin/src/gcode/parser.h
  27. 1
    1
      Marlin/src/gcode/queue.cpp
  28. 1
    1
      Marlin/src/gcode/queue.h
  29. 1
    1
      Marlin/src/inc/Conditionals_post.h
  30. 1
    1
      Marlin/src/inc/SanityCheck.h
  31. 4
    5
      Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp
  32. 19
    29
      Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h
  33. 17
    27
      Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp
  34. 2
    2
      Marlin/src/lcd/dogm/lcdprint_u8g.cpp
  35. 2
    2
      Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp
  36. 2
    2
      Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp
  37. 2
    2
      Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp
  38. 33
    34
      Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp
  39. 2
    2
      Marlin/src/lcd/dogm/u8g_fontutf8.cpp
  40. 2
    2
      Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp
  41. 10
    22
      Marlin/src/lcd/menu/menu.cpp
  42. 2
    2
      Marlin/src/lcd/menu/menu_configuration.cpp
  43. 40
    45
      Marlin/src/lcd/ultralcd.cpp
  44. 26
    15
      Marlin/src/lcd/ultralcd.h
  45. 2
    2
      Marlin/src/module/tool_change.cpp

+ 3
- 3
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp Parādīt failu

@@ -60,7 +60,7 @@
60 60
 
61 61
 #include "../../inc/MarlinConfigPre.h"
62 62
 
63
-#if ENABLED(DOGLCD)
63
+#if HAS_GRAPHICAL_LCD
64 64
 
65 65
 #include <U8glib.h>
66 66
 
@@ -156,6 +156,6 @@ uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va
156 156
   return 1;
157 157
 }
158 158
 
159
-#endif  // DOGLCD
159
+#endif // HAS_GRAPHICAL_LCD
160 160
 
161
-#endif  //__SAM3X8E__
161
+#endif //__SAM3X8E__

+ 2
- 2
Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_st7920_sw_spi.cpp Parādīt failu

@@ -57,7 +57,7 @@
57 57
 
58 58
 #include "../../inc/MarlinConfigPre.h"
59 59
 
60
-#if ENABLED(DOGLCD)
60
+#if HAS_GRAPHICAL_LCD
61 61
 
62 62
 #include <U8glib.h>
63 63
 #include <Arduino.h>
@@ -180,6 +180,6 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va
180 180
   return 1;
181 181
 }
182 182
 
183
-#endif // DOGLCD
183
+#endif // HAS_GRAPHICAL_LCD
184 184
 
185 185
 #endif // ARDUINO_ARCH_SAM

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/spi_pins.h Parādīt failu

@@ -25,7 +25,7 @@
25 25
 
26 26
 #include "src/core/macros.h"
27 27
 
28
-#if ENABLED(SDSUPPORT) && ENABLED(DOGLCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
28
+#if ENABLED(SDSUPPORT) && HAS_GRAPHICAL_LCD && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
29 29
   #define LPC_SOFTWARE_SPI  // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
30 30
                             // needed due to the speed and mode requred for communicating with each device being different.
31 31
                             // This requirement can be removed if the SPI access to these devices is updated to use

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp Parādīt failu

@@ -57,7 +57,7 @@
57 57
 
58 58
 #include "../../../inc/MarlinConfigPre.h"
59 59
 
60
-#if ENABLED(DOGLCD)
60
+#if HAS_GRAPHICAL_LCD
61 61
 
62 62
 //#include <inttypes.h>
63 63
 #include <U8glib.h>
@@ -132,6 +132,6 @@ uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
132 132
   return 1;
133 133
 }
134 134
 
135
-#endif // DOGLCD
135
+#endif // HAS_GRAPHICAL_LCD
136 136
 
137 137
 #endif // TARGET_LPC1768

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp Parādīt failu

@@ -79,7 +79,7 @@
79 79
 
80 80
 #include "../../../inc/MarlinConfigPre.h"
81 81
 
82
-#if ENABLED(DOGLCD)
82
+#if HAS_GRAPHICAL_LCD
83 83
 
84 84
 #include <U8glib.h>
85 85
 
@@ -198,6 +198,6 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
198 198
   return 1;
199 199
 }
200 200
 
201
-#endif // DOGLCD
201
+#endif // HAS_GRAPHICAL_LCD
202 202
 
203 203
 #endif // TARGET_LPC1768

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction Parādīt failu

@@ -63,7 +63,7 @@
63 63
 
64 64
 #include "../../inc/MarlinConfigPre.h"
65 65
 
66
-#if ENABLED(DOGLCD)
66
+#if HAS_GRAPHICAL_LCD
67 67
 
68 68
 #include <U8glib.h>
69 69
 
@@ -249,6 +249,6 @@ uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
249 249
   return 1;
250 250
 }
251 251
 
252
-#endif // DOGLCD
252
+#endif // HAS_GRAPHICAL_LCD
253 253
 
254 254
 #endif // TARGET_LPC1768

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp Parādīt failu

@@ -57,7 +57,7 @@
57 57
 
58 58
 #include "../../../inc/MarlinConfigPre.h"
59 59
 
60
-#if ENABLED(DOGLCD)
60
+#if HAS_GRAPHICAL_LCD
61 61
 
62 62
 //#include <inttypes.h>
63 63
 #include <U8glib.h>
@@ -148,6 +148,6 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar
148 148
   return 1;
149 149
 }
150 150
 
151
-#endif // DOGLCD
151
+#endif // HAS_GRAPHICAL_LCD
152 152
 
153 153
 #endif // TARGET_LPC1768

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp Parādīt failu

@@ -57,7 +57,7 @@
57 57
 
58 58
 #include "../../../inc/MarlinConfigPre.h"
59 59
 
60
-#if ENABLED(DOGLCD)
60
+#if HAS_GRAPHICAL_LCD
61 61
 
62 62
 #include <U8glib.h>
63 63
 #include "SoftwareSPI.h"
@@ -151,6 +151,6 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar
151 151
   return 1;
152 152
 }
153 153
 
154
-#endif // DOGLCD
154
+#endif // HAS_GRAPHICAL_LCD
155 155
 
156 156
 #endif // TARGET_LPC1768

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp Parādīt failu

@@ -57,7 +57,7 @@
57 57
 
58 58
 #include "../../../inc/MarlinConfigPre.h"
59 59
 
60
-#if ENABLED(DOGLCD)
60
+#if HAS_GRAPHICAL_LCD
61 61
 
62 62
 #include <U8glib.h>
63 63
 #include "SoftwareSPI.h"
@@ -125,6 +125,6 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
125 125
   return 1;
126 126
 }
127 127
 
128
-#endif // DOGLCD
128
+#endif // HAS_GRAPHICAL_LCD
129 129
 
130 130
 #endif // TARGET_LPC1768

+ 0
- 1
Marlin/src/HAL/HAL_STM32F7/HAL.cpp Parādīt failu

@@ -21,7 +21,6 @@
21 21
  *
22 22
  */
23 23
 
24
-
25 24
 #ifdef STM32F7
26 25
 
27 26
 // --------------------------------------------------------------------------

+ 1
- 1
Marlin/src/Marlin.cpp Parādīt failu

@@ -379,7 +379,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
379 379
       #if ENABLED(DISABLE_INACTIVE_E)
380 380
         disable_e_steppers();
381 381
       #endif
382
-      #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)  // Only needed with an LCD
382
+      #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
383 383
         if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
384 384
       #endif
385 385
     }

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl.cpp Parādīt failu

@@ -143,7 +143,7 @@
143 143
   constexpr float unified_bed_leveling::_mesh_index_to_xpos[16],
144 144
                   unified_bed_leveling::_mesh_index_to_ypos[16];
145 145
 
146
-  #if ENABLED(ULTIPANEL)
146
+  #if HAS_LCD_MENU
147 147
     bool unified_bed_leveling::lcd_map_control = false;
148 148
   #endif
149 149
 

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl.h Parādīt failu

@@ -157,7 +157,7 @@ class unified_bed_leveling {
157 157
                               MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST)
158 158
                             };
159 159
 
160
-    #if ENABLED(ULTIPANEL)
160
+    #if HAS_LCD_MENU
161 161
       static bool lcd_map_control;
162 162
     #endif
163 163
 

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Parādīt failu

@@ -628,7 +628,7 @@
628 628
 
629 629
     LEAVE:
630 630
 
631
-    #if ENABLED(ULTIPANEL)
631
+    #if HAS_LCD_MENU
632 632
       lcd_reset_alert_level();
633 633
       lcd_quick_feedback(true);
634 634
       lcd_reset_status();

+ 19
- 19
Marlin/src/feature/pause.cpp Parādīt failu

@@ -45,7 +45,7 @@
45 45
   #include "../feature/runout.h"
46 46
 #endif
47 47
 
48
-#if ENABLED(ULTIPANEL)
48
+#if HAS_LCD_MENU
49 49
   #include "../lcd/ultralcd.h"
50 50
 #endif
51 51
 
@@ -102,7 +102,7 @@ static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_
102 102
     }
103 103
   #endif
104 104
 
105
-  #if ENABLED(ULTIPANEL)
105
+  #if HAS_LCD_MENU
106 106
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode);
107 107
   #else
108 108
     UNUSED(mode);
@@ -139,7 +139,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
139 139
   #endif
140 140
 
141 141
   if (!ensure_safe_temperature(mode)) {
142
-    #if ENABLED(ULTIPANEL)
142
+    #if HAS_LCD_MENU
143 143
       if (show_lcd) // Show status screen
144 144
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
145 145
     #endif
@@ -148,7 +148,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
148 148
   }
149 149
 
150 150
   if (pause_for_user) {
151
-    #if ENABLED(ULTIPANEL)
151
+    #if HAS_LCD_MENU
152 152
       if (show_lcd) // Show "insert filament"
153 153
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode);
154 154
     #endif
@@ -172,7 +172,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
172 172
     KEEPALIVE_STATE(IN_HANDLER);
173 173
   }
174 174
 
175
-  #if ENABLED(ULTIPANEL)
175
+  #if HAS_LCD_MENU
176 176
     if (show_lcd) // Show "wait for load" message
177 177
       lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode);
178 178
   #endif
@@ -209,7 +209,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
209 209
 
210 210
   #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
211 211
 
212
-    #if ENABLED(ULTIPANEL)
212
+    #if HAS_LCD_MENU
213 213
       if (show_lcd)
214 214
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE);
215 215
     #endif
@@ -224,7 +224,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
224 224
     do {
225 225
       if (purge_length > 0) {
226 226
         // "Wait for filament purge"
227
-        #if ENABLED(ULTIPANEL)
227
+        #if HAS_LCD_MENU
228 228
           if (show_lcd)
229 229
             lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode);
230 230
         #endif
@@ -234,7 +234,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
234 234
       }
235 235
 
236 236
       // Show "Purge More" / "Resume" menu and wait for reply
237
-      #if ENABLED(ULTIPANEL)
237
+      #if HAS_LCD_MENU
238 238
         if (show_lcd) {
239 239
           KEEPALIVE_STATE(PAUSED_FOR_USER);
240 240
           wait_for_user = false;
@@ -246,7 +246,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
246 246
 
247 247
       // Keep looping if "Purge More" was selected
248 248
     } while (
249
-      #if ENABLED(ULTIPANEL)
249
+      #if HAS_LCD_MENU
250 250
         show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE
251 251
       #else
252 252
         0
@@ -272,7 +272,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
272 272
                      const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
273 273
 ) {
274 274
   if (!ensure_safe_temperature(mode)) {
275
-    #if ENABLED(ULTIPANEL)
275
+    #if HAS_LCD_MENU
276 276
       if (show_lcd) // Show status screen
277 277
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
278 278
     #endif
@@ -342,7 +342,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
342 342
     SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
343 343
   #endif
344 344
 
345
-  #if ENABLED(ULTIPANEL)
345
+  #if HAS_LCD_MENU
346 346
     if (show_lcd) // Show initial message
347 347
       lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
348 348
   #endif
@@ -351,7 +351,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
351 351
     SERIAL_ERROR_START();
352 352
     SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD);
353 353
 
354
-    #if ENABLED(ULTIPANEL)
354
+    #if HAS_LCD_MENU
355 355
       if (show_lcd) { // Show status screen
356 356
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
357 357
         LCD_MESSAGEPGM(MSG_M600_TOO_COLD);
@@ -416,7 +416,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
416 416
 void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
417 417
   bool nozzle_timed_out = false;
418 418
 
419
-  #if ENABLED(ULTIPANEL)
419
+  #if HAS_LCD_MENU
420 420
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
421 421
   #endif
422 422
   SERIAL_ECHO_START();
@@ -454,11 +454,11 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
454 454
         nozzle_timed_out |= thermalManager.is_heater_idle(e);
455 455
 
456 456
     if (nozzle_timed_out) {
457
-      #if ENABLED(ULTIPANEL)
457
+      #if HAS_LCD_MENU
458 458
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
459 459
       #endif
460 460
       SERIAL_ECHO_START();
461
-      #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER)
461
+      #if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
462 462
         SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT);
463 463
       #elif ENABLED(EMERGENCY_PARSER)
464 464
         SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108);
@@ -475,11 +475,11 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
475 475
       // Wait for the heaters to reach the target temperatures
476 476
       ensure_safe_temperature();
477 477
 
478
-      #if ENABLED(ULTIPANEL)
478
+      #if HAS_LCD_MENU
479 479
         lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
480 480
       #endif
481 481
       SERIAL_ECHO_START();
482
-      #if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER)
482
+      #if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
483 483
         SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
484 484
       #elif ENABLED(EMERGENCY_PARSER)
485 485
         SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108);
@@ -550,7 +550,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
550 550
   if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament
551 551
     load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PASS);
552 552
 
553
-  #if ENABLED(ULTIPANEL)
553
+  #if HAS_LCD_MENU
554 554
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); // "Wait for print to resume"
555 555
   #endif
556 556
 
@@ -578,7 +578,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
578 578
     runout.reset();
579 579
   #endif
580 580
 
581
-  #if ENABLED(ULTIPANEL)
581
+  #if HAS_LCD_MENU
582 582
     // Show status screen
583 583
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
584 584
   #endif

+ 13
- 13
Marlin/src/gcode/bedlevel/G26.cpp Parādīt failu

@@ -156,7 +156,7 @@ int16_t g26_bed_temp,
156 156
 
157 157
 int8_t g26_prime_flag;
158 158
 
159
-#if ENABLED(ULTIPANEL)
159
+#if HAS_LCD_MENU
160 160
 
161 161
   /**
162 162
    * If the LCD is clicked, cancel, wait for release, return true
@@ -164,7 +164,7 @@ int8_t g26_prime_flag;
164 164
   bool user_canceled() {
165 165
     if (!is_lcd_clicked()) return false; // Return if the button isn't pressed
166 166
     lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
167
-    #if ENABLED(ULTIPANEL)
167
+    #if HAS_LCD_MENU
168 168
       lcd_quick_feedback(true);
169 169
     #endif
170 170
     wait_for_release();
@@ -327,7 +327,7 @@ inline bool look_for_lines_to_connect() {
327 327
   for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
328 328
     for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
329 329
 
330
-      #if ENABLED(ULTIPANEL)
330
+      #if HAS_LCD_MENU
331 331
         if (user_canceled()) return true;     // Check if the user wants to stop the Mesh Validation
332 332
       #endif
333 333
 
@@ -418,14 +418,14 @@ inline bool turn_on_heaters() {
418 418
       if (g26_bed_temp > 25) {
419 419
         lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
420 420
         lcd_quick_feedback(true);
421
-        #if ENABLED(ULTIPANEL)
421
+        #if HAS_LCD_MENU
422 422
           lcd_external_control = true;
423 423
         #endif
424 424
     #endif
425 425
         thermalManager.setTargetBed(g26_bed_temp);
426 426
         while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) {
427 427
 
428
-          #if ENABLED(ULTIPANEL)
428
+          #if HAS_LCD_MENU
429 429
             if (is_lcd_clicked()) return exit_from_g26();
430 430
           #endif
431 431
 
@@ -448,7 +448,7 @@ inline bool turn_on_heaters() {
448 448
   thermalManager.setTargetHotend(g26_hotend_temp, 0);
449 449
   while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) {
450 450
 
451
-    #if ENABLED(ULTIPANEL)
451
+    #if HAS_LCD_MENU
452 452
       if (is_lcd_clicked()) return exit_from_g26();
453 453
     #endif
454 454
 
@@ -474,7 +474,7 @@ inline bool turn_on_heaters() {
474 474
  */
475 475
 inline bool prime_nozzle() {
476 476
 
477
-  #if ENABLED(ULTIPANEL)
477
+  #if HAS_LCD_MENU
478 478
     #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
479 479
       float Total_Prime = 0.0;
480 480
     #endif
@@ -619,7 +619,7 @@ void GcodeSuite::G26() {
619 619
 
620 620
   if (parser.seen('P')) {
621 621
     if (!parser.has_value()) {
622
-      #if ENABLED(ULTIPANEL)
622
+      #if HAS_LCD_MENU
623 623
         g26_prime_flag = -1;
624 624
       #else
625 625
         SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD.");
@@ -664,7 +664,7 @@ void GcodeSuite::G26() {
664 664
   }
665 665
 
666 666
   int16_t g26_repeats;
667
-  #if ENABLED(ULTIPANEL)
667
+  #if HAS_LCD_MENU
668 668
     g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1);
669 669
   #else
670 670
     if (!parser.seen('R')) {
@@ -723,7 +723,7 @@ void GcodeSuite::G26() {
723 723
   move_to(destination, 0.0);
724 724
   move_to(destination, g26_ooze_amount);
725 725
 
726
-  #if ENABLED(ULTIPANEL)
726
+  #if HAS_LCD_MENU
727 727
     lcd_external_control = true;
728 728
   #endif
729 729
 
@@ -831,7 +831,7 @@ void GcodeSuite::G26() {
831 831
         plan_arc(endpoint, arc_offset, false);  // Draw a counter-clockwise arc
832 832
         feedrate_mm_s = save_feedrate;
833 833
         set_destination_from_current();
834
-        #if ENABLED(ULTIPANEL)
834
+        #if HAS_LCD_MENU
835 835
           if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation
836 836
         #endif
837 837
 
@@ -857,7 +857,7 @@ void GcodeSuite::G26() {
857 857
 
858 858
         for (int8_t ind = start_ind; ind <= end_ind; ind++) {
859 859
 
860
-          #if ENABLED(ULTIPANEL)
860
+          #if HAS_LCD_MENU
861 861
             if (user_canceled()) goto LEAVE;          // Check if the user wants to stop the Mesh Validation
862 862
           #endif
863 863
 
@@ -906,7 +906,7 @@ void GcodeSuite::G26() {
906 906
   move_to(destination, 0); // Move back to the starting position
907 907
   //debug_current_and_destination(PSTR("done doing X/Y move."));
908 908
 
909
-  #if ENABLED(ULTIPANEL)
909
+  #if HAS_LCD_MENU
910 910
     lcd_external_control = false;     // Give back control of the LCD Panel!
911 911
   #endif
912 912
 

+ 2
- 2
Marlin/src/gcode/calibrate/G33.cpp Parādīt failu

@@ -204,7 +204,7 @@ static float calibration_probe(const float &nx, const float &ny, const bool stow
204 204
   #endif
205 205
 }
206 206
 
207
-#if HAS_BED_PROBE && ENABLED(ULTIPANEL)
207
+#if HAS_BED_PROBE && HAS_LCD_MENU
208 208
   static float probe_z_shift(const float center) {
209 209
     STOW_PROBE();
210 210
     endstops.enable_z_probe(false);
@@ -588,7 +588,7 @@ void GcodeSuite::G33() {
588 588
 
589 589
       switch (probe_points) {
590 590
         case -1:
591
-          #if HAS_BED_PROBE && ENABLED(ULTIPANEL)
591
+          #if HAS_BED_PROBE && HAS_LCD_MENU
592 592
             zprobe_zoffset += probe_z_shift(z_at_pt[CEN]);
593 593
           #endif
594 594
 

+ 1
- 1
Marlin/src/gcode/control/M17_M18_M84.cpp Parādīt failu

@@ -60,7 +60,7 @@ void GcodeSuite::M18_M84() {
60 60
       #endif
61 61
     }
62 62
 
63
-    #if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL)  // Only needed with an LCD
63
+    #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
64 64
       if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
65 65
     #endif
66 66
   }

+ 3
- 3
Marlin/src/gcode/control/M80_M81.cpp Parādīt failu

@@ -27,7 +27,7 @@
27 27
 
28 28
 #include "../../inc/MarlinConfig.h"
29 29
 
30
-#if ENABLED(ULTIPANEL)
30
+#if HAS_LCD_MENU
31 31
   #include "../../lcd/ultralcd.h"
32 32
 #endif
33 33
 
@@ -82,7 +82,7 @@
82 82
       restore_stepper_drivers();
83 83
     #endif
84 84
 
85
-    #if ENABLED(ULTIPANEL)
85
+    #if HAS_LCD_MENU
86 86
       lcd_reset_status();
87 87
     #endif
88 88
   }
@@ -115,7 +115,7 @@ void GcodeSuite::M81() {
115 115
     PSU_OFF();
116 116
   #endif
117 117
 
118
-  #if ENABLED(ULTIPANEL)
118
+  #if HAS_LCD_MENU
119 119
     LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF ".");
120 120
   #endif
121 121
 }

+ 2
- 2
Marlin/src/gcode/feature/pause/M600.cpp Parādīt failu

@@ -33,7 +33,7 @@
33 33
   #include "../../../module/tool_change.h"
34 34
 #endif
35 35
 
36
-#if ENABLED(ULTIPANEL)
36
+#if HAS_LCD_MENU
37 37
   #include "../../../lcd/ultralcd.h"
38 38
 #endif
39 39
 
@@ -70,7 +70,7 @@ void GcodeSuite::M600() {
70 70
   #endif
71 71
 
72 72
   // Show initial "wait for start" message
73
-  #if ENABLED(ULTIPANEL)
73
+  #if HAS_LCD_MENU
74 74
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder);
75 75
   #endif
76 76
 

+ 5
- 5
Marlin/src/gcode/feature/pause/M701_M702.cpp Parādīt failu

@@ -34,7 +34,7 @@
34 34
   #include "../../../module/tool_change.h"
35 35
 #endif
36 36
 
37
-#if ENABLED(ULTIPANEL)
37
+#if HAS_LCD_MENU
38 38
   #include "../../../lcd/ultralcd.h"
39 39
 #endif
40 40
 
@@ -61,7 +61,7 @@ void GcodeSuite::M701() {
61 61
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
62 62
 
63 63
   // Show initial "wait for load" message
64
-  #if ENABLED(ULTIPANEL)
64
+  #if HAS_LCD_MENU
65 65
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder);
66 66
   #endif
67 67
 
@@ -98,7 +98,7 @@ void GcodeSuite::M701() {
98 98
   #endif
99 99
 
100 100
   // Show status screen
101
-  #if ENABLED(ULTIPANEL)
101
+  #if HAS_LCD_MENU
102 102
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
103 103
   #endif
104 104
 }
@@ -127,7 +127,7 @@ void GcodeSuite::M702() {
127 127
   if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
128 128
 
129 129
   // Show initial "wait for unload" message
130
-  #if ENABLED(ULTIPANEL)
130
+  #if HAS_LCD_MENU
131 131
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder);
132 132
   #endif
133 133
 
@@ -171,7 +171,7 @@ void GcodeSuite::M702() {
171 171
   #endif
172 172
 
173 173
   // Show status screen
174
-  #if ENABLED(ULTIPANEL)
174
+  #if HAS_LCD_MENU
175 175
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
176 176
   #endif
177 177
 }

+ 1
- 1
Marlin/src/gcode/gcode.cpp Parādīt failu

@@ -427,7 +427,7 @@ void GcodeSuite::process_parsed_command(
427 427
       case 120: M120(); break;                                    // M120: Enable endstops
428 428
       case 121: M121(); break;                                    // M121: Disable endstops
429 429
 
430
-      #if ENABLED(ULTIPANEL)
430
+      #if HAS_LCD_MENU
431 431
         case 145: M145(); break;                                  // M145: Set material heatup parameters
432 432
       #endif
433 433
 

+ 1
- 1
Marlin/src/gcode/gcode.h Parādīt failu

@@ -571,7 +571,7 @@ private:
571 571
     static void M190();
572 572
   #endif
573 573
 
574
-  #if ENABLED(ULTIPANEL)
574
+  #if HAS_LCD_MENU
575 575
     static void M145();
576 576
   #endif
577 577
 

+ 3
- 3
Marlin/src/gcode/lcd/M0_M1.cpp Parādīt failu

@@ -27,7 +27,7 @@
27 27
 #include "../gcode.h"
28 28
 #include "../../module/stepper.h"
29 29
 
30
-#if ENABLED(ULTIPANEL)
30
+#if HAS_LCD_MENU
31 31
   #include "../../lcd/ultralcd.h"
32 32
 #endif
33 33
 
@@ -59,7 +59,7 @@ void GcodeSuite::M0_M1() {
59 59
 
60 60
   planner.synchronize();
61 61
 
62
-  #if ENABLED(ULTIPANEL)
62
+  #if HAS_LCD_MENU
63 63
 
64 64
     if (has_message)
65 65
       lcd_setstatus(args, true);
@@ -93,7 +93,7 @@ void GcodeSuite::M0_M1() {
93 93
     printerEventLEDs.onResumeAfterWait();
94 94
   #endif
95 95
 
96
-  #if ENABLED(ULTIPANEL)
96
+  #if HAS_LCD_MENU
97 97
     lcd_reset_status();
98 98
   #endif
99 99
 

+ 2
- 2
Marlin/src/gcode/lcd/M145.cpp Parādīt failu

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if ENABLED(ULTIPANEL)
25
+#if HAS_LCD_MENU
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../lcd/ultralcd.h"
@@ -60,4 +60,4 @@ void GcodeSuite::M145() {
60 60
   }
61 61
 }
62 62
 
63
-#endif // ULTIPANEL
63
+#endif // HAS_LCD_MENU

+ 2
- 2
Marlin/src/gcode/parser.h Parādīt failu

@@ -273,7 +273,7 @@ public:
273 273
 
274 274
     static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; }
275 275
 
276
-    #if ENABLED(ULTIPANEL) && DISABLED(DISABLE_M503)
276
+    #if HAS_LCD_MENU && DISABLED(DISABLE_M503)
277 277
 
278 278
       FORCE_INLINE static char temp_units_code() {
279 279
         return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C';
@@ -293,7 +293,7 @@ public:
293 293
         }
294 294
       }
295 295
 
296
-    #endif // ULTIPANEL && !DISABLE_M503
296
+    #endif // HAS_LCD_MENU && !DISABLE_M503
297 297
 
298 298
     static inline float value_celsius() {
299 299
       const float f = value_float();

+ 1
- 1
Marlin/src/gcode/queue.cpp Parādīt failu

@@ -387,7 +387,7 @@ inline void get_serial_commands() {
387 387
           // Process critical commands early
388 388
           if (strcmp(command, "M108") == 0) {
389 389
             wait_for_heatup = false;
390
-            #if ENABLED(ULTIPANEL)
390
+            #if HAS_LCD_MENU
391 391
               wait_for_user = false;
392 392
             #endif
393 393
           }

+ 1
- 1
Marlin/src/gcode/queue.h Parādīt failu

@@ -97,7 +97,7 @@ void enqueue_and_echo_commands_P(PGM_P const pgcode);
97 97
  */
98 98
 bool enqueue_and_echo_command(const char* cmd);
99 99
 
100
-#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
100
+#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (HAS_LCD_MENU && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
101 101
 #define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
102 102
 
103 103
 #if HAS_QUEUE_NOW

+ 1
- 1
Marlin/src/inc/Conditionals_post.h Parādīt failu

@@ -239,7 +239,7 @@
239 239
 /**
240 240
  * Override here because this is set in Configuration_adv.h
241 241
  */
242
-#if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
242
+#if HAS_LCD_MENU && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
243 243
   #undef SD_DETECT_INVERTED
244 244
 #endif
245 245
 

+ 1
- 1
Marlin/src/inc/SanityCheck.h Parādīt failu

@@ -866,7 +866,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
866 866
     #error "You probably want to use Max Endstops for DELTA!"
867 867
   #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
868 868
     #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
869
-  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL))
869
+  #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
870 870
     #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
871 871
   #elif ABL_GRID
872 872
     #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0

+ 4
- 5
Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp Parādīt failu

@@ -14,16 +14,15 @@
14 14
 
15 15
 #include "../../inc/MarlinConfigPre.h"
16 16
 
17
-#if ENABLED(ULTRA_LCD) && DISABLED(DOGLCD)
17
+#if HAS_CHARACTER_LCD
18 18
 
19 19
 #include "../ultralcd.h"
20 20
 #include "../../Marlin.h"
21 21
 
22
+#include "ultralcd_common_HD44780.h"
23
+
22 24
 #include <string.h>
23
-#include "../fontutils.h"
24
-#include "../lcdprint.h"
25 25
 
26
-#include "ultralcd_common_HD44780.h"
27 26
 #ifndef LCD_CLASS
28 27
   #include <LiquidCrystal.h>
29 28
   #define LCD_CLASS LiquidCrystal
@@ -1039,4 +1038,4 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
1039 1038
   return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length);
1040 1039
 }
1041 1040
 
1042
-#endif // ULTRA_LCD && !DOGLCD
1041
+#endif // HAS_CHARACTER_LCD

+ 19
- 29
Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h Parādīt failu

@@ -32,24 +32,6 @@
32 32
   #include "../../libs/duration_t.h"
33 33
 #endif
34 34
 
35
-#if ENABLED(AUTO_BED_LEVELING_UBL)
36
-  #include "../../feature/bedlevel/ubl/ubl.h"
37
-
38
-  #if ENABLED(ULTIPANEL)
39
-    #define ULTRA_X_PIXELS_PER_CHAR    5
40
-    #define ULTRA_Y_PIXELS_PER_CHAR    8
41
-    #define ULTRA_COLUMNS_FOR_MESH_MAP 7
42
-    #define ULTRA_ROWS_FOR_MESH_MAP    4
43
-
44
-    #define N_USER_CHARS    8
45
-
46
-    #define TOP_LEFT      _BV(0)
47
-    #define TOP_RIGHT     _BV(1)
48
-    #define LOWER_LEFT    _BV(2)
49
-    #define LOWER_RIGHT   _BV(3)
50
-  #endif
51
-#endif
52
-
53 35
 ////////////////////////////////////
54 36
 // Setup button and encode mappings for each panel (into 'buttons' variable
55 37
 //
@@ -57,7 +39,7 @@
57 39
 // macro name. The mapping is independent of whether the button is directly connected or
58 40
 // via a shift/i2c register.
59 41
 
60
-#if ENABLED(ULTIPANEL)
42
+#if HAS_LCD_MENU
61 43
 
62 44
   extern volatile uint8_t buttons;
63 45
 
@@ -119,7 +101,21 @@
119 101
     #define LCD_CLICKED (buttons & (B_MI|B_ST))
120 102
   #endif
121 103
 
122
-#endif // ULTIPANEL
104
+  #if ENABLED(AUTO_BED_LEVELING_UBL)
105
+    #define ULTRA_X_PIXELS_PER_CHAR    5
106
+    #define ULTRA_Y_PIXELS_PER_CHAR    8
107
+    #define ULTRA_COLUMNS_FOR_MESH_MAP 7
108
+    #define ULTRA_ROWS_FOR_MESH_MAP    4
109
+
110
+    #define N_USER_CHARS    8
111
+
112
+    #define TOP_LEFT      _BV(0)
113
+    #define TOP_RIGHT     _BV(1)
114
+    #define LOWER_LEFT    _BV(2)
115
+    #define LOWER_RIGHT   _BV(3)
116
+  #endif
117
+
118
+#endif // HAS_LCD_MENU
123 119
 
124 120
 ////////////////////////////////////
125 121
 // Create LCD class instance and chipset-specific information
@@ -141,12 +137,11 @@
141 137
 
142 138
 #elif ENABLED(LCD_I2C_TYPE_MCP23017)
143 139
   // For the LED indicators (which may be mapped to different events in lcd_implementation_update_indicators())
140
+  #define LCD_HAS_STATUS_INDICATORS
144 141
   #define LED_A 0x04 //100
145 142
   #define LED_B 0x02 //010
146 143
   #define LED_C 0x01 //001
147 144
 
148
-  #define LCD_HAS_STATUS_INDICATORS
149
-
150 145
   #include <Wire.h>
151 146
   #include <LiquidTWI2.h>
152 147
   #define LCD_CLASS LiquidTWI2
@@ -160,9 +155,9 @@
160 155
   #include <LiquidCrystal_I2C.h>
161 156
   #define LCD_CLASS LiquidCrystal_I2C
162 157
 
163
-// 2 wire Non-latching LCD SR from:
164
-// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
165 158
 #elif ENABLED(SR_LCD_2W_NL)
159
+  // 2 wire Non-latching LCD SR from:
160
+  // https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
166 161
   extern "C" void __cxa_pure_virtual() { while (1); }
167 162
   #include <LCD.h>
168 163
   #include <LiquidCrystal_SR.h>
@@ -178,12 +173,7 @@
178 173
   // Standard directly connected LCD implementations
179 174
   #include <LiquidCrystal.h>
180 175
   #define LCD_CLASS LiquidCrystal
181
-
182 176
 #endif
183 177
 
184 178
 #include "../fontutils.h"
185 179
 #include "../lcdprint.h"
186
-
187
-#if ENABLED(LCD_PROGRESS_BAR)
188
-  #define LCD_STR_PROGRESS  "\x03\x04\x05"
189
-#endif

+ 17
- 27
Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp Parādīt failu

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfigPre.h"
24 24
 
25
-#if ENABLED(ULTRA_LCD) && DISABLED(DOGLCD)
25
+#if HAS_CHARACTER_LCD
26 26
 
27 27
 /**
28 28
  * ultralcd_impl_HD44780.cpp
@@ -40,6 +40,10 @@
40 40
 #include "../../module/planner.h"
41 41
 #include "../../module/motion.h"
42 42
 
43
+#if ENABLED(AUTO_BED_LEVELING_UBL)
44
+  #include "../../feature/bedlevel/ubl/ubl.h"
45
+#endif
46
+
43 47
 ////////////////////////////////////
44 48
 // Create LCD class instance and chipset-specific information
45 49
 #if ENABLED(LCD_I2C_TYPE_PCF8575)
@@ -79,16 +83,6 @@
79 83
   LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
80 84
 #endif
81 85
 
82
-#include "../fontutils.h"
83
-#include "../lcdprint.h"
84
-
85
-#if ENABLED(LCD_PROGRESS_BAR)
86
-  static millis_t progress_bar_ms = 0;     // Start millis of the current progress bar cycle
87
-  #if PROGRESS_MSG_EXPIRE > 0
88
-    static millis_t expire_status_ms = 0;  // millis at which to expire the status message
89
-  #endif
90
-#endif
91
-
92 86
 #if ENABLED(LCD_HAS_STATUS_INDICATORS)
93 87
   static void lcd_implementation_update_indicators();
94 88
 #endif
@@ -100,9 +94,13 @@ static void createChar_P(const char c, const byte * const ptr) {
100 94
   lcd.createChar(c, temp);
101 95
 }
102 96
 
97
+#if ENABLED(LCD_PROGRESS_BAR)
98
+  #define LCD_STR_PROGRESS  "\x03\x04\x05"
99
+#endif
100
+
103 101
 void lcd_set_custom_characters(
104 102
   #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
105
-    const uint8_t screen_charset=CHARSET_INFO
103
+    const HD44780CharSet screen_charset/*=CHARSET_INFO*/
106 104
   #endif
107 105
 ) {
108 106
   // CHARSET_BOOT
@@ -318,11 +316,7 @@ void lcd_set_custom_characters(
318 316
 
319 317
 }
320 318
 
321
-void lcd_implementation_init(
322
-  #if ENABLED(LCD_PROGRESS_BAR)
323
-    const uint8_t screen_charset=CHARSET_INFO
324
-  #endif
325
-) {
319
+void lcd_implementation_init() {
326 320
 
327 321
   #if ENABLED(LCD_I2C_TYPE_PCF8575)
328 322
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
@@ -348,11 +342,7 @@ void lcd_implementation_init(
348 342
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
349 343
   #endif
350 344
 
351
-  lcd_set_custom_characters(
352
-    #if ENABLED(LCD_PROGRESS_BAR)
353
-      screen_charset
354
-    #endif
355
-  );
345
+  LCD_SET_CHARSET(currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
356 346
 
357 347
   lcd.clear();
358 348
 }
@@ -416,7 +406,7 @@ void lcd_implementation_clear() { lcd.clear(); }
416 406
   }
417 407
 
418 408
   void lcd_bootscreen() {
419
-    lcd_set_custom_characters(CHARSET_BOOT);
409
+    LCD_SET_CHARSET(CHARSET_BOOT);
420 410
     lcd.clear();
421 411
 
422 412
     #define LCD_EXTRA_SPACE (LCD_WIDTH-8)
@@ -485,7 +475,7 @@ void lcd_implementation_clear() { lcd.clear(); }
485 475
 
486 476
     lcd.clear();
487 477
     safe_delay(100);
488
-    lcd_set_custom_characters();
478
+    LCD_SET_CHARSET(CHARSET_INFO);
489 479
     lcd.clear();
490 480
   }
491 481
 
@@ -975,7 +965,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) {
975 965
 
976 966
 #endif
977 967
 
978
-#if ENABLED(ULTIPANEL)
968
+#if HAS_LCD_MENU
979 969
 
980 970
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
981 971
 
@@ -1581,6 +1571,6 @@ FORCE_INLINE void _draw_status_message(const bool blink) {
1581 1571
 
1582 1572
   #endif // AUTO_BED_LEVELING_UBL
1583 1573
 
1584
-#endif // ULTIPANEL
1574
+#endif // HAS_LCD_MENU
1585 1575
 
1586
-#endif // ULTRA_LCD && !DOGLCD
1576
+#endif // HAS_CHARACTER_LCD

+ 2
- 2
Marlin/src/lcd/dogm/lcdprint_u8g.cpp Parādīt failu

@@ -9,7 +9,7 @@
9 9
 
10 10
 #include "../../inc/MarlinConfigPre.h"
11 11
 
12
-#if ENABLED(DOGLCD)
12
+#if HAS_GRAPHICAL_LCD
13 13
 
14 14
 #include <U8glib.h>
15 15
 extern U8GLIB *pu8g;
@@ -62,4 +62,4 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
62 62
   return ret;
63 63
 }
64 64
 
65
-#endif // DOGLCD
65
+#endif // HAS_GRAPHICAL_LCD

+ 2
- 2
Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp Parādīt failu

@@ -67,7 +67,7 @@
67 67
 
68 68
 #include "../../inc/MarlinConfigPre.h"
69 69
 
70
-#if ENABLED(DOGLCD)
70
+#if HAS_GRAPHICAL_LCD
71 71
 
72 72
 #include <U8glib.h>
73 73
 #include "HAL_LCD_com_defines.h"
@@ -281,4 +281,4 @@ uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_s
281 281
   return 1;
282 282
 }
283 283
 
284
-#endif // DOGLCD
284
+#endif // HAS_GRAPHICAL_LCD

+ 2
- 2
Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp Parādīt failu

@@ -55,7 +55,7 @@
55 55
 
56 56
 #include "../../inc/MarlinConfig.h"
57 57
 
58
-#if ENABLED(DOGLCD)
58
+#if HAS_GRAPHICAL_LCD
59 59
 
60 60
 #include <U8glib.h>
61 61
 
@@ -233,4 +233,4 @@ u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi = { u8g_dev_st7565_64128n_HAL_2x_f
233 233
 U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN);
234 234
 u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
235 235
 
236
-#endif // DOGLCD
236
+#endif // HAS_GRAPHICAL_LCD

+ 2
- 2
Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp Parādīt failu

@@ -55,7 +55,7 @@
55 55
 
56 56
 #include "../../inc/MarlinConfigPre.h"
57 57
 
58
-#if ENABLED(DOGLCD)
58
+#if HAS_GRAPHICAL_LCD
59 59
 
60 60
 #include <U8glib.h>
61 61
 
@@ -209,4 +209,4 @@ u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi = { u8g_dev_st7920_128x64_HAL_4x_f
209 209
   u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI };
210 210
 #endif
211 211
 
212
-#endif // DOGLCD
212
+#endif // HAS_GRAPHICAL_LCD

+ 33
- 34
Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp Parādīt failu

@@ -59,7 +59,7 @@
59 59
 
60 60
 #include "../../inc/MarlinConfigPre.h"
61 61
 
62
-#if ENABLED(DOGLCD)
62
+#if HAS_GRAPHICAL_LCD
63 63
 
64 64
 #include <U8glib.h>
65 65
 
@@ -114,19 +114,18 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg,
114 114
       u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
115 115
       u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq);
116 116
       break;
117
-    case U8G_DEV_MSG_STOP:
118
-      break;
119
-    case U8G_DEV_MSG_PAGE_NEXT:
120
-      {
121
-        u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
122
-        u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
123
-        u8g_WriteByte(u8g, dev, 0x0B0 | pb->p.page); /* select current page */
124
-        u8g_SetAddress(u8g, dev, 1);           /* data mode */
125
-        if ( u8g_pb_WriteBuffer(pb, u8g, dev) == 0 )
126
-          return 0;
127
-        u8g_SetChipSelect(u8g, dev, 0);
128
-      }
129
-      break;
117
+
118
+    case U8G_DEV_MSG_STOP: break;
119
+
120
+    case U8G_DEV_MSG_PAGE_NEXT: {
121
+      u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
122
+      u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
123
+      u8g_WriteByte(u8g, dev, 0x0B0 | pb->p.page); /* select current page */
124
+      u8g_SetAddress(u8g, dev, 1);           /* data mode */
125
+      if (!u8g_pb_WriteBuffer(pb, u8g, dev)) return 0;
126
+      u8g_SetChipSelect(u8g, dev, 0);
127
+    } break;
128
+
130 129
     case U8G_DEV_MSG_CONTRAST:
131 130
       u8g_SetChipSelect(u8g, dev, 1);
132 131
       u8g_SetAddress(u8g, dev, 0);          /* instruction mode */
@@ -144,25 +143,25 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m
144 143
       u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
145 144
       u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq);
146 145
       break;
147
-    case U8G_DEV_MSG_STOP:
148
-      break;
149
-    case U8G_DEV_MSG_PAGE_NEXT:
150
-      {
151
-        u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
152
-
153
-        u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
154
-        u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page)); /* select current page */
155
-        u8g_SetAddress(u8g, dev, 1);           /* data mode */
156
-  u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
157
-        u8g_SetChipSelect(u8g, dev, 0);
158
-
159
-        u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
160
-        u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page+1)); /* select current page */
161
-        u8g_SetAddress(u8g, dev, 1);           /* data mode */
162
-  u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width);
163
-        u8g_SetChipSelect(u8g, dev, 0);
164
-      }
165
-      break;
146
+
147
+    case U8G_DEV_MSG_STOP: break;
148
+
149
+    case U8G_DEV_MSG_PAGE_NEXT: {
150
+      u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
151
+
152
+      u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
153
+      u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page)); /* select current page */
154
+      u8g_SetAddress(u8g, dev, 1);           /* data mode */
155
+      u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
156
+      u8g_SetChipSelect(u8g, dev, 0);
157
+
158
+      u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
159
+      u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page+1)); /* select current page */
160
+      u8g_SetAddress(u8g, dev, 1);           /* data mode */
161
+      u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width);
162
+      u8g_SetChipSelect(u8g, dev, 0);
163
+    } break;
164
+
166 165
     case U8G_DEV_MSG_CONTRAST:
167 166
       u8g_SetChipSelect(u8g, dev, 1);
168 167
       u8g_SetAddress(u8g, dev, 0);          /* instruction mode */
@@ -182,4 +181,4 @@ u8g_pb_t u8g_dev_uc1701_mini12864_HAL_2x_pb = { {16, HEIGHT, 0, 0, 0},  WIDTH, u
182 181
 u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN };
183 182
 u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_hw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
184 183
 
185
-#endif // DOGLCD
184
+#endif // HAS_GRAPHICAL_LCD

+ 2
- 2
Marlin/src/lcd/dogm/u8g_fontutf8.cpp Parādīt failu

@@ -9,7 +9,7 @@
9 9
 
10 10
 #include "../../inc/MarlinConfigPre.h"
11 11
 
12
-#if ENABLED(DOGLCD)
12
+#if HAS_GRAPHICAL_LCD
13 13
 
14 14
 #include <string.h>
15 15
 #include "../fontutils.h"
@@ -317,4 +317,4 @@ int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg) {
317 317
   return data.adv;
318 318
 }
319 319
 
320
-#endif // DOGLCD
320
+#endif // HAS_GRAPHICAL_LCD

+ 2
- 2
Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp Parādīt failu

@@ -245,7 +245,7 @@ void lcd_kill_screen() {
245 245
 
246 246
 void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
247 247
 
248
-#if ENABLED(ULTIPANEL)
248
+#if HAS_LCD_MENU
249 249
 
250 250
   uint8_t row_y1, row_y2;
251 251
 
@@ -655,6 +655,6 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
655 655
 
656 656
   #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
657 657
 
658
-#endif // ULTIPANEL
658
+#endif // HAS_LCD_MENU
659 659
 
660 660
 #endif // HAS_GRAPHICAL_LCD

+ 10
- 22
Marlin/src/lcd/menu/menu.cpp Parādīt failu

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfigPre.h"
24 24
 
25
-#if ENABLED(ULTIPANEL)
25
+#if HAS_LCD_MENU
26 26
 
27 27
 #include "menu.h"
28 28
 #include "../ultralcd.h"
@@ -75,8 +75,6 @@ bool no_reentry = false;
75 75
 //////// Menu Navigation & History /////////
76 76
 ////////////////////////////////////////////
77 77
 
78
-void lcd_status_screen();
79
-
80 78
 void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
81 79
 
82 80
 void lcd_save_previous_screen() {
@@ -203,14 +201,6 @@ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t
203 201
 
204 202
 bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); }
205 203
 
206
-#if HAS_CHARACTER_LCD && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(LCD_PROGRESS_BAR_TEST) || ENABLED(AUTO_BED_LEVELING_UBL))
207
-  void lcd_set_custom_characters(
208
-    #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
209
-      const uint8_t screen_charset=CHARSET_INFO
210
-    #endif
211
-  );
212
-#endif
213
-
214 204
 /**
215 205
  * General function to go directly to a screen
216 206
  */
@@ -258,19 +248,17 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
258 248
       #endif
259 249
       screen_history_depth = 0;
260 250
     }
251
+
261 252
     lcd_implementation_clear();
253
+
262 254
     // Re-initialize custom characters that may be re-used
263
-    #if HAS_CHARACTER_LCD && ENABLED(AUTO_BED_LEVELING_UBL)
264
-      if (!ubl.lcd_map_control) {
265
-        lcd_set_custom_characters(
266
-          #if ENABLED(LCD_PROGRESS_BAR)
267
-            screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU
268
-          #endif
269
-        );
270
-      }
271
-    #elif ENABLED(LCD_PROGRESS_BAR)
272
-      lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
255
+    #if HAS_CHARACTER_LCD
256
+      #if ENABLED(AUTO_BED_LEVELING_UBL)
257
+        if (!ubl.lcd_map_control)
258
+      #endif
259
+          LCD_SET_CHARSET(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
273 260
     #endif
261
+
274 262
     lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
275 263
     screen_changed = true;
276 264
     #if HAS_GRAPHICAL_LCD
@@ -476,4 +464,4 @@ void _lcd_draw_homing() {
476 464
   void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); }
477 465
 #endif
478 466
 
479
-#endif // ULTIPANEL
467
+#endif // HAS_LCD_MENU

+ 2
- 2
Marlin/src/lcd/menu/menu_configuration.cpp Parādīt failu

@@ -54,7 +54,7 @@ static void lcd_factory_settings() {
54 54
     static int8_t bar_percent = 0;
55 55
     if (use_click()) {
56 56
       lcd_goto_previous_menu();
57
-      lcd_set_custom_characters(CHARSET_MENU);
57
+      LCD_SET_CHARSET(CHARSET_MENU);
58 58
       return;
59 59
     }
60 60
     bar_percent += (int8_t)encoderPosition;
@@ -68,7 +68,7 @@ static void lcd_factory_settings() {
68 68
 
69 69
   void _progress_bar_test() {
70 70
     lcd_goto_screen(progress_bar_test);
71
-    lcd_set_custom_characters();
71
+    LCD_SET_CHARSET(CHARSET_INFO);
72 72
   }
73 73
 
74 74
 #endif // LCD_PROGRESS_BAR_TEST

+ 40
- 45
Marlin/src/lcd/ultralcd.cpp Parādīt failu

@@ -49,7 +49,7 @@
49 49
 
50 50
 #if ENABLED(POWER_LOSS_RECOVERY)
51 51
   #include "../feature/power_loss_recovery.h"
52
-  #if ENABLED(ULTIPANEL)
52
+  #if HAS_LCD_MENU
53 53
     void menu_job_recovery();
54 54
   #endif
55 55
 #endif
@@ -100,7 +100,7 @@ uint8_t lcd_status_update_delay = 1, // First update one loop delayed
100 100
   millis_t previous_lcd_status_ms = 0;
101 101
 #endif
102 102
 
103
-#if ENABLED(SDSUPPORT) && ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES)
103
+#if HAS_LCD_MENU && ENABLED(SDSUPPORT) && ENABLED(SCROLL_LONG_FILENAMES)
104 104
   uint8_t filename_scroll_pos, filename_scroll_max;
105 105
 #endif
106 106
 
@@ -122,8 +122,6 @@ millis_t next_button_update_ms;
122 122
   int8_t encoderDirection = 1;
123 123
 #endif
124 124
 
125
-void lcd_status_screen();
126
-
127 125
 #if HAS_LCD_MENU
128 126
   #include "menu/menu.h"
129 127
 
@@ -202,7 +200,7 @@ void lcd_init() {
202 200
 
203 201
   lcd_buttons_update();
204 202
 
205
-  #if ENABLED(ULTIPANEL)
203
+  #if HAS_LCD_MENU
206 204
     encoderDiff = 0;
207 205
   #endif
208 206
 }
@@ -363,6 +361,14 @@ bool lcd_blink() {
363 361
  * This is very display-dependent, so the lcd implementation draws this.
364 362
  */
365 363
 
364
+#if ENABLED(LCD_PROGRESS_BAR)
365
+  millis_t progress_bar_ms = 0;     // Start millis of the current progress bar cycle
366
+  #if PROGRESS_MSG_EXPIRE > 0
367
+    static millis_t expire_status_ms = 0;
368
+    void dontExpireStatus() { expire_status_ms = 0; }
369
+  #endif
370
+#endif
371
+
366 372
 #if LCD_INFO_SCREEN_STYLE == 0
367 373
   void lcd_impl_status_screen_0();
368 374
 #elif LCD_INFO_SCREEN_STYLE == 1
@@ -371,12 +377,12 @@ bool lcd_blink() {
371 377
 
372 378
 void lcd_status_screen() {
373 379
 
374
-  #if ENABLED(ULTIPANEL)
380
+  #if HAS_LCD_MENU
375 381
     ENCODER_DIRECTION_NORMAL();
376 382
     ENCODER_RATE_MULTIPLY(false);
377 383
   #endif
378 384
 
379
-  #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
385
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || HAS_GRAPHICAL_LCD)
380 386
     // Progress bar % comes from SD when actively printing
381 387
     if (IS_SD_PRINTING())
382 388
       progress_bar_percent = card.percentDone();
@@ -425,18 +431,14 @@ void lcd_status_screen() {
425 431
 
426 432
   #endif // LCD_PROGRESS_BAR
427 433
 
428
-  #if ENABLED(ULTIPANEL)
434
+  #if HAS_LCD_MENU
429 435
 
430 436
     if (use_click()) {
431 437
       #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
432 438
         previous_lcd_status_ms = millis();  // get status message to show up for a while
433 439
       #endif
434
-      lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
435
-        #if ENABLED(LCD_PROGRESS_BAR)
436
-          CHARSET_MENU
437
-        #endif
438
-      );
439 440
       lcd_goto_screen(menu_main);
441
+      lcd_implementation_init(); // May revive the LCD if static electricity killed it
440 442
       return;
441 443
     }
442 444
 
@@ -465,7 +467,7 @@ void lcd_status_screen() {
465 467
 
466 468
     feedrate_percentage = constrain(feedrate_percentage, 10, 999);
467 469
 
468
-  #endif // ULTIPANEL
470
+  #endif // HAS_LCD_MENU
469 471
 
470 472
   #if LCD_INFO_SCREEN_STYLE == 0
471 473
     lcd_impl_status_screen_0();
@@ -514,7 +516,7 @@ void kill_screen(PGM_P lcd_msg) {
514 516
 
515 517
 void lcd_quick_feedback(const bool clear_buttons) {
516 518
 
517
-  #if ENABLED(ULTIPANEL)
519
+  #if HAS_LCD_MENU
518 520
     lcd_refresh();
519 521
     if (clear_buttons) buttons = 0;
520 522
     next_button_update_ms = millis() + 500;
@@ -525,7 +527,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
525 527
   // Buzz and wait. The delay is needed for buttons to settle!
526 528
   lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
527 529
 
528
-  #if ENABLED(ULTIPANEL)
530
+  #if HAS_LCD_MENU
529 531
     #if ENABLED(LCD_USE_I2C_BUZZER)
530 532
       delay(10);
531 533
     #elif PIN_EXISTS(BEEPER)
@@ -534,7 +536,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
534 536
   #endif
535 537
 }
536 538
 
537
-#if ENABLED(ULTIPANEL)
539
+#if HAS_LCD_MENU
538 540
 
539 541
   extern bool no_reentry; // Flag to prevent recursion into menu handlers
540 542
 
@@ -602,7 +604,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
602 604
     }
603 605
   }
604 606
 
605
-#endif // ULTIPANEL
607
+#endif // HAS_LCD_MENU
606 608
 
607 609
 /**
608 610
  * Update the LCD, read encoder buttons, etc.
@@ -652,7 +654,7 @@ void lcd_update() {
652 654
   static uint16_t max_display_update_time = 0;
653 655
   static millis_t next_lcd_update_ms;
654 656
 
655
-  #if ENABLED(ULTIPANEL)
657
+  #if HAS_LCD_MENU
656 658
     static millis_t return_to_status_ms = 0;
657 659
 
658 660
     // Handle any queued Move Axis motion
@@ -688,7 +690,7 @@ void lcd_update() {
688 690
       }
689 691
     #endif
690 692
 
691
-  #endif // ULTIPANEL
693
+  #endif // HAS_LCD_MENU
692 694
 
693 695
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
694 696
 
@@ -712,11 +714,7 @@ void lcd_update() {
712 714
       }
713 715
 
714 716
       lcd_refresh();
715
-      lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
716
-        #if ENABLED(LCD_PROGRESS_BAR)
717
-          currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU
718
-        #endif
719
-      );
717
+      lcd_implementation_init(); // May revive the LCD if static electricity killed it
720 718
     }
721 719
 
722 720
   #endif // SDSUPPORT && SD_DETECT_PIN
@@ -730,7 +728,7 @@ void lcd_update() {
730 728
 
731 729
   const millis_t ms = millis();
732 730
   if (ELAPSED(ms, next_lcd_update_ms)
733
-    #if ENABLED(DOGLCD)
731
+    #if HAS_GRAPHICAL_LCD
734 732
       || drawing_screen
735 733
     #endif
736 734
   ) {
@@ -741,7 +739,7 @@ void lcd_update() {
741 739
       lcd_implementation_update_indicators();
742 740
     #endif
743 741
 
744
-    #if ENABLED(ULTIPANEL)
742
+    #if HAS_LCD_MENU
745 743
 
746 744
       #if ENABLED(LCD_HAS_SLOW_BUTTONS)
747 745
         slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
@@ -797,18 +795,18 @@ void lcd_update() {
797 795
         lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
798 796
       }
799 797
 
800
-    #endif // ULTIPANEL
798
+    #endif // HAS_LCD_MENU
801 799
 
802 800
     // This runs every ~100ms when idling often enough.
803 801
     // Instead of tracking changes just redraw the Status Screen once per second.
804 802
     if (
805
-      #if ENABLED(ULTIPANEL)
803
+      #if HAS_LCD_MENU
806 804
         currentScreen == lcd_status_screen &&
807 805
       #endif
808 806
       !lcd_status_update_delay--
809 807
     ) {
810 808
       lcd_status_update_delay = 9
811
-        #if ENABLED(DOGLCD)
809
+        #if HAS_GRAPHICAL_LCD
812 810
           + 3
813 811
         #endif
814 812
       ;
@@ -816,7 +814,7 @@ void lcd_update() {
816 814
       lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
817 815
     }
818 816
 
819
-    #if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES)
817
+    #if HAS_LCD_MENU && ENABLED(SCROLL_LONG_FILENAMES)
820 818
       // If scrolling of long file names is enabled and we are in the sd card menu,
821 819
       // cause a refresh to occur until all the text has scrolled into view.
822 820
       if (currentScreen == menu_sdcard && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) {
@@ -830,7 +828,7 @@ void lcd_update() {
830 828
     // then we want to use 1/2 of the time only.
831 829
     uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
832 830
 
833
-    #if ENABLED(DOGLCD)
831
+    #if HAS_GRAPHICAL_LCD
834 832
       const bool &is_drawing = drawing_screen;
835 833
     #else
836 834
       constexpr bool is_drawing = false;
@@ -855,15 +853,15 @@ void lcd_update() {
855 853
         buttons_reprapworld_keypad = 0;
856 854
       #endif
857 855
 
858
-      #if ENABLED(ULTIPANEL)
856
+      #if HAS_LCD_MENU
859 857
         #define CURRENTSCREEN() (*currentScreen)()
860 858
       #else
861 859
         #define CURRENTSCREEN() lcd_status_screen()
862 860
       #endif
863 861
 
864
-      #if ENABLED(DOGLCD)
862
+      #if HAS_GRAPHICAL_LCD
865 863
         #if ENABLED(LIGHTWEIGHT_UI)
866
-          #if ENABLED(ULTIPANEL)
864
+          #if HAS_LCD_MENU
867 865
             const bool in_status = currentScreen == lcd_status_screen;
868 866
           #else
869 867
             constexpr bool in_status = true;
@@ -896,7 +894,7 @@ void lcd_update() {
896 894
         CURRENTSCREEN();
897 895
       #endif
898 896
 
899
-      #if ENABLED(ULTIPANEL)
897
+      #if HAS_LCD_MENU
900 898
         lcd_clicked = false;
901 899
       #endif
902 900
 
@@ -905,7 +903,7 @@ void lcd_update() {
905 903
       NOLESS(max_display_update_time, millis() - ms);
906 904
     }
907 905
 
908
-    #if ENABLED(ULTIPANEL)
906
+    #if HAS_LCD_MENU
909 907
 
910 908
       // Return to Status Screen after a timeout
911 909
       if (currentScreen == lcd_status_screen || defer_return_to_status)
@@ -913,7 +911,7 @@ void lcd_update() {
913 911
       else if (ELAPSED(ms, return_to_status_ms))
914 912
         lcd_return_to_status();
915 913
 
916
-    #endif // ULTIPANEL
914
+    #endif // HAS_LCD_MENU
917 915
 
918 916
     // Change state of drawing flag between screen updates
919 917
     if (!is_drawing) switch (lcdDrawUpdate) {
@@ -942,6 +940,7 @@ void lcd_finishstatus(const bool persist=false) {
942 940
       expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
943 941
     #endif
944 942
   #endif
943
+
945 944
   lcd_refresh();
946 945
 
947 946
   #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
@@ -953,10 +952,6 @@ void lcd_finishstatus(const bool persist=false) {
953 952
   #endif
954 953
 }
955 954
 
956
-#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
957
-  void dontExpireStatus() { expire_status_ms = 0; }
958
-#endif
959
-
960 955
 bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
961 956
 
962 957
 void lcd_setstatus(const char * const message, const bool persist) {
@@ -1023,7 +1018,7 @@ void lcd_status_printf_P(const uint8_t level, PGM_P const fmt, ...) {
1023 1018
 
1024 1019
 void lcd_setalertstatusPGM(PGM_P const message) {
1025 1020
   lcd_setstatusPGM(message, 1);
1026
-  #if ENABLED(ULTIPANEL)
1021
+  #if HAS_LCD_MENU
1027 1022
     lcd_return_to_status();
1028 1023
   #endif
1029 1024
 }
@@ -1068,7 +1063,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1068 1063
   }
1069 1064
 #endif
1070 1065
 
1071
-#if ENABLED(ULTIPANEL)
1066
+#if HAS_LCD_MENU
1072 1067
 
1073 1068
   /**
1074 1069
    * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
@@ -1252,6 +1247,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1252 1247
     }
1253 1248
   }
1254 1249
 
1255
-#endif // ULTIPANEL
1250
+#endif // HAS_LCD_MENU
1256 1251
 
1257 1252
 #endif // ULTRA_LCD

+ 26
- 15
Marlin/src/lcd/ultralcd.h Parādīt failu

@@ -89,7 +89,7 @@
89 89
 
90 90
   #elif ENABLED(U8GLIB_SSD1306)
91 91
     // Generic support for SSD1306 OLED I2C LCDs
92
-    //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE 
92
+    //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE
93 93
     //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)           // 4 stripes
94 94
     #define U8G_CLASS U8GLIB_SSD1306_128X64_2X
95 95
     #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)             // 4 stripes
@@ -102,7 +102,7 @@
102 102
     //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0   // 4 stripes
103 103
   #elif ENABLED(U8GLIB_SH1106)
104 104
     // Generic support for SH1106 OLED I2C LCDs
105
-    //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE 
105
+    //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE
106 106
     //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)           // 4 stripes
107 107
     #define U8G_CLASS U8GLIB_SH1106_128X64_2X
108 108
     #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST)             // 4 stripes
@@ -199,6 +199,7 @@
199 199
     #include "../module/motion.h" // for active_extruder
200 200
   #endif
201 201
 
202
+  void lcd_status_screen();
202 203
   void lcd_return_to_status();
203 204
   bool lcd_hasstatus();
204 205
   void lcd_setstatus(const char* message, const bool persist=false);
@@ -229,8 +230,11 @@
229 230
 
230 231
   void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual
231 232
 
232
-  #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
233
-    void dontExpireStatus();
233
+  #if ENABLED(LCD_PROGRESS_BAR)
234
+    extern millis_t progress_bar_ms;  // Start time for the current progress bar cycle
235
+    #if PROGRESS_MSG_EXPIRE > 0
236
+      void dontExpireStatus();
237
+    #endif
234 238
   #endif
235 239
 
236 240
   #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
@@ -246,7 +250,7 @@
246 250
     void set_lcd_contrast(const int16_t value);
247 251
   #endif
248 252
 
249
-  #if ENABLED(DOGLCD)
253
+  #if HAS_GRAPHICAL_LCD
250 254
     #define SETCURSOR(col, row) lcd_moveto(col * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT))
251 255
     #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT))
252 256
   #else
@@ -316,7 +320,7 @@
316 320
       extern uint8_t filename_scroll_pos, filename_scroll_max;
317 321
     #endif
318 322
 
319
-  #endif // ULTIPANEL
323
+  #endif // HAS_LCD_MENU
320 324
 
321 325
   #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
322 326
     extern millis_t previous_lcd_status_ms;
@@ -422,22 +426,29 @@ extern char lcd_status_message[];
422 426
   void lcd_reselect_last_file();
423 427
 #endif
424 428
 
425
-// LCD implementations
426
-void lcd_implementation_clear();
427
-void lcd_implementation_init();
428
-
429 429
 #if HAS_GRAPHICAL_LCD
430 430
   extern bool drawing_screen, first_page;
431 431
 #elif HAS_SPI_LCD
432 432
   constexpr bool first_page = true;
433 433
 #endif
434 434
 
435
+// LCD implementations
436
+void lcd_implementation_clear();
437
+void lcd_implementation_init();
438
+
435 439
 #if HAS_CHARACTER_LCD
436 440
 
437
-  enum HD44780CharSet : uint8_t {
438
-    CHARSET_MENU,
439
-    CHARSET_INFO,
440
-    CHARSET_BOOT
441
-  };
441
+  enum HD44780CharSet : uint8_t { CHARSET_MENU, CHARSET_INFO, CHARSET_BOOT };
442
+
443
+  void lcd_set_custom_characters(
444
+    #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
445
+      const HD44780CharSet screen_charset=CHARSET_INFO
446
+    #endif
447
+  );
448
+  #if ENABLED(LCD_PROGRESS_BAR)
449
+    #define LCD_SET_CHARSET(C) lcd_set_custom_characters(C)
450
+  #else
451
+    #define LCD_SET_CHARSET(C) lcd_set_custom_characters()
452
+  #endif
442 453
 
443 454
 #endif

+ 2
- 2
Marlin/src/module/tool_change.cpp Parādīt failu

@@ -70,7 +70,7 @@
70 70
   #include "../feature/fanmux.h"
71 71
 #endif
72 72
 
73
-#if ENABLED(ULTIPANEL)
73
+#if HAS_LCD_MENU
74 74
   #include "../lcd/ultralcd.h"
75 75
 #endif
76 76
 
@@ -524,7 +524,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
524 524
                 no_move = true;
525 525
           #endif
526 526
 
527
-          #if ENABLED(ULTIPANEL)
527
+          #if HAS_LCD_MENU
528 528
             lcd_return_to_status();
529 529
           #endif
530 530
 

Notiek ielāde…
Atcelt
Saglabāt