timeout when waiting for mmu OK

This commit is contained in:
PavelSindler 2018-07-18 16:17:45 +02:00
parent 6e760ef76d
commit 0a43b9ce6b
4 changed files with 9171 additions and 15 deletions

View file

@ -464,4 +464,6 @@ void gcode_M701();
#define UVLO !(PINE & (1<<4))
void proc_commands();
void proc_commands();
bool mmu_get_reponse();

View file

@ -3364,7 +3364,12 @@ void process_commands()
}
else if (code_seen("thx")) {
no_response = false;
}
}
else if (code_seen("MMURES")) {
fprintf_P(uart2io, PSTR("x0"));
bool response = mmu_get_reponse();
if (!response) printf_P(PSTR("MMU not responding"));
}
else if (code_seen("RESET")) {
// careful!
if (farm_mode) {
@ -7119,18 +7124,7 @@ Sigma_Exit:
fprintf_P(uart2io, PSTR("T0\n"));
break;
}
// get response
uart2_rx_clr();
while (!uart2_rx_ok())
{
//printf_P(PSTR("waiting..\n"));
delay_keep_alive(100);
}
snmm_extruder = tmp_extruder; //filament change is finished
snmm_extruder = tmp_extruder; //filament change is finished
if (*(strchr_pointer + index) == '?') { // for single material usage with mmu
bool saved_e_relative_mode = axis_relative_modes[E_AXIS];
@ -9137,4 +9131,21 @@ static void print_time_remaining_init() {
print_percent_done_silent = PRINT_PERCENT_DONE_INIT;
}
bool mmu_get_reponse() {
bool response = true;
LongTimer mmu_get_reponse_timeout;
uart2_rx_clr();
mmu_get_reponse_timeout.start();
while (!uart2_rx_ok())
{
delay_keep_alive(100);
if (mmu_get_reponse_timeout.expired(30 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes
response = false;
break;
}
}
return response;
}
#define FIL_LOAD_LENGTH 60

File diff suppressed because it is too large Load diff

View file

@ -3070,7 +3070,7 @@ bool lcd_wait_for_pinda(float temp) {
}
lcd_set_custom_characters_arrows();
lcd_update_enable(true);
return(target_temp_reached);
return target_temp_reached;
}
void lcd_wait_for_heater() {