Browse Source

lcd_put_wchar_max for COLOR_UI (#20838)

Co-Authored-By: Victor Oliveira <github@victormo.com.br>
Tanguy Pruvot 4 years ago
parent
commit
0f612d5021
No account linked to committer's email address
2 changed files with 19 additions and 4 deletions
  1. 12
    4
      Marlin/src/inc/SanityCheck.h
  2. 7
    0
      Marlin/src/lcd/tft/ui_320x240.cpp

+ 12
- 4
Marlin/src/inc/SanityCheck.h View File

@@ -357,10 +357,6 @@
357 357
   #error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
358 358
 #elif defined(LEVEL_CORNERS_INSET)
359 359
   #error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB."
360
-#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB)
361
-  #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
362
-#elif BOTH(LEVEL_CORNERS_USE_PROBE, SENSORLESS_PROBING)
363
-  #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
364 360
 #elif defined(BEZIER_JERK_CONTROL)
365 361
   #error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
366 362
 #elif HAS_JUNCTION_DEVIATION && defined(JUNCTION_DEVIATION_FACTOR)
@@ -1433,6 +1429,18 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1433 1429
 
1434 1430
 #endif
1435 1431
 
1432
+#if ENABLED(LEVEL_BED_CORNERS)
1433
+  #ifndef LEVEL_CORNERS_INSET_LFRB
1434
+    #error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
1435
+  #elif ENABLED(LEVEL_CORNERS_USE_PROBE)
1436
+    #if !HAS_BED_PROBE
1437
+      #error "LEVEL_CORNERS_USE_PROBE requires a real probe."
1438
+    #elif ENABLED(SENSORLESS_PROBING)
1439
+      #error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
1440
+    #endif
1441
+  #endif
1442
+#endif
1443
+
1436 1444
 /**
1437 1445
  * Allow only one bed leveling option to be defined
1438 1446
  */

+ 7
- 0
Marlin/src/lcd/tft/ui_320x240.cpp View File

@@ -668,6 +668,13 @@ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) {
668 668
   tft.set_background(COLOR_BACKGROUND);
669 669
 }
670 670
 
671
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
672
+  tft_string.set();
673
+  tft_string.add(c);
674
+  tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
675
+  return tft_string.width();
676
+}
677
+
671 678
 int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
672 679
   tft_string.set(utf8_str_P);
673 680
   tft_string.trim();

Loading…
Cancel
Save