Преглед изворни кода

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().
AnHardt пре 9 година
родитељ
комит
340d165a9c
2 измењених фајлова са 18 додато и 23 уклоњено
  1. 2
    2
      Marlin/dogm_lcd_implementation.h
  2. 16
    21
      Marlin/ultralcd.cpp

+ 2
- 2
Marlin/dogm_lcd_implementation.h Прегледај датотеку

318
   lcd_setFont(FONT_STATUSMENU);
318
   lcd_setFont(FONT_STATUSMENU);
319
 
319
 
320
   #ifdef USE_SMALL_INFOFONT
320
   #ifdef USE_SMALL_INFOFONT
321
-    u8g.drawBox(0,30,127,10);
321
+    u8g.drawBox(0,30,128,10);
322
   #else
322
   #else
323
-    u8g.drawBox(0,30,127,9);
323
+    u8g.drawBox(0,30,128,9);
324
   #endif
324
   #endif
325
   u8g.setColorIndex(0); // white on black
325
   u8g.setColorIndex(0); // white on black
326
   u8g.setPrintPos(2,XYZ_BASELINE);
326
   u8g.setPrintPos(2,XYZ_BASELINE);

+ 16
- 21
Marlin/ultralcd.cpp Прегледај датотеку

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
-
1302
-  static uint8_t dotcounter = 63;
1303
   
1292
   
1304
   uint32_t ms = millis();
1293
   uint32_t ms = millis();
1305
   if (ms > lcd_next_update_millis) {
1294
   if (ms > lcd_next_update_millis) {
1351
             } // encoderRateMultiplierEnabled
1340
             } // encoderRateMultiplierEnabled
1352
           #endif //ENCODER_RATE_MULTIPLIER
1341
           #endif //ENCODER_RATE_MULTIPLIER
1353
 
1342
 
1354
-          lcdDrawUpdate = 1;
1355
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
1343
           encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP;
1356
           encoderDiff = 0;
1344
           encoderDiff = 0;
1357
         }
1345
         }
1358
         timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
1346
         timeoutToStatus = ms + LCD_TIMEOUT_TO_STATUS;
1347
+        lcdDrawUpdate = 1;
1359
       }
1348
       }
1360
-
1361
     #endif //ULTIPANEL
1349
     #endif //ULTIPANEL
1362
 
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
+    }
1363
     #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
1364
-      blink++;     // Variable for fan animation and alive dot
1365
-      u8g.firstPage();
1366
-      (*currentMenu)();
1367
       if (lcdDrawUpdate) {
1361
       if (lcdDrawUpdate) {
1362
+        blink++;     // Variable for fan animation and alive dot
1363
+        u8g.firstPage();
1368
         do {
1364
         do {
1369
-          if (!dotcounter) dotcounter = 63;
1370
           lcd_setFont(FONT_MENU);
1365
           lcd_setFont(FONT_MENU);
1371
           u8g.setPrintPos(125, 0);
1366
           u8g.setPrintPos(125, 0);
1372
-  //        if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1373
-          u8g.drawPixel(127, dotcounter--); // draw alive dot
1374
-  //        u8g.setColorIndex(1); // black on white
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
1375
           (*currentMenu)();
1370
           (*currentMenu)();
1376
         } while( u8g.nextPage() );
1371
         } while( u8g.nextPage() );
1377
       }
1372
       }

Loading…
Откажи
Сачувај