We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa2ba4d commit 987d9a3Copy full SHA for 987d9a3
shared-bindings/microcontroller/Pin.c
@@ -103,7 +103,10 @@ const mcu_pin_obj_t *validate_obj_is_pin_in(mp_obj_t obj, qstr arg_name) {
103
104
// Validate that the obj is a pin or None. Return an mcu_pin_obj_t* or NULL, correspondingly.
105
const mcu_pin_obj_t *validate_obj_is_pin_or_none(mp_obj_t obj, qstr arg_name) {
106
- return MP_OBJ_TO_PTR(mp_arg_validate_type(obj, &mcu_pin_type, arg_name));
+ if (obj == mp_const_none) {
107
+ return NULL;
108
+ }
109
+ return validate_obj_is_pin(obj, arg_name);
110
}
111
112
const mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj, qstr arg_name) {
0 commit comments