|
@ -4729,22 +4729,18 @@ void lcd_update() { |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) { |
|
|
if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) { |
|
|
#if ENABLED(DOGLCD) |
|
|
|
|
|
if (!drawing_screen) |
|
|
if (!IS_DRAWING) switch (lcdDrawUpdate) { |
|
|
#endif |
|
|
case LCDVIEW_CALL_NO_REDRAW: |
|
|
{ |
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
switch (lcdDrawUpdate) { |
|
|
break; |
|
|
case LCDVIEW_CALL_NO_REDRAW: |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
|
|
break; |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
|
|
case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
|
|
case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
|
|
case LCDVIEW_NONE: |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
break; |
|
|
case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
|
|
} // switch
|
|
|
case LCDVIEW_NONE: |
|
|
|
|
|
break; |
|
|
|
|
|
} // switch
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ADC_KEYPAD) |
|
|
#if ENABLED(ADC_KEYPAD) |
|
|
buttons_reprapworld_keypad = 0; |
|
|
buttons_reprapworld_keypad = 0; |
|
@ -4756,19 +4752,18 @@ void lcd_update() { |
|
|
#define CURRENTSCREEN() lcd_status_screen() |
|
|
#define CURRENTSCREEN() lcd_status_screen() |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
|
|
#if ENABLED(DOGLCD) |
|
|
if (!drawing_screen) { |
|
|
if (!drawing_screen) { // If not already drawing pages
|
|
|
#if defined(TARGET_LPC1768) |
|
|
u8g.firstPage(); // Start the first page
|
|
|
digitalWrite(P1_4, !digitalRead(P1_4)); //re-arm (was 77 in the old system)
|
|
|
drawing_screen = 1; // Flag as drawing pages
|
|
|
#else |
|
|
|
|
|
digitalWrite(29, !digitalRead(29)); //2560
|
|
|
|
|
|
#endif |
|
|
|
|
|
u8g.firstPage(); |
|
|
|
|
|
drawing_screen = 1; |
|
|
|
|
|
} |
|
|
} |
|
|
lcd_setFont(FONT_MENU); |
|
|
lcd_setFont(FONT_MENU); // Setup font for every page draw
|
|
|
u8g.setColorIndex(1); |
|
|
u8g.setColorIndex(1); // And reset the color
|
|
|
CURRENTSCREEN(); |
|
|
CURRENTSCREEN(); // Draw and process the current screen
|
|
|
|
|
|
|
|
|
|
|
|
// The screen handler can clear drawing_screen for an action that changes the screen.
|
|
|
|
|
|
// If still drawing and there's another page, update max-time and return now.
|
|
|
|
|
|
// The nextPage will already be set up on the next call.
|
|
|
if (drawing_screen && (drawing_screen = u8g.nextPage())) { |
|
|
if (drawing_screen && (drawing_screen = u8g.nextPage())) { |
|
|
NOLESS(max_display_update_time, millis() - ms); |
|
|
NOLESS(max_display_update_time, millis() - ms); |
|
|
return; |
|
|
return; |
|
@ -4776,6 +4771,9 @@ digitalWrite(29, !digitalRead(29)); //2560 |
|
|
#else |
|
|
#else |
|
|
CURRENTSCREEN(); |
|
|
CURRENTSCREEN(); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Keeping track of the longest time for an individual LCD update.
|
|
|
|
|
|
// Used to do screen throttling when the planner starts to fill up.
|
|
|
NOLESS(max_display_update_time, millis() - ms); |
|
|
NOLESS(max_display_update_time, millis() - ms); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -4789,23 +4787,19 @@ digitalWrite(29, !digitalRead(29)); //2560 |
|
|
|
|
|
|
|
|
#endif // ULTIPANEL
|
|
|
#endif // ULTIPANEL
|
|
|
|
|
|
|
|
|
#if ENABLED(DOGLCD) |
|
|
if (!IS_DRAWING) switch (lcdDrawUpdate) { |
|
|
if (!drawing_screen) |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: |
|
|
#endif |
|
|
lcd_implementation_clear(); |
|
|
{ |
|
|
case LCDVIEW_CALL_REDRAW_NEXT: |
|
|
switch (lcdDrawUpdate) { |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
case LCDVIEW_CLEAR_CALL_REDRAW: |
|
|
break; |
|
|
lcd_implementation_clear(); |
|
|
case LCDVIEW_REDRAW_NOW: |
|
|
case LCDVIEW_CALL_REDRAW_NEXT: |
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; |
|
|
break; |
|
|
break; |
|
|
case LCDVIEW_NONE: |
|
|
case LCDVIEW_REDRAW_NOW: |
|
|
break; |
|
|
lcdDrawUpdate = LCDVIEW_NONE; |
|
|
} // switch
|
|
|
break; |
|
|
|
|
|
case LCDVIEW_NONE: |
|
|
|
|
|
break; |
|
|
|
|
|
} // switch
|
|
|
|
|
|
} |
|
|
|
|
|
} // ELAPSED(ms, next_lcd_update_ms)
|
|
|
} // ELAPSED(ms, next_lcd_update_ms)
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|