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

This commit is contained in:
daid303 2012-11-12 09:16:27 +01:00
parent 57834776ad
commit f4a89ec776

View File

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