@ -64,6 +64,9 @@ void lcd_status_screen();
millis_t next_lcd_update_ms ;
uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW ; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
# if ENABLED(DOGLCD)
bool drawing_screen = false ;
# endif
# if ENABLED(DAC_STEPPER_CURRENT)
# include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
@ -413,6 +416,9 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
# endif
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT ;
screen_changed = true ;
# if ENABLED(DOGLCD)
drawing_screen = false ;
# endif
}
}
@ -2832,6 +2838,9 @@ void lcd_update() {
encoderPosition + = ( encoderDiff * encoderMultiplier ) / ENCODER_PULSES_PER_STEP ;
encoderDiff = 0 ;
# if ENABLED(DOGLCD)
drawing_screen = false ; // refresh the complete screen for a encoder change (different menu-item/value)
# endif
}
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS ;
lcdDrawUpdate = LCDVIEW_REDRAW_NOW ;
@ -2864,8 +2873,16 @@ void lcd_update() {
if ( LCD_HANDLER_CONDITION ) {
if ( lcdDrawUpdate ) {
# if ENABLED(DOGLCD)
if ( lcdDrawUpdate | | drawing_screen )
# else
if ( lcdDrawUpdate )
# endif
{
# if ENABLED(DOGLCD)
if ( ! drawing_screen )
# endif
{
switch ( lcdDrawUpdate ) {
case LCDVIEW_CALL_NO_REDRAW :
lcdDrawUpdate = LCDVIEW_NONE ;
@ -2877,7 +2894,7 @@ void lcd_update() {
case LCDVIEW_NONE :
break ;
} // switch
}
# if ENABLED(ULTIPANEL)
# define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false
# else
@ -2885,17 +2902,13 @@ void lcd_update() {
# endif
# if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
static int8_t dot_color = 0 ;
dot_color = 1 - dot_color ;
if ( ! drawing_screen ) {
u8g . firstPage ( ) ;
do {
drawing_screen = 1 ;
}
lcd_setFont ( FONT_MENU ) ;
u8g . setPrintPos ( 125 , 0 ) ;
u8g . setColorIndex ( dot_color ) ; // Set color for the alive dot
u8g . drawPixel ( 127 , 63 ) ; // draw alive dot
u8g . setColorIndex ( 1 ) ; // black on white
CURRENTSCREEN ( ) ;
} while ( u8g . nextPage ( ) ) ;
if ( drawing_screen & & ( drawing_screen = u8g . nextPage ( ) ) ) return ;
# else
CURRENTSCREEN ( ) ;
# endif
@ -2911,6 +2924,10 @@ void lcd_update() {
# endif // ULTIPANEL
# if ENABLED(DOGLCD)
if ( ! drawing_screen )
# endif
{
switch ( lcdDrawUpdate ) {
case LCDVIEW_CLEAR_CALL_REDRAW :
lcd_implementation_clear ( ) ;
@ -2923,10 +2940,9 @@ void lcd_update() {
case LCDVIEW_NONE :
break ;
} // switch
} // LCD_HANDLER_CONDITION
}
} // LCD_HANDLER_CONDITION
} // ELAPSED(ms, next_lcd_update_ms)
}
void set_utf_strlen ( char * s , uint8_t n ) {