diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2020-12-08 17:13:00 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2020-12-15 18:12:59 -0800 |
| commit | 1ad49d9a18224ecc53d8f49d0675a369274556ce (patch) | |
| tree | 20cc3ac4f882e18d27ce32a65ba6eb908dd4fab3 /shared-bindings/alarm | |
| parent | f2204d7d88b505155cd25b38b71ae3c35b86d438 (diff) | |
Add alarm.pin that wakes on pin level
Fixes #3787
Diffstat (limited to 'shared-bindings/alarm')
| -rw-r--r-- | shared-bindings/alarm/pin/PinAlarm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shared-bindings/alarm/pin/PinAlarm.c b/shared-bindings/alarm/pin/PinAlarm.c index 7a5617142..83ccc0d76 100644 --- a/shared-bindings/alarm/pin/PinAlarm.c +++ b/shared-bindings/alarm/pin/PinAlarm.c @@ -89,7 +89,11 @@ STATIC mp_obj_t alarm_pin_pin_alarm_make_new(const mp_obj_type_t *type, mp_uint_ //| STATIC mp_obj_t alarm_pin_pin_alarm_obj_get_pin(mp_obj_t self_in) { alarm_pin_pin_alarm_obj_t *self = MP_OBJ_TO_PTR(self_in); - return common_hal_alarm_pin_pin_alarm_get_pin(self); + mcu_pin_obj_t* pin = common_hal_alarm_pin_pin_alarm_get_pin(self); + if (pin == NULL) { + return mp_const_none; + } + return MP_OBJ_FROM_PTR(pin); } MP_DEFINE_CONST_FUN_OBJ_1(alarm_pin_pin_alarm_get_pin_obj, alarm_pin_pin_alarm_obj_get_pin); |
