summaryrefslogtreecommitdiff
path: root/shared-bindings/touchio/TouchIn.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-08-19 23:40:34 -0400
committerDan Halbert <halbert@halwitz.org>2019-08-19 23:40:34 -0400
commitcccbbd956dbc976a4c059f11dfa1410341a51dc1 (patch)
tree3f71018cfe52b99393afe2bb008b2aaf8b5369d6 /shared-bindings/touchio/TouchIn.c
parente2a4c76a3745c512eb85ca5555ec35e5f7d52769 (diff)
Detect lack of pulldown; check for pin in use
Diffstat (limited to 'shared-bindings/touchio/TouchIn.c')
-rw-r--r--shared-bindings/touchio/TouchIn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c
index 78fceef41..33d369c74 100644
--- a/shared-bindings/touchio/TouchIn.c
+++ b/shared-bindings/touchio/TouchIn.c
@@ -68,10 +68,11 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type,
// 1st argument is the pin
mp_obj_t pin_obj = args[0];
assert_pin(pin_obj, false);
+ const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj);
+ assert_pin_free(pin);
touchio_touchin_obj_t *self = m_new_obj(touchio_touchin_obj_t);
self->base.type = &touchio_touchin_type;
- const mcu_pin_obj_t *pin = MP_OBJ_TO_PTR(pin_obj);
common_hal_touchio_touchin_construct(self, pin);
return (mp_obj_t) self;