Merge pull request #2153 from jepler/issue2146-4x

nRF: PWMOut: At deinit, make pin available again
This commit is contained in:
Scott Shawcroft 2019-09-13 19:02:56 -07:00 committed by GitHub
commit c8eee68fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,6 +233,9 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
// Disconnect pin from channel.
pwm->PSEL.OUT[self->channel] = 0xFFFFFFFF;
reset_pin_number(self->pin_number);
self->pin_number = NO_PIN;
for(int i=0; i < CHANNELS_PER_PWM; i++) {
if (self->pwm->PSEL.OUT[i] != 0xFFFFFFFF) {
// Some channel is still being used, so don't disable.