Browse Source

blink for char-lcds

Implement and test blinking for char-lcds

# Conflicts:
#	Marlin/ultralcd_implementation_hitachi_HD44780.h
solved
AnHardt 9 years ago
parent
commit
e736779d7e

+ 3
- 3
Marlin/dogm_lcd_implementation.h View File

@@ -352,7 +352,7 @@ static void lcd_implementation_status_screen() {
352 352
   u8g.drawPixel(8, XYZ_BASELINE - 5);
353 353
   u8g.drawPixel(8, XYZ_BASELINE - 3);
354 354
   u8g.setPrintPos(10, XYZ_BASELINE);
355
-  if (axis_known_position[X_AXIS])
355
+  if (axis_known_position[X_AXIS] || (blink & 1))
356 356
     lcd_print(ftostr31ns(current_position[X_AXIS]));
357 357
   else
358 358
     lcd_printPGM(PSTR("---"));
@@ -361,7 +361,7 @@ static void lcd_implementation_status_screen() {
361 361
   u8g.drawPixel(49, XYZ_BASELINE - 5);
362 362
   u8g.drawPixel(49, XYZ_BASELINE - 3);
363 363
   u8g.setPrintPos(51, XYZ_BASELINE);
364
-  if (axis_known_position[Y_AXIS])
364
+  if (axis_known_position[Y_AXIS] || (blink & 1))
365 365
     lcd_print(ftostr31ns(current_position[Y_AXIS]));
366 366
   else
367 367
     lcd_printPGM(PSTR("---"));
@@ -370,7 +370,7 @@ static void lcd_implementation_status_screen() {
370 370
   u8g.drawPixel(89, XYZ_BASELINE - 5);
371 371
   u8g.drawPixel(89, XYZ_BASELINE - 3);
372 372
   u8g.setPrintPos(91, XYZ_BASELINE);
373
-  if (axis_known_position[Z_AXIS])
373
+  if (axis_known_position[Z_AXIS] || (blink & 1))
374 374
     lcd_print(ftostr32sp(current_position[Z_AXIS]));
375 375
   else
376 376
     lcd_printPGM(PSTR("---.--"));

+ 6
- 4
Marlin/ultralcd.cpp View File

@@ -1732,21 +1732,23 @@ void lcd_update() {
1732 1732
     }
1733 1733
     #if ENABLED(DOGLCD)  // Changes due to different driver architecture of the DOGM display
1734 1734
         if (lcdDrawUpdate) {
1735
-          blink++;     // Variable for fan animation and alive dot
1735
+          blink++;     // Variable for animation and alive dot
1736 1736
           u8g.firstPage();
1737 1737
           do {
1738 1738
             lcd_setFont(FONT_MENU);
1739 1739
             u8g.setPrintPos(125, 0);
1740
-            if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1740
+            if (blink & 1) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
1741 1741
             u8g.drawPixel(127, 63); // draw alive dot
1742 1742
             u8g.setColorIndex(1); // black on white
1743 1743
             (*currentMenu)();
1744 1744
           } while (u8g.nextPage());
1745 1745
         }
1746 1746
     #else
1747
-      if (lcdDrawUpdate)
1747
+      if (lcdDrawUpdate) {
1748
+        blink++;     // Variable for animation
1748 1749
         (*currentMenu)();
1749
-    #endif
1750
+      }
1751
+      #endif
1750 1752
 
1751 1753
     #if ENABLED(LCD_HAS_STATUS_INDICATORS)
1752 1754
       lcd_implementation_update_indicators();

+ 6
- 10
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

@@ -3,14 +3,10 @@
3 3
 
4 4
 /**
5 5
 * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
6
-* When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
7 6
 **/
8 7
 
9
-//#if DISABLED(REPRAPWORLD_KEYPAD)
10
-//  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11
-//#else
12
-  extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
13
-//#endif
8
+static unsigned char blink = 0; // Variable for animation
9
+extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
14 10
 
15 11
 ////////////////////////////////////
16 12
 // Setup button and encode mappings for each panel (into 'buttons' variable
@@ -621,13 +617,13 @@ static void lcd_implementation_status_screen() {
621 617
       #else
622 618
 
623 619
         lcd.print('X');
624
-        if (axis_known_position[X_AXIS])
620
+        if (axis_known_position[X_AXIS] || (blink & 1))
625 621
           lcd.print(ftostr4sign(current_position[X_AXIS]));
626 622
         else
627 623
           lcd_printPGM(PSTR(" ---"));
628 624
 
629
-        lcd_printPGM(PSTR(" Y"));
630
-        if (axis_known_position[Y_AXIS])
625
+        lcd_printPGM(PSTR("  Y"));
626
+        if (axis_known_position[Y_AXIS] || (blink & 1))
631 627
           lcd.print(ftostr4sign(current_position[Y_AXIS]));
632 628
         else
633 629
           lcd_printPGM(PSTR(" ---"));
@@ -638,7 +634,7 @@ static void lcd_implementation_status_screen() {
638 634
 
639 635
     lcd.setCursor(LCD_WIDTH - 8, 1);
640 636
     lcd_printPGM(PSTR("Z "));
641
-    if (axis_known_position[Z_AXIS])
637
+    if (axis_known_position[Z_AXIS] || (blink & 1))
642 638
       lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
643 639
     else
644 640
       lcd_printPGM(PSTR("---.--"));

Loading…
Cancel
Save