Merge pull request #1817 from AnHardt/dogm_looptest

Execute DOGM display-loop less often
This commit is contained in:
Scott Lahteine 2015-04-04 17:29:56 -07:00
commit cb02bc6db4

View File

@ -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
@ -1349,16 +1340,25 @@ 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();
do { do {
@ -1368,8 +1368,8 @@ void lcd_update() {
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
(*currentMenu)(); (*currentMenu)();
if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
} while( u8g.nextPage() ); } while( u8g.nextPage() );
}
#else #else
(*currentMenu)(); (*currentMenu)();
#endif #endif