blink for char-lcds

Implement and test blinking for char-lcds

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

@ -352,7 +352,7 @@ static void lcd_implementation_status_screen() {
u8g.drawPixel(8, XYZ_BASELINE - 5);
u8g.drawPixel(8, XYZ_BASELINE - 3);
u8g.setPrintPos(10, XYZ_BASELINE);
if (axis_known_position[X_AXIS])
if (axis_known_position[X_AXIS] || (blink & 1))
lcd_print(ftostr31ns(current_position[X_AXIS]));
else
lcd_printPGM(PSTR("---"));
@ -361,7 +361,7 @@ static void lcd_implementation_status_screen() {
u8g.drawPixel(49, XYZ_BASELINE - 5);
u8g.drawPixel(49, XYZ_BASELINE - 3);
u8g.setPrintPos(51, XYZ_BASELINE);
if (axis_known_position[Y_AXIS])
if (axis_known_position[Y_AXIS] || (blink & 1))
lcd_print(ftostr31ns(current_position[Y_AXIS]));
else
lcd_printPGM(PSTR("---"));
@ -370,7 +370,7 @@ static void lcd_implementation_status_screen() {
u8g.drawPixel(89, XYZ_BASELINE - 5);
u8g.drawPixel(89, XYZ_BASELINE - 3);
u8g.setPrintPos(91, XYZ_BASELINE);
if (axis_known_position[Z_AXIS])
if (axis_known_position[Z_AXIS] || (blink & 1))
lcd_print(ftostr32sp(current_position[Z_AXIS]));
else
lcd_printPGM(PSTR("---.--"));

@ -1732,21 +1732,23 @@ void lcd_update() {
}
#if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
if (lcdDrawUpdate) {
blink++; // Variable for fan animation and alive dot
blink++; // Variable for animation and alive dot
u8g.firstPage();
do {
lcd_setFont(FONT_MENU);
u8g.setPrintPos(125, 0);
if (blink % 2) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
if (blink & 1) u8g.setColorIndex(1); else u8g.setColorIndex(0); // Set color for the alive dot
u8g.drawPixel(127, 63); // draw alive dot
u8g.setColorIndex(1); // black on white
(*currentMenu)();
} while (u8g.nextPage());
}
#else
if (lcdDrawUpdate)
if (lcdDrawUpdate) {
blink++; // Variable for animation
(*currentMenu)();
#endif
}
#endif
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
lcd_implementation_update_indicators();

@ -3,14 +3,10 @@
/**
* Implementation of the LCD display routines for a Hitachi HD44780 display. These are common LCD character displays.
* When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
**/
//#if DISABLED(REPRAPWORLD_KEYPAD)
// extern volatile uint8_t buttons; //the last checked buttons in a bit array.
//#else
extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array.
//#endif
static unsigned char blink = 0; // Variable for animation
extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array.
////////////////////////////////////
// Setup button and encode mappings for each panel (into 'buttons' variable
@ -621,13 +617,13 @@ static void lcd_implementation_status_screen() {
#else
lcd.print('X');
if (axis_known_position[X_AXIS])
if (axis_known_position[X_AXIS] || (blink & 1))
lcd.print(ftostr4sign(current_position[X_AXIS]));
else
lcd_printPGM(PSTR(" ---"));
lcd_printPGM(PSTR(" Y"));
if (axis_known_position[Y_AXIS])
lcd_printPGM(PSTR(" Y"));
if (axis_known_position[Y_AXIS] || (blink & 1))
lcd.print(ftostr4sign(current_position[Y_AXIS]));
else
lcd_printPGM(PSTR(" ---"));
@ -638,7 +634,7 @@ static void lcd_implementation_status_screen() {
lcd.setCursor(LCD_WIDTH - 8, 1);
lcd_printPGM(PSTR("Z "));
if (axis_known_position[Z_AXIS])
if (axis_known_position[Z_AXIS] || (blink & 1))
lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
else
lcd_printPGM(PSTR("---.--"));

Loading…
Cancel
Save