Browse Source

Init lcd_sd_status as false to force lcd_update test

Replaces #145 which is way out of date
Scott Lahteine 10 years ago
parent
commit
fc882c34a3
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      Marlin/ultralcd.cpp

+ 6
- 5
Marlin/ultralcd.cpp View File

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

Loading…
Cancel
Save