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

+ 6
- 4
Marlin/ultralcd.cpp View File

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

+ 6
- 10
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

3
 
3
 
4
 /**
4
 /**
5
 * Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
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
 // Setup button and encode mappings for each panel (into 'buttons' variable
12
 // Setup button and encode mappings for each panel (into 'buttons' variable
621
       #else
617
       #else
622
 
618
 
623
         lcd.print('X');
619
         lcd.print('X');
624
-        if (axis_known_position[X_AXIS])
620
+        if (axis_known_position[X_AXIS] || (blink & 1))
625
           lcd.print(ftostr4sign(current_position[X_AXIS]));
621
           lcd.print(ftostr4sign(current_position[X_AXIS]));
626
         else
622
         else
627
           lcd_printPGM(PSTR(" ---"));
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
           lcd.print(ftostr4sign(current_position[Y_AXIS]));
627
           lcd.print(ftostr4sign(current_position[Y_AXIS]));
632
         else
628
         else
633
           lcd_printPGM(PSTR(" ---"));
629
           lcd_printPGM(PSTR(" ---"));
638
 
634
 
639
     lcd.setCursor(LCD_WIDTH - 8, 1);
635
     lcd.setCursor(LCD_WIDTH - 8, 1);
640
     lcd_printPGM(PSTR("Z "));
636
     lcd_printPGM(PSTR("Z "));
641
-    if (axis_known_position[Z_AXIS])
637
+    if (axis_known_position[Z_AXIS] || (blink & 1))
642
       lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
638
       lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
643
     else
639
     else
644
       lcd_printPGM(PSTR("---.--"));
640
       lcd_printPGM(PSTR("---.--"));

Loading…
Cancel
Save