8000 atmel-samd: Reset TCC channel in use array on reset. · sparkfun/circuitpython@3658c92 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3658c92

Browse files
committed
atmel-samd: Reset TCC channel in use array on reset.
This fixes spurious "All timers in use" exceptions. Thanks to @ladyada for finding this issue.
1 parent 9434db0 commit 3658c92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ void pwmout_reset(void) {
6464
while (tccs[i]->SYNCBUSY.bit.ENABLE == 1) {
6565
}
6666
}
67+
// TODO(tannewt): Make this depend on the CMSIS.
68+
if (i == 0) {
69+
tcc_channels[i] = 0xf0;
70+
} else {
71+
tcc_channels[i] = 0xfc;
72+
}
6773
tccs[i]->CTRLA.bit.SWRST = 1;
6874
}
6975
Tc *tcs[TC_INST_NUM] = TC_INSTS;

0 commit comments

Comments
 (0)
0