summaryrefslogtreecommitdiff
path: root/shared-bindings/touchio/TouchIn.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-02-28 23:32:24 -0500
committerDan Halbert <halbert@halwitz.org>2020-02-28 23:43:04 -0500
commitb6206406de2a232299ebdd1d187c7656ae79f8f2 (patch)
treea5738ccf40ddd8092a1f2edf9811e4a3b6404968 /shared-bindings/touchio/TouchIn.c
parent29e44721d2d4712de865aa3a3b8fdd5de90c029b (diff)
new pin validation routines; don't use mp_const_none if NULL will do
Diffstat (limited to 'shared-bindings/touchio/TouchIn.c')
-rw-r--r--shared-bindings/touchio/TouchIn.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c
index 33d369c74..5eadb2cc4 100644
--- a/shared-bindings/touchio/TouchIn.c
+++ b/shared-bindings/touchio/TouchIn.c
@@ -66,10 +66,7 @@ STATIC mp_obj_t touchio_touchin_make_new(const mp_obj_type_t *type,
mp_arg_check_num(n_args, kw_args, 1, 1, false);
// 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);
+ const mcu_pin_obj_t *pin = validate_is_free_pin(args[0]);
touchio_touchin_obj_t *self = m_new_obj(touchio_touchin_obj_t);
self->base.type = &touchio_touchin_type;