A previous fix improved the duty_cycle channel value computation by
removing the reliance on the PER register which gave old values. It
saved the period on the object but failed to set anything for reused
timers. So, this breaks it out into a separate array that can be
shared across all object regardless of whether it used a new or
existing timer.
This fixes a hard lock that happens when using a second channel on an
in use TCC. The lock occurred when setting the duty cycle on the channel
because the hw address was not available to ASF.
Thanks to @ladyada for finding the bug.
rather than 24bit. Setting the period for more than a 16bit number
caused the TCC to be in a weird state where resetting it would hard
crash.
Fixes#153
* Track status pin use by user code separately so it can take over the pins and then give them back.
* Switch to hardware SPI for APA102 on Gemma and Trinket.
* Merge microcontroller/types.h into microcontroller/Pin.h to better match approach going forwards.
This was done to allow greatly granularity when deciding what functionality
is built into each board's build. For example, this way pulseio can be
omitted to allow for something else such as touchio.