From 702ad02b33efb33d4e8967c002055e306a8b53f0 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 9 Oct 2024 23:00:06 +0200 Subject: [PATCH] cpu/sam0_common/periph_dma: Fix API mismatch Match the signature of the implementation of the dma_prepare() with the declaration to fix: /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/sam0_common/periph/dma.c:172:6: error: conflicting types for 'dma_prepare' due to enum/integer mismatch; have 'void(dma_t, uint8_t, const void *, void *, size_t, uint8_t)' {aka 'void(unsigned int, unsigned char, const void *, void *, unsigned int, unsigned char)'} [-Werror=enum-int-mismatch] 172 | void dma_prepare(dma_t dma, uint8_t width, const void *src, void *dst, | ^~~~~~~~~~~ In file included from /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/samd5x/include/periph_cpu.h:26, from /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/sam0_common/periph/dma.c:21: /home/marian.buschsieweke@ml-pa.loc/Repos/software/RIOT/master/cpu/sam0_common/include/periph_cpu_common.h:1186:6: note: previous declaration of 'dma_prepare' with type void(dma_t, uint8_t, const void *, void *, size_t, dma_incr_t)' {aka 'void(unsigned int, unsigned char, const void *, void *, unsigned int, dma_incr_t)'} 1186 | void dma_prepare(dma_t dma, uint8_t width, const void *src, void *dst, | ^~~~~~~~~~~ --- cpu/sam0_common/periph/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/sam0_common/periph/dma.c b/cpu/sam0_common/periph/dma.c index 31a7c8b659..31f91641ec 100644 --- a/cpu/sam0_common/periph/dma.c +++ b/cpu/sam0_common/periph/dma.c @@ -170,7 +170,7 @@ void dma_setup(dma_t dma, unsigned trigger, uint8_t prio, bool irq) } void dma_prepare(dma_t dma, uint8_t width, const void *src, void *dst, - size_t num, uint8_t incr) + size_t num, dma_incr_t incr) { DEBUG("[DMA]: Prepare %u, num: %u\n", dma, (unsigned)num); DmacDescriptor *descr = &descriptors[dma];