summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-03-12 21:28:30 -0400
committerDan Halbert <halbert@halwitz.org>2019-03-12 21:28:30 -0400
commit97140e6a62770bf60c0cca9967960bbc038e8991 (patch)
treed28f1aebcf547790c95de1e4e78d5082a2ecc0f7
parent2169a624097af380341ef2dabda94780aa6373f0 (diff)
wrong arg type for PWMOut variable_frequency
-rw-r--r--ports/atmel-samd/common-hal/pulseio/PWMOut.c2
-rw-r--r--shared-bindings/pulseio/PWMOut.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c
index dd85e8c02..6dcace21f 100644
--- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c
+++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c
@@ -102,6 +102,8 @@ void pwmout_reset(void) {
}
tcc_channels[i] = mask;
tccs[i]->CTRLA.bit.SWRST = 1;
+ while (tccs[i]->CTRLA.bit.SWRST == 1) {
+ }
}
Tc *tcs[TC_INST_NUM] = TC_INSTS;
for (int i = 0; i < TC_INST_NUM; i++) {
diff --git a/shared-bindings/pulseio/PWMOut.c b/shared-bindings/pulseio/PWMOut.c
index bba5fe883..37939a07a 100644
--- a/shared-bindings/pulseio/PWMOut.c
+++ b/shared-bindings/pulseio/PWMOut.c
@@ -103,7 +103,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args
uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int;
uint32_t frequency = parsed_args[ARG_frequency].u_int;
- bool variable_frequency = parsed_args[ARG_variable_frequency].u_int;
+ bool variable_frequency = parsed_args[ARG_variable_frequency].u_bool;
// create PWM object from the given pin
pulseio_pwmout_obj_t *self = m_new_obj(pulseio_pwmout_obj_t);