Avoid negative _claims

このコミットが含まれているのは:
Kevin Le
2026-02-18 22:32:01 +07:00
コミット 39fb2902ec
+3 -2
ファイルの表示
@@ -22,10 +22,11 @@ public:
} }
void release() { void release() {
if (_claims == 0) return; // avoid negative _claims
_claims--;
if (_claims == 0) { if (_claims == 0) {
digitalWrite(_pin, !_active); digitalWrite(_pin, !_active);
} else {
_claims--;
} }
} }
}; };