Merge pull request #819 from neildarlow/Marlin_v1
Activate LiquidTWI2 device detection and space-pad LCD status line.
This commit is contained in:
@ -1262,7 +1262,7 @@ void lcd_update()
|
||||
lcd_buttons_update();
|
||||
|
||||
#if (SDCARDDETECT > 0)
|
||||
if((IS_SD_INSERTED != lcd_oldcardstatus))
|
||||
if((IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()))
|
||||
{
|
||||
lcdDrawUpdate = 2;
|
||||
lcd_oldcardstatus = IS_SD_INSERTED;
|
||||
@ -1365,6 +1365,11 @@ void lcd_setstatus(const char* message)
|
||||
if (lcd_status_message_level > 0)
|
||||
return;
|
||||
strncpy(lcd_status_message, message, LCD_WIDTH);
|
||||
|
||||
size_t i = strlen(lcd_status_message);
|
||||
memset(lcd_status_message + i, ' ', LCD_WIDTH - i);
|
||||
lcd_status_message[LCD_WIDTH] = '\0';
|
||||
|
||||
lcdDrawUpdate = 2;
|
||||
#ifdef FILAMENT_LCD_DISPLAY
|
||||
message_millis=millis(); //get status message to show up for a while
|
||||
@ -1375,6 +1380,11 @@ void lcd_setstatuspgm(const char* message)
|
||||
if (lcd_status_message_level > 0)
|
||||
return;
|
||||
strncpy_P(lcd_status_message, message, LCD_WIDTH);
|
||||
|
||||
size_t i = strlen(lcd_status_message);
|
||||
memset(lcd_status_message + i, ' ', LCD_WIDTH - i);
|
||||
lcd_status_message[LCD_WIDTH] = '\0';
|
||||
|
||||
lcdDrawUpdate = 2;
|
||||
#ifdef FILAMENT_LCD_DISPLAY
|
||||
message_millis=millis(); //get status message to show up for a while
|
||||
@ -1486,6 +1496,15 @@ void lcd_buttons_update()
|
||||
lastEncoderBits = enc;
|
||||
}
|
||||
|
||||
bool lcd_detected(void)
|
||||
{
|
||||
#if (defined(LCD_I2C_TYPE_MCP23017) || defined(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE)
|
||||
return lcd.LcdDetected() == 1;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void lcd_buzz(long duration, uint16_t freq)
|
||||
{
|
||||
#ifdef LCD_USE_I2C_BUZZER
|
||||
|
Reference in New Issue
Block a user