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:
parent
c593629fca
commit
63847f907a
3 changed files with 4 additions and 4 deletions
|
@ -64,7 +64,7 @@ void dmaMuxEnable(dmaIdentifier_e identifier, uint32_t dmaMuxId);
|
||||||
|
|
||||||
dmaIdentifier_e dmaAllocate(dmaIdentifier_e identifier, resourceOwner_e owner, uint8_t resourceIndex);
|
dmaIdentifier_e dmaAllocate(dmaIdentifier_e identifier, resourceOwner_e owner, uint8_t resourceIndex);
|
||||||
void dmaEnable(dmaIdentifier_e identifier);
|
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);
|
dmaIdentifier_e dmaGetIdentifier(const dmaResource_t* channel);
|
||||||
const resourceOwner_t *dmaGetOwner(dmaIdentifier_e identifier);
|
const resourceOwner_t *dmaGetOwner(dmaIdentifier_e identifier);
|
||||||
|
|
|
@ -356,7 +356,7 @@ void spiInitBusDMA(void)
|
||||||
bus->dmaRx->channel = channel_rx;
|
bus->dmaRx->channel = channel_rx;
|
||||||
|
|
||||||
// The transaction concludes when the data has been received which will be after transmission is complete
|
// 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
|
// We got the required resources, so we can use DMA on this bus
|
||||||
bus->useDMA = true;
|
bus->useDMA = true;
|
||||||
|
|
|
@ -98,7 +98,7 @@ dmaIdentifier_e dmaGetFreeIdentifier(void)
|
||||||
return DMA_CHANNEL_TO_IDENTIFIER(channel);
|
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) {
|
if (identifier < DMA_FIRST_HANDLER || identifier > DMA_LAST_HANDLER) {
|
||||||
return; // Invalid identifier
|
return; // Invalid identifier
|
||||||
|
@ -147,7 +147,7 @@ void dmaSetHandler(dmaIdentifier_e identifier, dmaCallbackHandlerFuncPtr callbac
|
||||||
}
|
}
|
||||||
|
|
||||||
dmaDescriptors[index].irqHandlerCallback = callback;
|
dmaDescriptors[index].irqHandlerCallback = callback;
|
||||||
dmaDescriptors[index].userParam = 0;
|
dmaDescriptors[index].userParam = userParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue