1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 11:00:02 +03:00

Register allocated DMA channels for dma show (#14496)

This commit is contained in:
Steve Evans 2025-07-02 17:29:25 +01:00 committed by GitHub
parent c390aba083
commit 3dc130c4aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -302,7 +302,6 @@ void spiInitBusDMA(void)
// no more available channels so give up
return;
}
channel_rx = dma_claim_unused_channel(true);
if (channel_rx == -1) {
// no more available channels so give up, first releasing the one
@ -311,6 +310,14 @@ void spiInitBusDMA(void)
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->channel = channel_tx;

View file

@ -34,7 +34,7 @@
#define PLATFORM_NO_LIBC 0
#define DEFIO_PORT_PINS 64
#if defined(RP2350A) || defined(RP2350B)
#ifdef RP2350
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;