mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-12-08 20:39:01 +00:00
Fix #229
Make sure bounce is always integer when passed to RPi.GPIO and RPIO, and added some checks to make sure a negative bounce isn't specified either
This commit is contained in:
@@ -14,6 +14,7 @@ from ..exc import (
|
||||
PinSetInput,
|
||||
PinFixedPull,
|
||||
PinInvalidPull,
|
||||
PinInvalidBounce,
|
||||
)
|
||||
|
||||
|
||||
@@ -216,6 +217,8 @@ class PiGPIOPin(Pin):
|
||||
def _set_bounce(self, value):
|
||||
if value is None:
|
||||
value = 0
|
||||
elif value < 0:
|
||||
raise PinInvalidBounce('bounce must be 0 or greater')
|
||||
self._connection.set_glitch_filter(self._number, int(value * 1000000))
|
||||
|
||||
def _get_edges(self):
|
||||
|
||||
Reference in New Issue
Block a user