Timer in autoloadmenu - dirty hack (unable to compile under 4.8.1)

This commit is contained in:
Robert Pelnar 2018-04-26 14:50:01 +02:00
parent fc834fc28c
commit f64d266c89

View File

@ -111,7 +111,8 @@ union MenuData
struct AutoLoadFilamentMenu
{
Timer timer;
//Timer timer;
char dummy;
} autoLoadFilamentMenu;
};
@ -2085,12 +2086,13 @@ static void lcd_menu_AutoLoadFilament()
}
else
{
if (!menuData.autoLoadFilamentMenu.timer.running()) menuData.autoLoadFilamentMenu.timer.start();
Timer* ptimer = (Timer*)&(menuData.autoLoadFilamentMenu.dummy);
if (!ptimer->running()) ptimer->start();
lcd.setCursor(0, 0);
lcd_printPGM(MSG_ERROR);
lcd.setCursor(0, 2);
lcd_printPGM(MSG_PREHEAT_NOZZLE);
if (menuData.autoLoadFilamentMenu.timer.expired(2000ul)) menu_action_back();
if (ptimer->expired(2000ul)) menu_action_back();
}
if (lcd_clicked()) menu_action_back();
}