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.
This commit is contained in:
parent
9434db07b2
commit
3658c92270
@ -64,6 +64,12 @@ void pwmout_reset(void) {
|
||||
while (tccs[i]->SYNCBUSY.bit.ENABLE == 1) {
|
||||
}
|
||||
}
|
||||
// TODO(tannewt): Make this depend on the CMSIS.
|
||||
if (i == 0) {
|
||||
tcc_channels[i] = 0xf0;
|
||||
} else {
|
||||
tcc_channels[i] = 0xfc;
|
||||
}
|
||||
tccs[i]->CTRLA.bit.SWRST = 1;
|
||||
}
|
||||
Tc *tcs[TC_INST_NUM] = TC_INSTS;
|
||||
|
Loading…
Reference in New Issue
Block a user