Move the condition before the loop

Result see: https://youtu.be/AEnBzdu9_tk
Dot is moving not so fast -> less executed loops.
master
AnHardt 10 years ago
parent 4cb7dfc546
commit 6d4b3f0d6a

@ -1363,6 +1363,8 @@ void lcd_update() {
#ifdef DOGLCD // Changes due to different driver architecture of the DOGM display #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display
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; if (!dotcounter) dotcounter = 63;
lcd_setFont(FONT_MENU); lcd_setFont(FONT_MENU);
@ -1371,8 +1373,8 @@ void lcd_update() {
u8g.drawPixel(127, dotcounter--); // draw alive dot u8g.drawPixel(127, dotcounter--); // 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

Loading…
Cancel
Save