lcd_put_wchar_max for COLOR_UI (#20838)

Co-Authored-By: Victor Oliveira <github@victormo.com.br>
This commit is contained in:
Tanguy Pruvot 2021-01-23 06:23:35 +01:00 committed by Scott Lahteine
parent 5398bfab36
commit 60c9a9e654
2 changed files with 19 additions and 4 deletions

View File

@ -357,10 +357,6 @@
#error "FILAMENT_CHANGE_LOAD_LENGTH is now FILAMENT_CHANGE_FAST_LOAD_LENGTH."
#elif defined(LEVEL_CORNERS_INSET)
#error "LEVEL_CORNERS_INSET is now LEVEL_CORNERS_INSET_LFRB."
#elif ENABLED(LEVEL_BED_CORNERS) && !defined(LEVEL_CORNERS_INSET_LFRB)
#error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
#elif BOTH(LEVEL_CORNERS_USE_PROBE, SENSORLESS_PROBING)
#error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
#elif defined(BEZIER_JERK_CONTROL)
#error "BEZIER_JERK_CONTROL is now S_CURVE_ACCELERATION."
#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
#endif
#if ENABLED(LEVEL_BED_CORNERS)
#ifndef LEVEL_CORNERS_INSET_LFRB
#error "LEVEL_BED_CORNERS requires LEVEL_CORNERS_INSET_LFRB values."
#elif ENABLED(LEVEL_CORNERS_USE_PROBE)
#if !HAS_BED_PROBE
#error "LEVEL_CORNERS_USE_PROBE requires a real probe."
#elif ENABLED(SENSORLESS_PROBING)
#error "LEVEL_CORNERS_USE_PROBE is incompatible with SENSORLESS_PROBING."
#endif
#endif
#endif
/**
* Allow only one bed leveling option to be defined
*/

View File

@ -668,6 +668,13 @@ void lcd_moveto(const lcd_uint_t col, const lcd_uint_t row) {
tft.set_background(COLOR_BACKGROUND);
}
int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
tft_string.set();
tft_string.add(c);
tft.add_text(MENU_TEXT_X_OFFSET, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
return tft_string.width();
}
int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
tft_string.set(utf8_str_P);
tft_string.trim();