Skip to content
Snippets Groups Projects
Commit a5808e2f authored by Damien George's avatar Damien George
Browse files

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

parent f0628f54
Branches
No related tags found
No related merge requests found
...@@ -131,6 +131,7 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self, ...@@ -131,6 +131,7 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
} }
channel = avail; channel = avail;
} }
self->channel = channel;
// New PWM assignment // New PWM assignment
self->active = 1; self->active = 1;
...@@ -148,7 +149,6 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self, ...@@ -148,7 +149,6 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
"PWM not supported on pin %d", self->pin)); "PWM not supported on pin %d", self->pin));
} }
chan_gpio[channel] = self->pin; chan_gpio[channel] = self->pin;
self->channel = channel;
} }
// Maybe change PWM timer // Maybe change PWM timer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment