Fix reinit on error

This commit is contained in:
Alex Voinea 2022-02-25 08:18:10 +01:00 committed by D.R.racer
parent fba6d44f33
commit 90b78616b7
1 changed files with 3 additions and 0 deletions

View File

@ -187,6 +187,9 @@ protected:
class IR_sensor: public Filament_sensor {
public:
void init() {
if (state == State::error) {
deinit(); //deinit first if there was an error.
}
puts_P(PSTR("fsensor::init()"));
SET_INPUT(IR_SENSOR_PIN); //input mode
WRITE(IR_SENSOR_PIN, 1); //pullup