Skip to content

Commit 36503b3

Browse files
committed
pushbutton.py: Fix iss 115.
1 parent 6a616ba commit 36503b3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

v3/docs/DRIVERS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,14 @@ Methods 1 - 4 may be called at any time. If `False` is passed for a callable,
423423
any existing callback will be disabled. If `None` is passed, a bound `Event` is
424424
created. See below for `Event` names.
425425

426-
Class attributes:
426+
Class variables:
427427
1. `debounce_ms` Debounce time in ms. Default 50.
428428
2. `long_press_ms` Threshold time in ms for a long press. Default 1000.
429429
3. `double_click_ms` Threshold time in ms for a double-click. Default 400.
430430

431+
If these variables are changed, it should be done prior to instantiating the
432+
class.
433+
431434
A simple Pyboard demo:
432435
```python
433436
from pyb import LED

v3/primitives/pushbutton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _check(self, state):
7878

7979
def _ddto(self): # Doubleclick timeout: no doubleclick occurred
8080
self._dblpend = False
81-
if self._supp and not self._state:
81+
if self._ff and self._supp and not self._state:
8282
if not self._ld or (self._ld and not self._ld()):
8383
launch(self._ff, self._fa)
8484

0 commit comments

Comments
 (0)