From df48312ce78016dfb453a94c8e3e37d6e9ca37dd Mon Sep 17 00:00:00 2001 From: jepler Date: Wed, 11 Sep 2019 20:09:38 -0500 Subject: [PATCH] nRF: PWMOut: At deinit, make pin available again Closes: #2146 --- ports/nrf/common-hal/pulseio/PWMOut.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/nrf/common-hal/pulseio/PWMOut.c b/ports/nrf/common-hal/pulseio/PWMOut.c index b827470d3d..6921091f8a 100644 --- a/ports/nrf/common-hal/pulseio/PWMOut.c +++ b/ports/nrf/common-hal/pulseio/PWMOut.c @@ -256,6 +256,9 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) { self->pwm = NULL; pwmout_free_channel(pwm, self->channel); + + reset_pin_number(self->pin_number); + self->pin_number = NO_PIN; } void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty_cycle) {