DMAChannel is broken on Teensy LC

Thought I would mention, I put in a second fix to dmaChannel.h which fixed another problem with it.
https://github.com/PaulStoffregen/cores/pull/242

In particular if you called transferCount with the counts: 6, 512, 6
The first call will set the iterations counters to 6
Second to 512
Third to 518

It is because it was assuming that if < 512 you were using the ELINK version which only has 9 bit length and above it (IF elink is set) was the channel number to link to.

Well when you call it with 512, it assumes 15 bit format, and so the it stores the 0x200 (512)
When you then call it with 6, it assumes that the 0x200 bit of previous call is channel and as such just updates the 0x1ff bits of the field...
 
Back
Top