esp32/machine_pwm: Always set the channel in the PWM object.

This commit is contained in:
Damien George 2017-10-26 17:17:08 +11:00
parent f0628f5499
commit a5808e2fca

View File

@ -131,6 +131,7 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
}
channel = avail;
}
self->channel = channel;
// New PWM assignment
self->active = 1;
@ -148,7 +149,6 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
"PWM not supported on pin %d", self->pin));
}
chan_gpio[channel] = self->pin;
self->channel = channel;
}
// Maybe change PWM timer