diff --git a/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h b/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h index 8caeccdd5..4a252968b 100644 --- a/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h +++ b/os/hal/ports/STM32/LLD/BDMAv1/stm32_bdma.h @@ -121,10 +121,8 @@ STM32_BDMA_CR_MSIZE_MASK) #define STM32_BDMA_CR_PL_MASK BDMA_CCR_PL_Msk #define STM32_BDMA_CR_PL(n) ((n) << 12U) -#if !defined(STM32_ENFORCE_H7_REV_XY) #define STM32_BDMA_CR_DBM BDMA_CCR_DBM #define STM32_BDMA_CR_CM BDMA_CCR_CT -#endif /** @} */ /** @@ -432,6 +430,20 @@ typedef struct { ; \ bdmaStreamDisable(stp); \ } + +/** + * @brief BDMA stream current target. + * @note This function can be invoked in both ISR or thread context. + * @pre The stream must have been allocated using @p bdmaStreamAllocate(). + * @post After use the stream can be released using @p bdmaStreamRelease(). + * + * @param[in] stp pointer to an @p stm32_bdma_stream_t structure + * @return Current memory target index. + * + * @special + */ +#define bdmaStreamGetCurrentTarget(stp) \ + (((stp)->channel->CCR >> BDMA_CCR_CT_Pos) & 1U) /** @} */ /*===========================================================================*/