diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2017-08-22 12:41:04 -0700 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2017-08-22 15:41:04 -0400 |
| commit | f570b53d44c90dede8bc71fafc16d2aa7089b409 (patch) | |
| tree | b99a50d711446f8b494a280070251a7f2dd242ac | |
| parent | 45a31b1c2abc4cc6631665833217ea7ef3b9ecbf (diff) | |
shared-bindings: Update DigitalIO.pull docs and validate that third (#188)
state is None and not anything.
Fixes #187
| -rw-r--r-- | shared-bindings/digitalio/DigitalInOut.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index 43a44ff4f..36ac61aef 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -286,7 +286,8 @@ const mp_obj_property_t digitalio_digitalio_drive_mode_obj = { //| .. attribute:: pull //| -//| Get or set the pin pull. +//| Get or set the pin pull. Values may be `digitalio.Pull.UP`, +//| `digitalio.Pull.DOWN` or ``None``. //| //| :raises AttributeError: if the direction is ~`digitalio.Direction.OUTPUT`. //| @@ -317,6 +318,8 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_pull(mp_obj_t self_in, mp_obj_t p pull = PULL_UP; } else if (pull_obj == &digitalio_pull_down_obj) { pull = PULL_DOWN; + } else if (pull_obj != mp_const_none) { + mp_raise_ValueError("Unsupported pull value."); } common_hal_digitalio_digitalinout_set_pull(self, pull); return mp_const_none; |
