[bsp/hc32] fix uart dma if gcc optimization level is not none

This commit is contained in:
liuchao 2024-11-09 17:17:20 +08:00 committed by Meco Man
parent d141d148cf
commit 56c9bbe405
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@
* Local pre-processor symbols/macros ('#define') * Local pre-processor symbols/macros ('#define')
******************************************************************************/ ******************************************************************************/
#define DMA_CH_REG(reg_base, ch) \ #define DMA_CH_REG(reg_base, ch) \
(*(uint32_t *)((uint32_t)(&(reg_base)) + ((ch) * 0x40UL))) (*(volatile uint32_t *)((uint32_t)(&(reg_base)) + ((ch) * 0x40UL)))
#define DMA_TRANS_SET_CNT(unit, ch) \ #define DMA_TRANS_SET_CNT(unit, ch) \
(READ_REG32(DMA_CH_REG((unit)->DTCTL0,(ch))) >> DMA_DTCTL_CNT_POS) (READ_REG32(DMA_CH_REG((unit)->DTCTL0,(ch))) >> DMA_DTCTL_CNT_POS)

View File

@ -35,7 +35,7 @@
* Local pre-processor symbols/macros ('#define') * Local pre-processor symbols/macros ('#define')
******************************************************************************/ ******************************************************************************/
#define DMA_CH_REG(reg_base, ch) \ #define DMA_CH_REG(reg_base, ch) \
(*(uint32_t *)((uint32_t)(&(reg_base)) + ((ch) * 0x40UL))) (*(volatile uint32_t *)((uint32_t)(&(reg_base)) + ((ch) * 0x40UL)))
#define DMA_TRANS_SET_CNT(unit, ch) \ #define DMA_TRANS_SET_CNT(unit, ch) \
(READ_REG32(DMA_CH_REG((unit)->DTCTL0,(ch))) >> DMA_DTCTL_CNT_POS) (READ_REG32(DMA_CH_REG((unit)->DTCTL0,(ch))) >> DMA_DTCTL_CNT_POS)