|
@@ -227,7 +227,7 @@ static void lcd_status_screen();
|
227
|
227
|
uint8_t lastEncoderBits;
|
228
|
228
|
uint32_t encoderPosition;
|
229
|
229
|
#if PIN_EXISTS(SD_DETECT)
|
230
|
|
- bool lcd_oldcardstatus;
|
|
230
|
+ bool lcd_sd_status;
|
231
|
231
|
#endif
|
232
|
232
|
|
233
|
233
|
#endif // ULTIPANEL
|
|
@@ -1516,7 +1516,7 @@ void lcd_init() {
|
1516
|
1516
|
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
|
1517
|
1517
|
pinMode(SD_DETECT_PIN, INPUT);
|
1518
|
1518
|
WRITE(SD_DETECT_PIN, HIGH);
|
1519
|
|
- lcd_oldcardstatus = IS_SD_INSERTED;
|
|
1519
|
+ lcd_sd_status = false;
|
1520
|
1520
|
#endif
|
1521
|
1521
|
|
1522
|
1522
|
#if ENABLED(LCD_HAS_SLOW_BUTTONS)
|
|
@@ -1574,16 +1574,17 @@ void lcd_update() {
|
1574
|
1574
|
|
1575
|
1575
|
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
|
1576
|
1576
|
|
1577
|
|
- if (IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()) {
|
|
1577
|
+ bool sd_status = IS_SD_INSERTED;
|
|
1578
|
+ if (sd_status != lcd_sd_status && lcd_detected()) {
|
1578
|
1579
|
lcdDrawUpdate = 2;
|
1579
|
|
- lcd_oldcardstatus = IS_SD_INSERTED;
|
|
1580
|
+ lcd_sd_status = sd_status;
|
1580
|
1581
|
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
|
1581
|
1582
|
#if ENABLED(LCD_PROGRESS_BAR)
|
1582
|
1583
|
currentMenu == lcd_status_screen
|
1583
|
1584
|
#endif
|
1584
|
1585
|
);
|
1585
|
1586
|
|
1586
|
|
- if (lcd_oldcardstatus) {
|
|
1587
|
+ if (lcd_sd_status) {
|
1587
|
1588
|
card.initsd();
|
1588
|
1589
|
LCD_MESSAGEPGM(MSG_SD_INSERTED);
|
1589
|
1590
|
}
|