mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Fixed RefCountedDigitalPin.h to release claim correctly. Ensure no negative claims number.
This commit is contained in:
parent
bbc5f0c11a
commit
063f5056f2
1 changed files with 3 additions and 1 deletions
|
|
@ -20,10 +20,12 @@ public:
|
|||
digitalWrite(_pin, _active);
|
||||
}
|
||||
}
|
||||
|
||||
void release() {
|
||||
_claims--;
|
||||
if (_claims == 0) {
|
||||
digitalWrite(_pin, !_active);
|
||||
} else {
|
||||
_claims--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue