mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
[G4][LIB] Fix LL_DMA_{Set,Get}PeriphRequest
Fix bad handling of DMA_TypeDef argument in LL_DMA_{Set,Get}PeriphRequest() inline macro. This bug causes peripheral requests for DMA2 to be set in DMAMUX channels for DMA1. This is fixed in FW library V1.1.0.
This commit is contained in:
parent
53e81732f6
commit
9fea8fc08d
1 changed files with 4 additions and 6 deletions
|
@ -1433,9 +1433,8 @@ __STATIC_INLINE uint32_t LL_DMA_GetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Cha
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_DMA_SetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphRequest)
|
__STATIC_INLINE void LL_DMA_SetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphRequest)
|
||||||
{
|
{
|
||||||
UNUSED(DMAx);
|
uint32_t dmamux_ccr_offset = ((((uint32_t)DMAx ^ (uint32_t)DMA1) >> 10U) * 8U);
|
||||||
MODIFY_REG(((DMAMUX_Channel_TypeDef *)(uint32_t)((uint32_t)DMAMUX1_Channel0 + (DMAMUX_CCR_SIZE * (Channel - 1U))))->CCR,
|
MODIFY_REG((DMAMUX1_Channel0 + Channel - 1 + dmamux_ccr_offset)->CCR, DMAMUX_CxCR_DMAREQ_ID, PeriphRequest);
|
||||||
DMAMUX_CxCR_DMAREQ_ID, PeriphRequest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1578,9 +1577,8 @@ __STATIC_INLINE void LL_DMA_SetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Channel
|
||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_DMA_GetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Channel)
|
__STATIC_INLINE uint32_t LL_DMA_GetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Channel)
|
||||||
{
|
{
|
||||||
UNUSED(DMAx);
|
uint32_t dmamux_ccr_offset = ((((uint32_t)DMAx ^ (uint32_t)DMA1) >> 10U) * 8U);
|
||||||
return (READ_BIT(((DMAMUX_Channel_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_Channel0 + (DMAMUX_CCR_SIZE *
|
return (READ_BIT((DMAMUX1_Channel0 + Channel - 1 + dmamux_ccr_offset)->CCR, DMAMUX_CxCR_DMAREQ_ID));
|
||||||
(Channel - 1U)))))->CCR, DMAMUX_CxCR_DMAREQ_ID));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue