Skip to content

Commit a5808e2

Browse files
committed
esp32/machine_pwm: Always set the channel in the PWM object.
1 parent f0628f5 commit a5808e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ports/esp32/machine_pwm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
131131
}
132132
channel = avail;
133133
}
134+
self->channel = channel;
134135

135136
// New PWM assignment
136137
self->active = 1;
@@ -148,7 +149,6 @@ STATIC void esp32_pwm_init_helper(esp32_pwm_obj_t *self,
148149
"PWM not supported on pin %d", self->pin));
149150
}
150151
chan_gpio[channel] = self->pin;
151-
self->channel = channel;
152152
}
153153

154154
// Maybe change PWM timer

0 commit comments

Comments
 (0)