Merge pull request #668 from XPila/MK3-V3_2

Timer in autoloadmenu - dirty hack (unable to compile under 4.8.1)
This commit is contained in:
PavelSindler 2018-04-26 14:53:49 +02:00 committed by GitHub
commit 14cf4abb64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}