Browse Source

Fixed RefCountedDigitalPin.h to release claim correctly. Ensure no negative claims number.

pull/1569/head
Kevin Le 4 months ago
parent
commit
063f5056f2
  1. 4
      src/helpers/RefCountedDigitalPin.h

4
src/helpers/RefCountedDigitalPin.h

@ -20,10 +20,12 @@ public:
digitalWrite(_pin, _active);
}
}
void release() {
_claims--;
if (_claims == 0) {
digitalWrite(_pin, !_active);
} else {
_claims--;
}
}
};

Loading…
Cancel
Save