@ -405,7 +405,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
void lcd_erase_line ( const lcd_uint_t line ) {
lcd_moveto ( 0 , line ) ;
for ( uint8_t i = LCD_WIDTH + 1 ; - - i ; )
lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
}
// Scroll the PSTR 'text' in a 'len' wide field for 'time' milliseconds at position col,line
@ -413,7 +413,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
uint8_t slen = utf8_strlen ( ftxt ) ;
if ( slen < len ) {
lcd_put_u8str_max ( col , line , ftxt , len ) ;
for ( ; slen < len ; + + slen ) lcd_put_w char ( ' ' ) ;
for ( ; slen < len ; + + slen ) lcd_put_l char ( ' ' ) ;
safe_delay ( time ) ;
}
else {
@ -425,7 +425,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
lcd_put_u8str_max_P ( col , line , p , len ) ;
// Fill with spaces
for ( uint8_t ix = slen - i ; ix < len ; + + ix ) lcd_put_w char ( ' ' ) ;
for ( uint8_t ix = slen - i ; ix < len ; + + ix ) lcd_put_l char ( ' ' ) ;
// Delay
safe_delay ( dly ) ;
@ -439,9 +439,9 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
static void logo_lines ( FSTR_P const extra ) {
int16_t indent = ( LCD_WIDTH - 8 - utf8_strlen ( extra ) ) / 2 ;
lcd_put_w char ( indent , 0 , ' \x00 ' ) ; lcd_put_u8str ( F ( " ------ " ) ) ; lcd_put_w char ( ' \x01 ' ) ;
lcd_put_l char ( indent , 0 , ' \x00 ' ) ; lcd_put_u8str ( F ( " ------ " ) ) ; lcd_put_l char ( ' \x01 ' ) ;
lcd_put_u8str ( indent , 1 , F ( " |Marlin| " ) ) ; lcd_put_u8str ( extra ) ;
lcd_put_w char ( indent , 2 , ' \x02 ' ) ; lcd_put_u8str ( F ( " ------ " ) ) ; lcd_put_w char ( ' \x03 ' ) ;
lcd_put_l char ( indent , 2 , ' \x02 ' ) ; lcd_put_u8str ( F ( " ------ " ) ) ; lcd_put_l char ( ' \x03 ' ) ;
}
void MarlinUI : : show_bootscreen ( ) {
@ -510,11 +510,11 @@ void MarlinUI::draw_kill_screen() {
// Homed and known, display constantly.
//
FORCE_INLINE void _draw_axis_value ( const AxisEnum axis , const char * value , const bool blink ) {
lcd_put_w char ( ' X ' + uint8_t ( axis ) ) ;
lcd_put_l char ( ' X ' + uint8_t ( axis ) ) ;
if ( blink )
lcd_put_u8str ( value ) ;
else if ( axis_should_home ( axis ) )
while ( const char c = * value + + ) lcd_put_w char ( c < = ' . ' ? c : ' ? ' ) ;
while ( const char c = * value + + ) lcd_put_l char ( c < = ' . ' ? c : ' ? ' ) ;
else if ( NONE ( HOME_AFTER_DEACTIVATE , DISABLE_REDUCED_ACCURACY_WARNING ) & & ! axis_is_trusted ( axis ) )
lcd_put_u8str ( axis = = Z_AXIS ? F ( " " ) : F ( " " ) ) ;
else
@ -531,27 +531,27 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
const celsius_t t1 = thermalManager . wholeDegHotend ( heater_id ) , t2 = thermalManager . degTargetHotend ( heater_id ) ;
# endif
if ( prefix > = 0 ) lcd_put_w char ( prefix ) ;
if ( prefix > = 0 ) lcd_put_l char ( prefix ) ;
lcd_put_u8str ( t1 < 0 ? " err " : i16tostr3rj ( t1 ) ) ;
lcd_put_w char ( ' / ' ) ;
lcd_put_l char ( ' / ' ) ;
# if !HEATER_IDLE_HANDLER
UNUSED ( blink ) ;
# else
if ( ! blink & & thermalManager . heater_idle [ thermalManager . idle_index_for_id ( heater_id ) ] . timed_out ) {
lcd_put_w char ( ' ' ) ;
if ( t2 > = 10 ) lcd_put_w char ( ' ' ) ;
if ( t2 > = 100 ) lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
if ( t2 > = 10 ) lcd_put_l char ( ' ' ) ;
if ( t2 > = 100 ) lcd_put_l char ( ' ' ) ;
}
else
# endif
lcd_put_u8str ( i16tostr3left ( t2 ) ) ;
if ( prefix > = 0 ) {
lcd_put_w char ( LCD_STR_DEGREE [ 0 ] ) ;
lcd_put_w char ( ' ' ) ;
if ( t2 < 10 ) lcd_put_w char ( ' ' ) ;
lcd_put_l char ( LCD_STR_DEGREE [ 0 ] ) ;
lcd_put_l char ( ' ' ) ;
if ( t2 < 10 ) lcd_put_l char ( ' ' ) ;
}
}
@ -559,27 +559,27 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
FORCE_INLINE void _draw_cooler_status ( const char prefix , const bool blink ) {
const celsius_t t2 = thermalManager . degTargetCooler ( ) ;
if ( prefix > = 0 ) lcd_put_w char ( prefix ) ;
if ( prefix > = 0 ) lcd_put_l char ( prefix ) ;
lcd_put_u8str ( i16tostr3rj ( thermalManager . wholeDegCooler ( ) ) ) ;
lcd_put_w char ( ' / ' ) ;
lcd_put_l char ( ' / ' ) ;
# if !HEATER_IDLE_HANDLER
UNUSED ( blink ) ;
# else
if ( ! blink & & thermalManager . heater_idle [ thermalManager . idle_index_for_id ( heater_id ) ] . timed_out ) {
lcd_put_w char ( ' ' ) ;
if ( t2 > = 10 ) lcd_put_w char ( ' ' ) ;
if ( t2 > = 100 ) lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
if ( t2 > = 10 ) lcd_put_l char ( ' ' ) ;
if ( t2 > = 100 ) lcd_put_l char ( ' ' ) ;
}
else
# endif
lcd_put_u8str ( i16tostr3left ( t2 ) ) ;
if ( prefix > = 0 ) {
lcd_put_w char ( LCD_STR_DEGREE [ 0 ] ) ;
lcd_put_w char ( ' ' ) ;
if ( t2 < 10 ) lcd_put_w char ( ' ' ) ;
lcd_put_l char ( LCD_STR_DEGREE [ 0 ] ) ;
lcd_put_l char ( ' ' ) ;
if ( t2 < 10 ) lcd_put_l char ( ' ' ) ;
}
}
# endif
@ -588,7 +588,7 @@ FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
FORCE_INLINE void _draw_flowmeter_status ( ) {
lcd_put_u8str ( " ~ " ) ;
lcd_put_u8str ( ftostr11ns ( cooler . flowrate ) ) ;
lcd_put_w char ( ' L ' ) ;
lcd_put_l char ( ' L ' ) ;
}
# endif
@ -602,7 +602,7 @@ FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
}
else {
lcd_put_u8str ( ftostr12ns ( ammeter . current ) ) ;
lcd_put_w char ( ' A ' ) ;
lcd_put_l char ( ' A ' ) ;
}
}
# endif
@ -620,7 +620,7 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
lcd_put_u8str ( ui8tostr3rj ( progress ) ) ;
else
lcd_put_u8str ( F ( " --- " ) ) ;
lcd_put_w char ( ' % ' ) ;
lcd_put_l char ( ' % ' ) ;
}
# endif
@ -667,7 +667,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str ( ftostr12ns ( filwidth . measured_mm ) ) ;
lcd_put_u8str ( F ( " V " ) ) ;
lcd_put_u8str ( i16tostr3rj ( planner . volumetric_percent ( parser . volumetric_enabled ) ) ) ;
lcd_put_w char ( ' % ' ) ;
lcd_put_l char ( ' % ' ) ;
return ;
}
@ -686,7 +686,7 @@ void MarlinUI::draw_status_message(const bool blink) {
lcd_put_u8str ( status_message ) ;
// Fill the rest with spaces
while ( slen < LCD_WIDTH ) { lcd_put_w char ( ' ' ) ; + + slen ; }
while ( slen < LCD_WIDTH ) { lcd_put_l char ( ' ' ) ; + + slen ; }
}
else {
// String is larger than the available space in screen.
@ -700,11 +700,11 @@ void MarlinUI::draw_status_message(const bool blink) {
// If the remaining string doesn't completely fill the screen
if ( rlen < LCD_WIDTH ) {
uint8_t chars = LCD_WIDTH - rlen ; // Amount of space left in characters
lcd_put_w char ( ' ' ) ; // Always at 1+ spaces left, draw a space
lcd_put_l char ( ' ' ) ; // Always at 1+ spaces left, draw a space
if ( - - chars ) { // Draw a second space if there's room
lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
if ( - - chars ) { // Draw a third space if there's room
lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
if ( - - chars )
lcd_put_u8str_max ( status_message , chars ) ; // Print a second copy of the message
}
@ -726,7 +726,7 @@ void MarlinUI::draw_status_message(const bool blink) {
// Fill the rest with spaces if there are missing spaces
while ( slen < LCD_WIDTH ) {
lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
+ + slen ;
}
# endif
@ -778,7 +778,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink)
duration_t remaining = ( progress > 0 ) ? ( ( elapsed * 25600 / progress ) > > 8 ) - elapsed : 0 ;
# endif
timepos - = remaining . toDigital ( buffer ) ;
lcd_put_w char ( timepos , 2 , ' R ' ) ;
lcd_put_l char ( timepos , 2 , ' R ' ) ;
}
# else
constexpr bool show_remain = false ;
@ -787,7 +787,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink)
if ( ! show_remain ) {
duration_t elapsed = print_job_timer . duration ( ) ;
timepos - = elapsed . toDigital ( buffer ) ;
lcd_put_w char ( timepos , 2 , LCD_STR_CLOCK [ 0 ] ) ;
lcd_put_l char ( timepos , 2 , LCD_STR_CLOCK [ 0 ] ) ;
}
lcd_put_u8str ( buffer ) ;
return timepos ;
@ -912,7 +912,7 @@ void MarlinUI::draw_status_screen() {
else {
const xy_pos_t lpos = current_position . asLogical ( ) ;
_draw_axis_value ( X_AXIS , ftostr4sign ( lpos . x ) , blink ) ;
lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' ' ) ;
_draw_axis_value ( Y_AXIS , ftostr4sign ( lpos . y ) , blink ) ;
}
@ -926,7 +926,7 @@ void MarlinUI::draw_status_screen() {
_draw_axis_value ( Z_AXIS , ftostr52sp ( LOGICAL_Z_POSITION ( current_position . z ) ) , blink ) ;
# if HAS_LEVELING && !HAS_HEATED_BED
lcd_put_w char ( planner . leveling_active | | blink ? ' _ ' : ' ' ) ;
lcd_put_l char ( planner . leveling_active | | blink ? ' _ ' : ' ' ) ;
# endif
# endif // LCD_HEIGHT > 2
@ -935,9 +935,9 @@ void MarlinUI::draw_status_screen() {
# if LCD_HEIGHT > 3
lcd_put_w char ( 0 , 2 , LCD_STR_FEEDRATE [ 0 ] ) ;
lcd_put_l char ( 0 , 2 , LCD_STR_FEEDRATE [ 0 ] ) ;
lcd_put_u8str ( i16tostr3rj ( feedrate_percentage ) ) ;
lcd_put_w char ( ' % ' ) ;
lcd_put_l char ( ' % ' ) ;
const uint8_t timepos = draw_elapsed_or_remaining_time ( LCD_WIDTH - 1 , blink ) ;
@ -969,9 +969,9 @@ void MarlinUI::draw_status_screen() {
per = planner . flow_percentage [ 0 ] ;
# endif
}
lcd_put_w char ( c ) ;
lcd_put_l char ( c ) ;
lcd_put_u8str ( i16tostr3rj ( per ) ) ;
lcd_put_w char ( ' % ' ) ;
lcd_put_l char ( ' % ' ) ;
# endif
# endif
@ -993,7 +993,7 @@ void MarlinUI::draw_status_screen() {
_draw_axis_value ( Z_AXIS , ftostr52sp ( LOGICAL_Z_POSITION ( current_position . z ) ) , blink ) ;
# if HAS_LEVELING && (HAS_MULTI_HOTEND || !HAS_HEATED_BED)
lcd_put_w char ( LCD_WIDTH - 1 , 0 , planner . leveling_active | | blink ? ' _ ' : ' ' ) ;
lcd_put_l char ( LCD_WIDTH - 1 , 0 , planner . leveling_active | | blink ? ' _ ' : ' ' ) ;
# endif
// ========== Line 2 ==========
@ -1008,9 +1008,9 @@ void MarlinUI::draw_status_screen() {
_draw_bed_status ( blink ) ;
# endif
lcd_put_w char ( LCD_WIDTH - 9 , 1 , LCD_STR_FEEDRATE [ 0 ] ) ;
lcd_put_l char ( LCD_WIDTH - 9 , 1 , LCD_STR_FEEDRATE [ 0 ] ) ;
lcd_put_u8str ( i16tostr3rj ( feedrate_percentage ) ) ;
lcd_put_w char ( ' % ' ) ;
lcd_put_l char ( ' % ' ) ;
// ========== Line 3 ==========
@ -1075,29 +1075,29 @@ void MarlinUI::draw_status_screen() {
vlen = vstr ? utf8_strlen ( vstr ) : 0 ;
if ( style & SS_CENTER ) {
int8_t pad = ( LCD_WIDTH - plen - vlen ) / 2 ;
while ( - - pad > = 0 ) { lcd_put_w char ( ' ' ) ; n - - ; }
while ( - - pad > = 0 ) { lcd_put_l char ( ' ' ) ; n - - ; }
}
if ( plen ) n = lcd_put_u8str ( fstr , itemIndex , itemStringC , itemStringF , n ) ;
if ( vlen ) n - = lcd_put_u8str_max ( vstr , n ) ;
for ( ; n > 0 ; - - n ) lcd_put_w char ( ' ' ) ;
for ( ; n > 0 ; - - n ) lcd_put_l char ( ' ' ) ;
}
// Draw a generic menu item with pre_char (if selected) and post_char
void MenuItemBase : : _draw ( const bool sel , const uint8_t row , FSTR_P const ftpl , const char pre_char , const char post_char ) {
lcd_put_w char ( 0 , row , sel ? pre_char : ' ' ) ;
lcd_put_l char ( 0 , row , sel ? pre_char : ' ' ) ;
uint8_t n = lcd_put_u8str ( ftpl , itemIndex , itemStringC , itemStringF , LCD_WIDTH - 2 ) ;
for ( ; n ; - - n ) lcd_put_w char ( ' ' ) ;
lcd_put_w char ( post_char ) ;
for ( ; n ; - - n ) lcd_put_l char ( ' ' ) ;
lcd_put_l char ( post_char ) ;
}
// Draw a menu item with a (potentially) editable value
void MenuEditItemBase : : draw ( const bool sel , const uint8_t row , FSTR_P const ftpl , const char * const inStr , const bool pgm ) {
const uint8_t vlen = inStr ? ( pgm ? utf8_strlen_P ( inStr ) : utf8_strlen ( inStr ) ) : 0 ;
lcd_put_w char ( 0 , row , sel ? LCD_STR_ARROW_RIGHT [ 0 ] : ' ' ) ;
lcd_put_l char ( 0 , row , sel ? LCD_STR_ARROW_RIGHT [ 0 ] : ' ' ) ;
uint8_t n = lcd_put_u8str ( ftpl , itemIndex , itemStringC , itemStringF , LCD_WIDTH - 2 - vlen ) ;
if ( vlen ) {
lcd_put_w char ( ' : ' ) ;
for ( ; n ; - - n ) lcd_put_w char ( ' ' ) ;
lcd_put_l char ( ' : ' ) ;
for ( ; n ; - - n ) lcd_put_l char ( ' ' ) ;
if ( pgm ) lcd_put_u8str_P ( inStr ) ; else lcd_put_u8str ( inStr ) ;
}
}
@ -1107,10 +1107,10 @@ void MarlinUI::draw_status_screen() {
ui . encoder_direction_normal ( ) ;
uint8_t n = lcd_put_u8str ( 0 , 1 , ftpl , itemIndex , itemStringC , itemStringF , LCD_WIDTH - 1 ) ;
if ( value ) {
lcd_put_w char ( ' : ' ) ; n - - ;
lcd_put_l char ( ' : ' ) ; n - - ;
const uint8_t len = utf8_strlen ( value ) + 1 ; // Plus one for a leading space
const lcd_uint_t valrow = n < len ? 2 : 1 ; // Value on the next row if it won't fit
lcd_put_w char ( LCD_WIDTH - len , valrow , ' ' ) ; // Right-justified, padded, leading space
lcd_put_l char ( LCD_WIDTH - len , valrow , ' ' ) ; // Right-justified, padded, leading space
lcd_put_u8str ( value ) ;
}
}
@ -1120,22 +1120,22 @@ void MarlinUI::draw_status_screen() {
ui . draw_select_screen_prompt ( pref , string , suff ) ;
if ( no ) {
SETCURSOR ( 0 , LCD_HEIGHT - 1 ) ;
lcd_put_w char ( yesno ? ' ' : ' [ ' ) ; lcd_put_u8str ( no ) ; lcd_put_w char ( yesno ? ' ' : ' ] ' ) ;
lcd_put_l char ( yesno ? ' ' : ' [ ' ) ; lcd_put_u8str ( no ) ; lcd_put_l char ( yesno ? ' ' : ' ] ' ) ;
}
if ( yes ) {
SETCURSOR_RJ ( utf8_strlen ( yes ) + 2 , LCD_HEIGHT - 1 ) ;
lcd_put_w char ( yesno ? ' [ ' : ' ' ) ; lcd_put_u8str ( yes ) ; lcd_put_w char ( yesno ? ' ] ' : ' ' ) ;
lcd_put_l char ( yesno ? ' [ ' : ' ' ) ; lcd_put_u8str ( yes ) ; lcd_put_l char ( yesno ? ' ] ' : ' ' ) ;
}
}
# if ENABLED(SDSUPPORT)
void MenuItem_sdbase : : draw ( const bool sel , const uint8_t row , FSTR_P const , CardReader & theCard , const bool isDir ) {
lcd_put_w char ( 0 , row , sel ? LCD_STR_ARROW_RIGHT [ 0 ] : ' ' ) ;
lcd_put_l char ( 0 , row , sel ? LCD_STR_ARROW_RIGHT [ 0 ] : ' ' ) ;
constexpr uint8_t maxlen = LCD_WIDTH - 2 ;
uint8_t n = maxlen - lcd_put_u8str_max ( ui . scrolled_filename ( theCard , maxlen , row , sel ) , maxlen ) ;
for ( ; n ; - - n ) lcd_put_w char ( ' ' ) ;
lcd_put_w char ( isDir ? LCD_STR_FOLDER [ 0 ] : ' ' ) ;
for ( ; n ; - - n ) lcd_put_l char ( ' ' ) ;
lcd_put_l char ( isDir ? LCD_STR_FOLDER [ 0 ] : ' ' ) ;
}
# endif
@ -1253,7 +1253,7 @@ void MarlinUI::draw_status_screen() {
void prep_and_put_map_char ( custom_char & chrdata , const coordinate & ul , const coordinate & lr , const coordinate & brc , const uint8_t cl , const char c , const lcd_uint_t x , const lcd_uint_t y ) {
add_edges_to_custom_char ( chrdata , ul , lr , brc , cl ) ;
lcd . createChar ( c , ( uint8_t * ) & chrdata ) ;
lcd_put_w char ( x , y , c ) ;
lcd_put_l char ( x , y , c ) ;
}
void MarlinUI : : ubl_plot ( const uint8_t x_plot , const uint8_t y_plot ) {
@ -1270,7 +1270,7 @@ void MarlinUI::draw_status_screen() {
# define _LCD_W_POS 8
# define _PLOT_X 0
# define _MAP_X 1
# define _LABEL(X,Y,C) lcd_put_w char(X, Y, C)
# define _LABEL(X,Y,C) lcd_put_l char(X, Y, C)
# define _XLABEL(X,Y) _LABEL('X',X,Y)
# define _YLABEL(X,Y) _LABEL('Y',X,Y)
# define _ZLABEL(X,Y) _LABEL('Z',X,Y)
@ -1333,13 +1333,13 @@ void MarlinUI::draw_status_screen() {
n_cols = right_edge / ( HD44780_CHAR_WIDTH ) + 1 ;
for ( i = 0 ; i < n_cols ; i + + ) {
lcd_put_w char ( i , 0 , CHAR_LINE_TOP ) ; // Box Top line
lcd_put_w char ( i , n_rows - 1 , CHAR_LINE_BOT ) ; // Box Bottom line
lcd_put_l char ( i , 0 , CHAR_LINE_TOP ) ; // Box Top line
lcd_put_l char ( i , n_rows - 1 , CHAR_LINE_BOT ) ; // Box Bottom line
}
for ( j = 0 ; j < n_rows ; j + + ) {
lcd_put_w char ( 0 , j , CHAR_EDGE_L ) ; // Box Left edge
lcd_put_w char ( n_cols - 1 , j , CHAR_EDGE_R ) ; // Box Right edge
lcd_put_l char ( 0 , j , CHAR_EDGE_L ) ; // Box Left edge
lcd_put_l char ( n_cols - 1 , j , CHAR_EDGE_R ) ; // Box Right edge
}
/**
@ -1349,8 +1349,8 @@ void MarlinUI::draw_status_screen() {
k = pixels_per_y_mesh_pnt * ( GRID_MAX_POINTS_Y ) + 2 ;
l = ( HD44780_CHAR_HEIGHT ) * n_rows ;
if ( l > k & & l - k > = ( HD44780_CHAR_HEIGHT ) / 2 ) {
lcd_put_w char ( 0 , n_rows - 1 , ' ' ) ; // Box Left edge
lcd_put_w char ( n_cols - 1 , n_rows - 1 , ' ' ) ; // Box Right edge
lcd_put_l char ( 0 , n_rows - 1 , ' ' ) ; // Box Left edge
lcd_put_l char ( n_cols - 1 , n_rows - 1 , ' ' ) ; // Box Right edge
}
clear_custom_char ( & new_char ) ;
@ -1464,11 +1464,11 @@ void MarlinUI::draw_status_screen() {
/**
* Print plot position
*/
lcd_put_w char ( _LCD_W_POS , 0 , ' ( ' ) ;
lcd_put_l char ( _LCD_W_POS , 0 , ' ( ' ) ;
lcd_put_u8str ( ui8tostr3rj ( x_plot ) ) ;
lcd_put_w char ( ' , ' ) ;
lcd_put_l char ( ' , ' ) ;
lcd_put_u8str ( ui8tostr3rj ( y_plot ) ) ;
lcd_put_w char ( ' ) ' ) ;
lcd_put_l char ( ' ) ' ) ;
# if LCD_HEIGHT <= 3 // 16x2 or 20x2 display