Browse Source

Merge pull request #1817 from AnHardt/dogm_looptest

Execute DOGM display-loop less often
Scott Lahteine 9 years ago
parent
commit
cb02bc6db4
1 changed files with 24 additions and 24 deletions
  1. 24
    24
      Marlin/ultralcd.cpp

+ 24
- 24
Marlin/ultralcd.cpp View File

262
 }
262
 }
263
 
263
 
264
 /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
264
 /* Main status screen. It's up to the implementation specific part to show what is needed. As this is very display dependent */
265
-static void lcd_status_screen()
266
-{
265
+static void lcd_status_screen() {
267
 	encoderRateMultiplierEnabled = false;
266
 	encoderRateMultiplierEnabled = false;
268
 
267
 
269
   #ifdef LCD_PROGRESS_BAR
268
   #ifdef LCD_PROGRESS_BAR
296
     #endif
295
     #endif
297
   #endif //LCD_PROGRESS_BAR
296
   #endif //LCD_PROGRESS_BAR
298
 
297
 
299
-  if (lcd_status_update_delay)
300
-    lcd_status_update_delay--;
301
-  else
302
-    lcdDrawUpdate = 1;
303
-
304
-  if (lcdDrawUpdate) {
305
     lcd_implementation_status_screen();
298
     lcd_implementation_status_screen();
306
-    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 */
307
-  }
308
 
299
 
309
 #ifdef ULTIPANEL
300
 #ifdef ULTIPANEL
310
 
301
 
1298
       }
1289
       }
1299
     }
1290
     }
1300
   #endif//CARDINSERTED
1291
   #endif//CARDINSERTED
1301
-
1292
+  
1302
   uint32_t ms = millis();
1293
   uint32_t ms = millis();
1303
   if (ms > lcd_next_update_millis) {
1294
   if (ms > lcd_next_update_millis) {
1304
 
1295
 
1349
             } // encoderRateMultiplierEnabled
1340
             } // encoderRateMultiplierEnabled
1350
           #endif //ENCODER_RATE_MULTIPLIER
1341
           #endif //ENCODER_RATE_MULTIPLIER
1351
 
1342
 
1352
-          lcdDrawUpdate = 1;
1353
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
1343
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
1354
           encoderDiff = 0;
1344
           encoderDiff = 0;
1355
         }
1345
         }
1356
         timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
1346
         timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
1347
+        lcdDrawUpdate = 1;
1357
       }
1348
       }
1358
-
1359
     #endif //ULTIPANEL
1349
     #endif //ULTIPANEL
1360
 
1350
 
1351
+    if (currentMenu == lcd_status_screen) {
1352
+      if (!lcd_status_update_delay) {
1353
+        lcdDrawUpdate = 1;
1354
+        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 */
1355
+      }
1356
+      else {
1357
+        lcd_status_update_delay--;
1358
+      }
1359
+    }
1361
     #ifdef DOGLCD  // Changes due to different driver architecture of the DOGM display
1360
     #ifdef DOGLCD  // Changes due to different driver architecture of the DOGM display
1362
-      blink++;     // Variable for fan animation and alive dot
1363
-      u8g.firstPage();
1364
-      do {
1365
-        lcd_setFont(FONT_MENU);
1366
-        u8g.setPrintPos(125, 0);
1367
-        if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1368
-        u8g.drawPixel(127, 63); // draw alive dot
1369
-        u8g.setColorIndex(1); // black on white
1370
-        (*currentMenu)();
1371
-        if (!lcdDrawUpdate) break; // Terminate display update, when nothing new to draw. This must be done before the last dogm.next()
1372
-      } while( u8g.nextPage() );
1361
+      if (lcdDrawUpdate) {
1362
+        blink++;     // Variable for fan animation and alive dot
1363
+        u8g.firstPage();
1364
+        do {
1365
+          lcd_setFont(FONT_MENU);
1366
+          u8g.setPrintPos(125, 0);
1367
+          if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1368
+          u8g.drawPixel(127, 63); // draw alive dot
1369
+          u8g.setColorIndex(1); // black on white
1370
+          (*currentMenu)();
1371
+        } while( u8g.nextPage() );
1372
+      }
1373
     #else
1373
     #else
1374
       (*currentMenu)();
1374
       (*currentMenu)();
1375
     #endif
1375
     #endif

Loading…
Cancel
Save