timeout used everywhere where we are waiting for mmu reponse

This commit is contained in:
PavelSindler 2018-07-18 16:25:31 +02:00
parent 0a43b9ce6b
commit b9be718deb
3 changed files with 12 additions and 14 deletions

View file

@ -466,4 +466,5 @@ void gcode_M701();
void proc_commands();
bool mmu_get_reponse();
bool mmu_get_reponse();
void mmu_not_responding();

View file

@ -3368,7 +3368,7 @@ void process_commands()
else if (code_seen("MMURES")) {
fprintf_P(uart2io, PSTR("x0"));
bool response = mmu_get_reponse();
if (!response) printf_P(PSTR("MMU not responding"));
if (!response) mmu_not_responding();
}
else if (code_seen("RESET")) {
// careful!
@ -9148,4 +9148,8 @@ bool mmu_get_reponse() {
return response;
}
void mmu_not_responding() {
printf_P(PSTR("MMU not responding"));
}
#define FIL_LOAD_LENGTH 60

View file

@ -5219,12 +5219,8 @@ void extr_adj(int extruder) //loading filament for SNMM
lcd_print(snmm_extruder + 1);
// get response
uart2_rx_clr();
while (!uart2_rx_ok())
{
//printf_P(PSTR("waiting..\n"));
delay_keep_alive(100);
}
bool reponse = mmu_get_reponse();
if (!response) mmu_not_responding();
lcd_update_enable(true);
@ -5296,12 +5292,9 @@ void extr_unload() { //unloads filament
fprintf_P(uart2io, PSTR("U0\n"));
// get response
uart2_rx_clr();
while (!uart2_rx_ok())
{
//printf_P(PSTR("waiting..\n"));
delay_keep_alive(100);
}
bool reponse = mmu_get_reponse();
if (!response) mmu_not_responding();
lcd_update_enable(true);
#else //SNMM_V2