Skip to content

Commit 063f505

Browse files
committed
Fixed RefCountedDigitalPin.h to release claim correctly. Ensure no negative claims number.
1 parent bbc5f0c commit 063f505

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/helpers/RefCountedDigitalPin.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ class RefCountedDigitalPin {
2020
digitalWrite(_pin, _active);
2121
}
2222
}
23+
2324
void release() {
24-
_claims--;
2525
if (_claims == 0) {
2626
digitalWrite(_pin, !_active);
27+
} else {
28+
_claims--;
2729
}
2830
}
2931
};

0 commit comments

Comments
 (0)