From 9328d09a7a7a3cddc1ca0c346c781f3cb55203ee Mon Sep 17 00:00:00 2001 From: jun2sak Date: Fri, 26 Feb 2021 00:50:44 +0900 Subject: [PATCH] re-enable parameters check. --- ports/nrf/common-hal/alarm/pin/PinAlarm.c | 7 ++----- ports/nrf/common-hal/alarm/pin/__init__.c | 12 ------------ 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 ports/nrf/common-hal/alarm/pin/__init__.c diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.c b/ports/nrf/common-hal/alarm/pin/PinAlarm.c index bdc268d512..606a7125fa 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.c +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.c @@ -46,15 +46,12 @@ volatile nrfx_gpiote_pin_t _pinhandler_ev_pin; #define MYGPIOTE_EV_PIN_UNDEF 0xFF void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, mcu_pin_obj_t *pin, bool value, bool edge, bool pull) { -#if 0 if (edge) { mp_raise_ValueError(translate("Cannot wake on pin edge. Only level.")); } - - if (pull && !GPIO_IS_VALID_OUTPUT_GPIO(pin->number)) { - mp_raise_ValueError(translate("Cannot pull on input-only pin.")); + if (pin->number >= NUMBER_OF_PINS) { + mp_raise_ValueError(translate("Invalid pin")); } -#endif self->pin = pin; self->value = value; self->pull = pull; diff --git a/ports/nrf/common-hal/alarm/pin/__init__.c b/ports/nrf/common-hal/alarm/pin/__init__.c deleted file mode 100644 index 94778f5eb1..0000000000 --- a/ports/nrf/common-hal/alarm/pin/__init__.c +++ /dev/null @@ -1,12 +0,0 @@ -//#include "shared-bindings/alarm_io/__init__.h" - -// these are in esp32s2 implementation, -// but not used in nrf - -#if 0 -mp_obj_t common_hal_alarm_io_pin_state (alarm_io_obj_t *self_in) { -} - -void common_hal_alarm_io_disable (void) { -} -#endif