mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-12 19:10:32 +03:00
Register allocated DMA channels for dma show (#14496)
This commit is contained in:
parent
c390aba083
commit
3dc130c4aa
2 changed files with 9 additions and 2 deletions
|
@ -302,7 +302,6 @@ void spiInitBusDMA(void)
|
||||||
// no more available channels so give up
|
// no more available channels so give up
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_rx = dma_claim_unused_channel(true);
|
channel_rx = dma_claim_unused_channel(true);
|
||||||
if (channel_rx == -1) {
|
if (channel_rx == -1) {
|
||||||
// no more available channels so give up, first releasing the one
|
// no more available channels so give up, first releasing the one
|
||||||
|
@ -311,6 +310,14 @@ void spiInitBusDMA(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!dmaAllocate(DMA_CHANNEL_TO_IDENTIFIER(channel_tx), OWNER_SPI_SDO, device + 1) ||
|
||||||
|
!dmaAllocate(DMA_CHANNEL_TO_IDENTIFIER(channel_rx), OWNER_SPI_SDI, device + 1)) {
|
||||||
|
// This should never happen if all allocated channels are claimed
|
||||||
|
dma_channel_unclaim(channel_tx);
|
||||||
|
dma_channel_unclaim(channel_rx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bus->dmaTx = &dmaDescriptors[DMA_CHANNEL_TO_INDEX(channel_tx)];
|
bus->dmaTx = &dmaDescriptors[DMA_CHANNEL_TO_INDEX(channel_tx)];
|
||||||
bus->dmaTx->channel = channel_tx;
|
bus->dmaTx->channel = channel_tx;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define PLATFORM_NO_LIBC 0
|
#define PLATFORM_NO_LIBC 0
|
||||||
#define DEFIO_PORT_PINS 64
|
#define DEFIO_PORT_PINS 64
|
||||||
|
|
||||||
#if defined(RP2350A) || defined(RP2350B)
|
#ifdef RP2350
|
||||||
|
|
||||||
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
|
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue