From a4e0240d69a367443b2438715c04e4953717988f Mon Sep 17 00:00:00 2001 From: Hans Christian Olaussen <41271048+klutvott123@users.noreply.github.com> Date: Tue, 5 Mar 2019 13:10:21 +0100 Subject: [PATCH] Use circular DMA for single colour mode only Use circular DMA for single colour mode only. Use normal DMA for status mode to avoid unpredictable behaviour. --- src/main/drivers/light_ws2811strip_stdperiph.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/drivers/light_ws2811strip_stdperiph.c b/src/main/drivers/light_ws2811strip_stdperiph.c index cde97c1a4..d42471c47 100644 --- a/src/main/drivers/light_ws2811strip_stdperiph.c +++ b/src/main/drivers/light_ws2811strip_stdperiph.c @@ -197,7 +197,12 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag) DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Disable; #endif + +#if defined(USE_WS2811_SINGLE_COLOUR) DMA_InitStructure.DMA_Mode = DMA_Mode_Circular; +#else + DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; +#endif DMA_Init(dmaRef, &DMA_InitStructure); TIM_DMACmd(timer, timerDmaSource(timerHardware->channel), ENABLE);