From 5b59f9cb0a620476632df2853de88b2b9a572dd1 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sun, 8 Dec 2013 18:16:58 -0800 Subject: [PATCH] Change GPDMA channel clli member to uint32_t, casting to/from gpdma_lli_t and dealing with the multiple fields was driving me crazy. --- firmware/common/sgpio_dma.c | 4 ++-- firmware/libopencm3 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/common/sgpio_dma.c b/firmware/common/sgpio_dma.c index ec7c02ed..10c655db 100644 --- a/firmware/common/sgpio_dma.c +++ b/firmware/common/sgpio_dma.c @@ -49,7 +49,7 @@ void sgpio_dma_configure_lli( lli[i].csrcaddr = direction_transmit ? memory_address : peripheral_address; lli[i].cdestaddr = direction_transmit ? peripheral_address : memory_address; - lli[i].clli = (gpdma_lli_t*)((uint32_t)&lli[(i + 1) % lli_count] | lli_fetch_master); + lli[i].clli = (lli[i].clli & ~GPDMA_CLLI_LM_MASK) | GPDMA_CLLI_LM(lli_fetch_master); lli[i].ccontrol = GPDMA_CCONTROL_TRANSFERSIZE(transfer_words) | GPDMA_CCONTROL_SBSIZE(0) | @@ -130,7 +130,7 @@ size_t sgpio_dma_current_transfer_index( const gpdma_lli_t* const lli, const size_t lli_count ) { - const gpdma_lli_t* const next_lli = (gpdma_lli_t*)GPDMA_CLLI(dma_channel_sgpio); + const uint32_t next_lli = GPDMA_CLLI(dma_channel_sgpio); for(size_t i=0; i