aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George2017-10-26 17:17:08 +1100
committerDamien George2017-12-13 14:48:53 +1100
commita5808e2fca043dcacc2de8563533f71d1a12fb39 (patch)
tree8ea9c56968d12f6c650f718a5521dac3cc1e4dcc
parentf0628f5499774817ccbf34e66b22c56ec8e68a90 (diff)
esp32/machine_pwm: Always set the channel in the PWM object.
-rw-r--r--ports/esp32/machine_pwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/esp32/machine_pwm.c b/ports/esp32/machine_pwm.c
index 489833e7c..4d6c59f0f 100644
--- a/ports/esp32/machine_pwm.c
+++ b/ports/esp32/machine_pwm.c
@@ -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