Parcourir la source

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().
Yuri D'Elia il y a 4 ans
Parent
commit
186f881600
2 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 2 1
      Firmware/Marlin_main.cpp
  2. 2 2
      Firmware/fsensor.cpp

+ 2 - 1
Firmware/Marlin_main.cpp

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

+ 2 - 2
Firmware/fsensor.cpp

@@ -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