Parcourir la source

Fix DMAChannel issues on Teensy-LC

main
PaulStoffregen il y a 9 ans
Parent
révision
6bcc1c73c1
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. +5
    -3
      teensy3/DMAChannel.h

+ 5
- 3
teensy3/DMAChannel.h Voir le fichier

@@ -777,9 +777,9 @@ public:
if (len == 4) {
CFG->DCR = dcr | DMA_DCR_DSIZE(0) | DMA_DCR_DSIZE(0);
} else if (len == 2) {
CFG->DCR = dcr | DMA_DCR_DSIZE(0) | DMA_DCR_DSIZE(0);
CFG->DCR = dcr | DMA_DCR_DSIZE(2) | DMA_DCR_DSIZE(2);
} else {
CFG->DCR = dcr | DMA_DCR_DSIZE(0) | DMA_DCR_DSIZE(0);
CFG->DCR = dcr | DMA_DCR_DSIZE(1) | DMA_DCR_DSIZE(1);
}
}

@@ -927,10 +927,10 @@ public:
// Use a hardware trigger to make the DMA channel run
void triggerAtHardwareEvent(uint8_t source) {
volatile uint8_t *mux;
CFG->DCR |= DMA_DCR_CS;
mux = (volatile uint8_t *)&(DMAMUX0_CHCFG0) + channel;
*mux = 0;
*mux = (source & 63) | DMAMUX_ENABLE;
CFG->DCR |= (DMA_DCR_ERQ | DMA_DCR_CS);
}

// Use another DMA channel as the trigger, causing this
@@ -1013,8 +1013,10 @@ public:
/***************************************/

void enable(void) {
CFG->DCR |= DMA_DCR_ERQ;
}
void disable(void) {
CFG->DCR &= ~DMA_DCR_ERQ;
}

/***************************************/

Chargement…
Annuler
Enregistrer