Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit b5385de

Browse files
committed
esp32/machine_pwm: Always set the channel in the PWM object.
1 parent 2305d84 commit b5385de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)