Browse Source

Fix DMAChannel transferSize() on Teensy LC

fixes #266
teensy4-core
PaulStoffregen 6 years ago
parent
commit
5fdbe446bc
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      teensy3/DMAChannel.h

+ 3
- 3
teensy3/DMAChannel.h View File

void transferSize(unsigned int len) { void transferSize(unsigned int len) {
uint32_t dcr = CFG->DCR & 0xF0C8FFFF; uint32_t dcr = CFG->DCR & 0xF0C8FFFF;
if (len == 4) { if (len == 4) {
CFG->DCR = dcr | DMA_DCR_DSIZE(0) | DMA_DCR_DSIZE(0);
CFG->DCR = dcr | DMA_DCR_SSIZE(0) | DMA_DCR_DSIZE(0);
} else if (len == 2) { } else if (len == 2) {
CFG->DCR = dcr | DMA_DCR_DSIZE(2) | DMA_DCR_DSIZE(2);
CFG->DCR = dcr | DMA_DCR_SSIZE(2) | DMA_DCR_DSIZE(2);
} else { } else {
CFG->DCR = dcr | DMA_DCR_DSIZE(1) | DMA_DCR_DSIZE(1);
CFG->DCR = dcr | DMA_DCR_SSIZE(1) | DMA_DCR_DSIZE(1);
} }
} }



Loading…
Cancel
Save