summaryrefslogtreecommitdiff
path: root/chip/stm32/dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/dma.c')
-rw-r--r--chip/stm32/dma.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/chip/stm32/dma.c b/chip/stm32/dma.c
index 031b8566bd..b09213d039 100644
--- a/chip/stm32/dma.c
+++ b/chip/stm32/dma.c
@@ -154,11 +154,14 @@ void dma_start_rx(const struct dma_option *option, unsigned count,
int dma_bytes_done(stm32_dma_chan_t *chan, int orig_count)
{
- if (!(chan->ccr & STM32_DMA_CCR_EN))
- return 0;
return orig_count - chan->cndtr;
}
+bool dma_is_enabled(stm32_dma_chan_t *chan)
+{
+ return (chan->ccr & STM32_DMA_CCR_EN);
+}
+
#ifdef CONFIG_DMA_HELP
void dma_dump(enum dma_channel channel)
{