Browse Source

Avoid negative _claims

pull/1569/head
Kevin Le 4 months ago
parent
commit
39fb2902ec
  1. 5
      src/helpers/RefCountedDigitalPin.h

5
src/helpers/RefCountedDigitalPin.h

@ -22,10 +22,11 @@ public:
}
void release() {
if (_claims == 0) return; // avoid negative _claims
_claims--;
if (_claims == 0) {
digitalWrite(_pin, !_active);
} else {
_claims--;
}
}
};

Loading…
Cancel
Save