From 6d4b3f0d6a668f6c038c16cf9587f424f2968778 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Sat, 4 Apr 2015 17:49:39 +0200 Subject: [PATCH] Move the condition before the loop Result see: https://youtu.be/AEnBzdu9_tk Dot is moving not so fast -> less executed loops. --- Marlin/ultralcd.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 64b91f6999..1c124a0062 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -1363,16 +1363,18 @@ void lcd_update() { #ifdef DOGLCD // Changes due to different driver architecture of the DOGM display blink++; // Variable for fan animation and alive dot u8g.firstPage(); - do { - if (!dotcounter) dotcounter = 63; - lcd_setFont(FONT_MENU); - u8g.setPrintPos(125, 0); -// if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot - u8g.drawPixel(127, dotcounter--); // draw alive dot -// u8g.setColorIndex(1); // black on white - (*currentMenu)(); - if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next() - } while( u8g.nextPage() ); + (*currentMenu)(); + if (lcdDrawUpdate) { + do { + if (!dotcounter) dotcounter = 63; + lcd_setFont(FONT_MENU); + u8g.setPrintPos(125, 0); + // if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot + u8g.drawPixel(127, dotcounter--); // draw alive dot + // u8g.setColorIndex(1); // black on white + (*currentMenu)(); + } while( u8g.nextPage() ); + } #else (*currentMenu)(); #endif