|
@@ -4729,22 +4729,18 @@ void lcd_update() {
|
4729
|
4729
|
#endif
|
4730
|
4730
|
|
4731
|
4731
|
if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) {
|
4732
|
|
- #if ENABLED(DOGLCD)
|
4733
|
|
- if (!drawing_screen)
|
4734
|
|
- #endif
|
4735
|
|
- {
|
4736
|
|
- switch (lcdDrawUpdate) {
|
4737
|
|
- case LCDVIEW_CALL_NO_REDRAW:
|
4738
|
|
- lcdDrawUpdate = LCDVIEW_NONE;
|
4739
|
|
- break;
|
4740
|
|
- case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
4741
|
|
- case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
4742
|
|
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
4743
|
|
- case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
4744
|
|
- case LCDVIEW_NONE:
|
4745
|
|
- break;
|
4746
|
|
- } // switch
|
4747
|
|
- }
|
|
4732
|
+
|
|
4733
|
+ if (!IS_DRAWING) switch (lcdDrawUpdate) {
|
|
4734
|
+ case LCDVIEW_CALL_NO_REDRAW:
|
|
4735
|
+ lcdDrawUpdate = LCDVIEW_NONE;
|
|
4736
|
+ break;
|
|
4737
|
+ case LCDVIEW_CLEAR_CALL_REDRAW: // set by handlers, then altered after (rarely occurs here)
|
|
4738
|
+ case LCDVIEW_CALL_REDRAW_NEXT: // set by handlers, then altered after (never occurs here?)
|
|
4739
|
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
|
4740
|
+ case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT
|
|
4741
|
+ case LCDVIEW_NONE:
|
|
4742
|
+ break;
|
|
4743
|
+ } // switch
|
4748
|
4744
|
|
4749
|
4745
|
#if ENABLED(ADC_KEYPAD)
|
4750
|
4746
|
buttons_reprapworld_keypad = 0;
|
|
@@ -4756,19 +4752,18 @@ void lcd_update() {
|
4756
|
4752
|
#define CURRENTSCREEN() lcd_status_screen()
|
4757
|
4753
|
#endif
|
4758
|
4754
|
|
4759
|
|
- #if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
|
4760
|
|
- if (!drawing_screen) {
|
4761
|
|
-#if defined(TARGET_LPC1768)
|
4762
|
|
-digitalWrite(P1_4, !digitalRead(P1_4)); //re-arm (was 77 in the old system)
|
4763
|
|
-#else
|
4764
|
|
-digitalWrite(29, !digitalRead(29)); //2560
|
4765
|
|
-#endif
|
4766
|
|
- u8g.firstPage();
|
4767
|
|
- drawing_screen = 1;
|
|
4755
|
+ #if ENABLED(DOGLCD)
|
|
4756
|
+ if (!drawing_screen) { // If not already drawing pages
|
|
4757
|
+ u8g.firstPage(); // Start the first page
|
|
4758
|
+ drawing_screen = 1; // Flag as drawing pages
|
4768
|
4759
|
}
|
4769
|
|
- lcd_setFont(FONT_MENU);
|
4770
|
|
- u8g.setColorIndex(1);
|
4771
|
|
- CURRENTSCREEN();
|
|
4760
|
+ lcd_setFont(FONT_MENU); // Setup font for every page draw
|
|
4761
|
+ u8g.setColorIndex(1); // And reset the color
|
|
4762
|
+ CURRENTSCREEN(); // Draw and process the current screen
|
|
4763
|
+
|
|
4764
|
+ // The screen handler can clear drawing_screen for an action that changes the screen.
|
|
4765
|
+ // If still drawing and there's another page, update max-time and return now.
|
|
4766
|
+ // The nextPage will already be set up on the next call.
|
4772
|
4767
|
if (drawing_screen && (drawing_screen = u8g.nextPage())) {
|
4773
|
4768
|
NOLESS(max_display_update_time, millis() - ms);
|
4774
|
4769
|
return;
|
|
@@ -4776,6 +4771,9 @@ digitalWrite(29, !digitalRead(29)); //2560
|
4776
|
4771
|
#else
|
4777
|
4772
|
CURRENTSCREEN();
|
4778
|
4773
|
#endif
|
|
4774
|
+
|
|
4775
|
+ // Keeping track of the longest time for an individual LCD update.
|
|
4776
|
+ // Used to do screen throttling when the planner starts to fill up.
|
4779
|
4777
|
NOLESS(max_display_update_time, millis() - ms);
|
4780
|
4778
|
}
|
4781
|
4779
|
|
|
@@ -4789,23 +4787,19 @@ digitalWrite(29, !digitalRead(29)); //2560
|
4789
|
4787
|
|
4790
|
4788
|
#endif // ULTIPANEL
|
4791
|
4789
|
|
4792
|
|
- #if ENABLED(DOGLCD)
|
4793
|
|
- if (!drawing_screen)
|
4794
|
|
- #endif
|
4795
|
|
- {
|
4796
|
|
- switch (lcdDrawUpdate) {
|
4797
|
|
- case LCDVIEW_CLEAR_CALL_REDRAW:
|
4798
|
|
- lcd_implementation_clear();
|
4799
|
|
- case LCDVIEW_CALL_REDRAW_NEXT:
|
4800
|
|
- lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
4801
|
|
- break;
|
4802
|
|
- case LCDVIEW_REDRAW_NOW:
|
4803
|
|
- lcdDrawUpdate = LCDVIEW_NONE;
|
4804
|
|
- break;
|
4805
|
|
- case LCDVIEW_NONE:
|
4806
|
|
- break;
|
4807
|
|
- } // switch
|
4808
|
|
- }
|
|
4790
|
+ if (!IS_DRAWING) switch (lcdDrawUpdate) {
|
|
4791
|
+ case LCDVIEW_CLEAR_CALL_REDRAW:
|
|
4792
|
+ lcd_implementation_clear();
|
|
4793
|
+ case LCDVIEW_CALL_REDRAW_NEXT:
|
|
4794
|
+ lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
|
4795
|
+ break;
|
|
4796
|
+ case LCDVIEW_REDRAW_NOW:
|
|
4797
|
+ lcdDrawUpdate = LCDVIEW_NONE;
|
|
4798
|
+ break;
|
|
4799
|
+ case LCDVIEW_NONE:
|
|
4800
|
+ break;
|
|
4801
|
+ } // switch
|
|
4802
|
+
|
4809
|
4803
|
} // ELAPSED(ms, next_lcd_update_ms)
|
4810
|
4804
|
}
|
4811
|
4805
|
|