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

PICO: Minor dma channel claim update

This commit is contained in:
blckmn 2025-06-26 07:59:44 +10:00
parent f11eea69ce
commit aeda0905c5

View file

@ -93,9 +93,10 @@ void dma_irq1_handler(void)
dmaIdentifier_e dmaGetFreeIdentifier(void)
{
const int channel = dma_claim_unused_channel(true);
if (channel == DMA_INVALID) {
return DMA_INVALID; // No free channel available
const int channel = dma_claim_unused_channel(false);
// NOTE: dma_claim_unused_channel returns -1 if no channel is available
if (channel == -1) {
return DMA_NONE; // No free channel available
}
return DMA_CHANNEL_TO_IDENTIFIER(channel);
}