Browse Source

SDCARDINSERTED is always defined, and thus we do not need the #ifdefs.

pull/1/head
daid303 12 years ago
parent
commit
f4a89ec776
  1. 25
      Marlin/ultralcd.cpp

25
Marlin/ultralcd.cpp

@ -2295,11 +2295,7 @@ void MainMenu::showSD()
// if(force_lcd_update) // if(force_lcd_update)
// { // {
// lcd.setCursor(0,line); // lcd.setCursor(0,line);
// #ifdef CARDINSERTED
// if(CARDINSERTED) // if(CARDINSERTED)
// #else
// if(true)
// #endif
// { // {
// LCD_PRINT_PGM(" \004Refresh"); // LCD_PRINT_PGM(" \004Refresh");
// } // }
@ -2455,11 +2451,7 @@ void MainMenu::showMainMenu()
if(force_lcd_update) if(force_lcd_update)
{ {
lcd.setCursor(0,line); lcd.setCursor(0,line);
#ifdef CARDINSERTED
if(CARDINSERTED) if(CARDINSERTED)
#else
if(true)
#endif
{ {
if(card.sdprinting) if(card.sdprinting)
LCD_PRINT_PGM(MSG_STOP_PRINT); LCD_PRINT_PGM(MSG_STOP_PRINT);
@ -2471,10 +2463,7 @@ void MainMenu::showMainMenu()
LCD_PRINT_PGM(MSG_NO_CARD); LCD_PRINT_PGM(MSG_NO_CARD);
} }
} }
#ifdef CARDINSERTED if(CARDINSERTED&&(activeline==line)&&CLICKED)
if(CARDINSERTED)
#endif
if((activeline==line)&&CLICKED)
{ {
card.printingHasFinished(); card.printingHasFinished();
BLOCK; BLOCK;
@ -2487,11 +2476,7 @@ void MainMenu::showMainMenu()
if(force_lcd_update) if(force_lcd_update)
{ {
lcd.setCursor(0,line); lcd.setCursor(0,line);
#ifdef CARDINSERTED
if(CARDINSERTED) if(CARDINSERTED)
#else
if(true)
#endif
{ {
if(card.sdprinting) if(card.sdprinting)
LCD_PRINT_PGM(MSG_PAUSE_PRINT); LCD_PRINT_PGM(MSG_PAUSE_PRINT);
@ -2503,10 +2488,7 @@ void MainMenu::showMainMenu()
//LCD_PRINT_PGM(MSG_NO_CARD); //LCD_PRINT_PGM(MSG_NO_CARD);
} }
} }
#ifdef CARDINSERTED if(CARDINSERTED && (activeline==line) && CLICKED)
if(CARDINSERTED)
#endif
if((activeline==line) && CLICKED)
{ {
if(card.sdprinting) if(card.sdprinting)
{ {
@ -2550,8 +2532,9 @@ void MainMenu::update()
{ {
static MainStatus oldstatus=Main_Menu; //init automatically causes foce_lcd_update=true static MainStatus oldstatus=Main_Menu; //init automatically causes foce_lcd_update=true
static unsigned long timeoutToStatus=0; static unsigned long timeoutToStatus=0;
#if (SDCARDDETECT > -1)
//This code is only relivant if you have an SDcard detect pin.
static bool oldcardstatus=false; static bool oldcardstatus=false;
#ifdef CARDINSERTED
if((CARDINSERTED != oldcardstatus)) if((CARDINSERTED != oldcardstatus))
{ {
force_lcd_update=true; force_lcd_update=true;

Loading…
Cancel
Save