Skip to content

Commit

Permalink
lcd_put_wchar_max for COLOR_UI (#20838)
Browse files Browse the repository at this point in the history
Co-Authored-By: Victor Oliveira <github@victormo.com.br>
  • Loading branch information
tpruvot and rhapsodyv authored Jan 23, 2021
1 parent 14567f3 commit 0f612d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
*/
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/lcd/tft/ui_320x240.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0f612d5

Please sign in to comment.