mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
PICO: Minor dma channel claim update
This commit is contained in:
parent
f11eea69ce
commit
aeda0905c5
1 changed files with 4 additions and 3 deletions
|
@ -93,9 +93,10 @@ void dma_irq1_handler(void)
|
||||||
|
|
||||||
dmaIdentifier_e dmaGetFreeIdentifier(void)
|
dmaIdentifier_e dmaGetFreeIdentifier(void)
|
||||||
{
|
{
|
||||||
const int channel = dma_claim_unused_channel(true);
|
const int channel = dma_claim_unused_channel(false);
|
||||||
if (channel == DMA_INVALID) {
|
// NOTE: dma_claim_unused_channel returns -1 if no channel is available
|
||||||
return DMA_INVALID; // No free channel available
|
if (channel == -1) {
|
||||||
|
return DMA_NONE; // No free channel available
|
||||||
}
|
}
|
||||||
return DMA_CHANNEL_TO_IDENTIFIER(channel);
|
return DMA_CHANNEL_TO_IDENTIFIER(channel);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue