Avoid calling fsensor_update() one level earlier

Move the common checks between filament sensors out of fsensor_update().

Disable the runout check if a saved state is already present (this check
was missing in the PAT9125 variant) as this is currently not supported.

Note that the CHECK_FSENSOR looks completely redundant besides
e_active().
This commit is contained in:
Yuri D'Elia 2019-12-29 22:08:44 +01:00
parent bd80ee88a0
commit 186f881600
2 changed files with 4 additions and 3 deletions

View File

@ -8606,7 +8606,8 @@ if(0)
#ifdef PAT9125
fsensor_autoload_check_stop();
#endif //PAT9125
fsensor_update();
if (fsensor_enabled && !saved_printing)
fsensor_update();
}
}
}

View File

@ -576,7 +576,7 @@ void fsensor_enque_M600(){
void fsensor_update(void)
{
#ifdef PAT9125
if (fsensor_enabled && fsensor_watch_runout && (fsensor_err_cnt > FSENSOR_ERR_MAX))
if (fsensor_watch_runout && (fsensor_err_cnt > FSENSOR_ERR_MAX))
{
fsensor_stop_and_save_print();
KEEPALIVE_STATE(IN_HANDLER);
@ -621,7 +621,7 @@ void fsensor_update(void)
fsensor_enque_M600();
}
#else //PAT9125
if (CHECK_FSENSOR && fsensor_enabled && ir_sensor_detected)
if (CHECK_FSENSOR && ir_sensor_detected)
{
if(digitalRead(IR_SENSOR_PIN))
{ // IR_SENSOR_PIN ~ H