Fix dma_irqn_acknowledge_channel (#977)

Also dma_channel_acknowledge_irq0 and dma_channel_acknowledge_irq1.
Using hw_set_bits acked every channel because INTS0/1 are WC registers.

Fixes #974.
This commit is contained in:
NomiChirps 2022-08-17 12:37:50 -07:00 committed by GitHub
parent 00780f0de9
commit 830e867211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -665,7 +665,7 @@ static inline bool dma_irqn_get_channel_status(uint irq_index, uint channel) {
*/ */
static inline void dma_channel_acknowledge_irq0(uint channel) { static inline void dma_channel_acknowledge_irq0(uint channel) {
check_dma_channel_param(channel); check_dma_channel_param(channel);
hw_set_bits(&dma_hw->ints0, (1u << channel)); dma_hw->ints0 = 1u << channel;
} }
/*! \brief Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_1 /*! \brief Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_1
@ -675,7 +675,7 @@ static inline void dma_channel_acknowledge_irq0(uint channel) {
*/ */
static inline void dma_channel_acknowledge_irq1(uint channel) { static inline void dma_channel_acknowledge_irq1(uint channel) {
check_dma_channel_param(channel); check_dma_channel_param(channel);
hw_set_bits(&dma_hw->ints1, (1u << channel)); dma_hw->ints1 = 1u << channel;
} }
/*! \brief Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_N /*! \brief Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_N
@ -687,7 +687,10 @@ static inline void dma_channel_acknowledge_irq1(uint channel) {
static inline void dma_irqn_acknowledge_channel(uint irq_index, uint channel) { static inline void dma_irqn_acknowledge_channel(uint irq_index, uint channel) {
invalid_params_if(DMA, irq_index > 1); invalid_params_if(DMA, irq_index > 1);
check_dma_channel_param(channel); check_dma_channel_param(channel);
hw_set_bits(irq_index ? &dma_hw->ints1 : &dma_hw->ints0, (1u << channel)); if (irq_index)
dma_hw->ints1 = 1u << channel;
else
dma_hw->ints0 = 1u << channel;
} }
/*! \brief Check if DMA channel is busy /*! \brief Check if DMA channel is busy