Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df48312

Browse files
committed
nRF: PWMOut: At deinit, make pin available again
Closes: adafruit#2146
1 parent 89fed70 commit df48312

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ports/nrf/common-hal/pulseio/PWMOut.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
256256
self->pwm = NULL;
257257

258258
pwmout_free_channel(pwm, self->channel);
259+
260+
reset_pin_number(self->pin_number);
261+
self->pin_number = NO_PIN;
259262
}
260263

261264
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty_cycle) {

0 commit comments

Comments
 (0)