diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 7f14abd..d001a14 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -349,13 +349,13 @@ namespace ratgdo { // check to see if we got between 3 and 8 low pulses on the line if (this->store_.obstructionLowCount >= 3 && this->store_.obstructionLowCount <= 8) { // obstructionCleared(); - this->store_.obstructionState = ObstructionState::OBSTRUCTION_STATE_CLEAR; + this->obstructionState = ObstructionState::OBSTRUCTION_STATE_CLEAR; // if there have been no pulses the line is steady high or low } else if (this->store_.obstructionLowCount == 0) { // if the line is high and the last high pulse was more than 70ms ago, then there is an obstruction present if (this->input_obst_pin_->digital_read() && currentMillis - this->store_.lastObstructionHigh > 70) { - this->store_.obstructionState = ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED; + this->obstructionState = ObstructionState::OBSTRUCTION_STATE_OBSTRUCTED; // obstructionDetected(); } else { // asleep