8000 nRF: PWMOut: At deinit, make pin available again · adafruit/circuitpython@251c0f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 251c0f5

Browse files
committed
nRF: PWMOut: At deinit, make pin available again
Closes: #2146
1 parent dbab538 commit 251c0f5
8000

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
@@ -233,6 +233,9 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
233233
// Disconnect pin from channel.
234234
pwm->PSEL.OUT[self->channel] = 0xFFFFFFFF;
235235

236+
reset_pin_number(self->pin_number);
237+
self->pin_number = NO_PIN;
238+
236239
for(int i=0; i < CHANNELS_PER_PWM; i++) {
237240
if (self->pwm->PSEL.OUT[i] != 0xFFFFFFFF) {
238241
// Some channel is still being used, so don't disable.

0 commit comments

Comments
 (0)
0