|
@ -2707,77 +2707,93 @@ void lcd_update() { |
|
|
} |
|
|
} |
|
|
#endif // ULTIPANEL
|
|
|
#endif // ULTIPANEL
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ENSURE_SMOOTH_MOVES) && ENABLED(ALWAYS_ALLOW_MENU) |
|
|
|
|
|
#define STATUS_UPDATE_CONDITION planner.long_move() |
|
|
|
|
|
#else |
|
|
|
|
|
#define STATUS_UPDATE_CONDITION true |
|
|
|
|
|
#endif |
|
|
|
|
|
#if ENABLED(ENSURE_SMOOTH_MOVES) && DISABLED(ALWAYS_ALLOW_MENU) |
|
|
|
|
|
#define LCD_HANDLER_CONDITION planner.long_move() |
|
|
|
|
|
#else |
|
|
|
|
|
#define LCD_HANDLER_CONDITION true |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
// We arrive here every ~100ms when idling often enough.
|
|
|
// We arrive here every ~100ms when idling often enough.
|
|
|
// Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
|
|
|
// Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
|
|
|
static int8_t lcd_status_update_delay = 1; // first update one loop delayed
|
|
|
static int8_t lcd_status_update_delay = 1; // first update one loop delayed
|
|
|
if ( |
|
|
if (STATUS_UPDATE_CONDITION && |
|
|
#if ENABLED(ULTIPANEL) |
|
|
#if ENABLED(ULTIPANEL) |
|
|
currentScreen == lcd_status_screen && |
|
|
currentScreen == lcd_status_screen && |
|
|
#endif |
|
|
#endif |
|
|
!lcd_status_update_delay--) { |
|
|
!lcd_status_update_delay-- |
|
|
|
|
|
) { |
|
|
lcd_status_update_delay = 9; |
|
|
lcd_status_update_delay = 9; |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (lcdDrawUpdate) { |
|
|
if (LCD_HANDLER_CONDITION) { |
|
|
|
|
|
|
|
|
switch (lcdDrawUpdate) { |
|
|
if (lcdDrawUpdate) { |
|
|
case LCDVIEW_CALL_NO_REDRAW: |
|
|
|
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
|
|
|
break; |
|
|
|
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
|
|
|
|
|
case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
|
|
|
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
|
|
|
case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
|
|
|
|
|
case LCDVIEW_NONE: |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
switch (lcdDrawUpdate) { |
|
|
#define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false |
|
|
case LCDVIEW_CALL_NO_REDRAW: |
|
|
#else |
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
#define CURRENTSCREEN() lcd_status_screen() |
|
|
break; |
|
|
#endif |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
|
|
|
|
|
case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
|
|
|
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
|
|
|
case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
|
|
|
|
|
case LCDVIEW_NONE: |
|
|
|
|
|
break; |
|
|
|
|
|
} // switch
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
#define CURRENTSCREEN() (*currentScreen)(), lcd_clicked = false |
|
|
|
|
|
#else |
|
|
|
|
|
#define CURRENTSCREEN() lcd_status_screen() |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
|
|
#if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
|
|
static int8_t dot_color = 0; |
|
|
static int8_t dot_color = 0; |
|
|
dot_color = 1 - dot_color; |
|
|
dot_color = 1 - dot_color; |
|
|
u8g.firstPage(); |
|
|
u8g.firstPage(); |
|
|
do { |
|
|
do { |
|
|
lcd_setFont(FONT_MENU); |
|
|
lcd_setFont(FONT_MENU); |
|
|
u8g.setPrintPos(125, 0); |
|
|
u8g.setPrintPos(125, 0); |
|
|
u8g.setColorIndex(dot_color); // Set color for the alive dot
|
|
|
u8g.setColorIndex(dot_color); // Set color for the alive dot
|
|
|
u8g.drawPixel(127, 63); // draw alive dot
|
|
|
u8g.drawPixel(127, 63); // draw alive dot
|
|
|
u8g.setColorIndex(1); // black on white
|
|
|
u8g.setColorIndex(1); // black on white
|
|
|
|
|
|
CURRENTSCREEN(); |
|
|
|
|
|
} while (u8g.nextPage()); |
|
|
|
|
|
#else |
|
|
CURRENTSCREEN(); |
|
|
CURRENTSCREEN(); |
|
|
} while (u8g.nextPage()); |
|
|
#endif |
|
|
#else |
|
|
} |
|
|
CURRENTSCREEN(); |
|
|
|
|
|
#endif |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ULTIPANEL) |
|
|
#if ENABLED(ULTIPANEL) |
|
|
|
|
|
|
|
|
// Return to Status Screen after a timeout
|
|
|
// Return to Status Screen after a timeout
|
|
|
if (currentScreen == lcd_status_screen || defer_return_to_status) |
|
|
if (currentScreen == lcd_status_screen || defer_return_to_status) |
|
|
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; |
|
|
return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; |
|
|
else if (ELAPSED(ms, return_to_status_ms)) |
|
|
else if (ELAPSED(ms, return_to_status_ms)) |
|
|
lcd_return_to_status(); |
|
|
lcd_return_to_status(); |
|
|
|
|
|
|
|
|
#endif // ULTIPANEL
|
|
|
#endif // ULTIPANEL
|
|
|
|
|
|
|
|
|
switch (lcdDrawUpdate) { |
|
|
switch (lcdDrawUpdate) { |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: |
|
|
lcd_implementation_clear(); |
|
|
lcd_implementation_clear(); |
|
|
case LCDVIEW_CALL_REDRAW_NEXT: |
|
|
case LCDVIEW_CALL_REDRAW_NEXT: |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
break; |
|
|
break; |
|
|
case LCDVIEW_REDRAW_NOW: |
|
|
case LCDVIEW_REDRAW_NOW: |
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
break; |
|
|
break; |
|
|
case LCDVIEW_NONE: |
|
|
case LCDVIEW_NONE: |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} // switch
|
|
|
|
|
|
|
|
|
|
|
|
} // LCD_HANDLER_CONDITION
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|