8000 Merge pull request #1641 from dhalbert/pwmout-var-freq-bug · rhwlo/circuitpython@b4601a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4601a3

Browse files
authored
Merge pull request adafruit#1641 from dhalbert/pwmout-var-freq-bug
wrong arg type for PWMOut variable_frequency
2 parents 2169a62 + 97140e6 commit b4601a3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ports/atmel-samd/common-hal/pulseio/PWMOut.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ void pwmout_reset(void) {
102102
}
103103
tcc_channels[i] = mask;
104104
tccs[i]->CTRLA.bit.SWRST = 1;
105+
while (tccs[i]->CTRLA.bit.SWRST == 1) {
106+
}
105107
}
106108
Tc *tcs[TC_INST_NUM] = TC_INSTS;
107109
for (int i = 0; i < TC_INST_NUM; i++) {

shared-bindings/pulseio/PWMOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ STATIC mp_obj_t pulseio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args
103103

104104
uint16_t duty_cycle = parsed_args[ARG_duty_cycle].u_int;
105105
uint32_t frequency = parsed_args[ARG_frequency].u_int;
106-
bool variable_frequency = parsed_args[ARG_variable_frequency].u_int;
106+
bool variable_frequency = parsed_args[ARG_variable_frequency].u_bool;
107107

108108
// create PWM object from the given pin
109109
pulseio_pwmout_obj_t *self = m_new_obj(pulseio_pwmout_obj_t);

0 commit comments

Comments
 (0)
0