tidy up
This commit is contained in:
parent
1db1934b98
commit
99a0fcdbbd
|
@ -349,13 +349,13 @@ namespace ratgdo {
|
||||||
// check to see if we got between 3 and 8 low pulses on the line
|
// check to see if we got between 3 and 8 low pulses on the line
|
||||||
if (this->store_.obstructionLowCount >= 3 && this->store_.obstructionLowCount <= 8) {
|
if (this->store_.obstructionLowCount >= 3 && this->store_.obstructionLowCount <= 8) {
|
||||||
// obstructionCleared();
|
// 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
|
// if there have been no pulses the line is steady high or low
|
||||||
} else if (this->store_.obstructionLowCount == 0) {
|
} 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 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) {
|
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();
|
// obstructionDetected();
|
||||||
} else {
|
} else {
|
||||||
// asleep
|
// asleep
|
||||||
|
|
Loading…
Reference in New Issue