Browse Source

Reduce display updates for dogm displays

In 'if (encoderPastThreshold || LCD_CLICKED)' lcdDrawUpdate was not set.

'lcd_status_update_delay'-loop was not effective in  function
lcd_status_screen().
The loop prevented the update of the status screen but not the displays
update.
Shifted the loop into lcd_update().
pull/1/head
AnHardt 10 years ago
parent
commit
340d165a9c
  1. 4
      Marlin/dogm_lcd_implementation.h
  2. 35
      Marlin/ultralcd.cpp

4
Marlin/dogm_lcd_implementation.h

@ -318,9 +318,9 @@ static void lcd_implementation_status_screen() {
lcd_setFont(FONT_STATUSMENU); lcd_setFont(FONT_STATUSMENU);
#ifdef USE_SMALL_INFOFONT #ifdef USE_SMALL_INFOFONT
u8g.drawBox(0,30,127,10); u8g.drawBox(0,30,128,10);
#else #else
u8g.drawBox(0,30,127,9); u8g.drawBox(0,30,128,9);
#endif #endif
u8g.setColorIndex(0); // white on black u8g.setColorIndex(0); // white on black
u8g.setPrintPos(2,XYZ_BASELINE); u8g.setPrintPos(2,XYZ_BASELINE);

35
Marlin/ultralcd.cpp

@ -262,8 +262,7 @@ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool
} }
/* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */ /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
static void lcd_status_screen() static void lcd_status_screen() {
{
encoderRateMultiplierEnabled = false; encoderRateMultiplierEnabled = false;
#ifdef LCD_PROGRESS_BAR #ifdef LCD_PROGRESS_BAR
@ -296,15 +295,7 @@ static void lcd_status_screen()
#endif #endif
#endif //LCD_PROGRESS_BAR #endif //LCD_PROGRESS_BAR
if (lcd_status_update_delay)
lcd_status_update_delay--;
else
lcdDrawUpdate = 1;
if (lcdDrawUpdate) {
lcd_implementation_status_screen(); lcd_implementation_status_screen();
lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
}
#ifdef ULTIPANEL #ifdef ULTIPANEL
@ -1299,8 +1290,6 @@ void lcd_update() {
} }
#endif//CARDINSERTED #endif//CARDINSERTED
static uint8_t dotcounter = 63;
uint32_t ms = millis(); uint32_t ms = millis();
if (ms > lcd_next_update_millis) { if (ms > lcd_next_update_millis) {
@ -1351,27 +1340,33 @@ void lcd_update() {
} // encoderRateMultiplierEnabled } // encoderRateMultiplierEnabled
#endif //ENCODER_RATE_MULTIPLIER #endif //ENCODER_RATE_MULTIPLIER
lcdDrawUpdate = 1;
encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP; encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
encoderDiff = 0; encoderDiff = 0;
} }
timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS; timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
lcdDrawUpdate = 1;
} }
#endif //ULTIPANEL #endif //ULTIPANEL
if (currentMenu == lcd_status_screen) {
if (!lcd_status_update_delay) {
lcdDrawUpdate = 1;
lcd_status_update_delay = 10; /* redraw the main screen every second. This is easier then trying keep track of all things that change on the screen */
}
else {
lcd_status_update_delay--;
}
}
#ifdef DOGLCD // Changes due to different driver architecture of the DOGM display #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display
if (lcdDrawUpdate) {
blink++; // Variable for fan animation and alive dot blink++; // Variable for fan animation and alive dot
u8g.firstPage(); u8g.firstPage();
(*currentMenu)();
if (lcdDrawUpdate) {
do { do {
if (!dotcounter) dotcounter = 63;
lcd_setFont(FONT_MENU); lcd_setFont(FONT_MENU);
u8g.setPrintPos(125, 0); u8g.setPrintPos(125, 0);
// if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
u8g.drawPixel(127, dotcounter--); // draw alive dot u8g.drawPixel(127, 63); // draw alive dot
// u8g.setColorIndex(1); // black on white u8g.setColorIndex(1); // black on white
(*currentMenu)(); (*currentMenu)();
} while( u8g.nextPage() ); } while( u8g.nextPage() );
} }

Loading…
Cancel
Save