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

Fix dmaSetHandler, adding userParam arg

This commit is contained in:
Steve Evans 2025-06-29 20:12:27 +01:00
parent c593629fca
commit 63847f907a
3 changed files with 4 additions and 4 deletions

View file

@ -64,7 +64,7 @@ void dmaMuxEnable(dmaIdentifier_e identifier, uint32_t dmaMuxId);
dmaIdentifier_e dmaAllocate(dmaIdentifier_e identifier, resourceOwner_e owner, uint8_t resourceIndex);
void dmaEnable(dmaIdentifier_e identifier);
void dmaSetHandler(dmaIdentifier_e identifier, dmaCallbackHandlerFuncPtr callback, uint32_t priority);
void dmaSetHandler(dmaIdentifier_e identifier, dmaCallbackHandlerFuncPtr callback, uint32_t priority, uint32_t userParam);
dmaIdentifier_e dmaGetIdentifier(const dmaResource_t* channel);
const resourceOwner_t *dmaGetOwner(dmaIdentifier_e identifier);

View file

@ -356,7 +356,7 @@ void spiInitBusDMA(void)
bus->dmaRx->channel = channel_rx;
// The transaction concludes when the data has been received which will be after transmission is complete
dmaSetHandler(DMA_CHANNEL_TO_IDENTIFIER(bus->dmaRx->channel), spiRxIrqHandler, NVIC_PRIO_SPI_DMA);
dmaSetHandler(DMA_CHANNEL_TO_IDENTIFIER(bus->dmaRx->channel), spiRxIrqHandler, NVIC_PRIO_SPI_DMA, 0);
// We got the required resources, so we can use DMA on this bus
bus->useDMA = true;

View file

@ -98,7 +98,7 @@ dmaIdentifier_e dmaGetFreeIdentifier(void)
return DMA_CHANNEL_TO_IDENTIFIER(channel);
}
void dmaSetHandler(dmaIdentifier_e identifier, dmaCallbackHandlerFuncPtr callback, uint32_t priority)
void dmaSetHandler(dmaIdentifier_e identifier, dmaCallbackHandlerFuncPtr callback, uint32_t priority, uint32_t userParam)
{
if (identifier < DMA_FIRST_HANDLER || identifier > DMA_LAST_HANDLER) {
return; // Invalid identifier
@ -147,7 +147,7 @@ void dmaSetHandler(dmaIdentifier_e identifier, dmaCallbackHandlerFuncPtr callbac
}
dmaDescriptors[index].irqHandlerCallback = callback;
dmaDescriptors[index].userParam = 0;
dmaDescriptors[index].userParam = userParam;
}
#endif