From a4483b4fe94a591458e52ea8ac4a8b20a83c7973 Mon Sep 17 00:00:00 2001 From: jflyper Date: Mon, 29 Jul 2019 02:48:00 +0900 Subject: [PATCH] [G4] LED_STRIP support --- src/main/drivers/light_ws2811strip_hal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/light_ws2811strip_hal.c b/src/main/drivers/light_ws2811strip_hal.c index 3a101da08c..72c20f89ac 100644 --- a/src/main/drivers/light_ws2811strip_hal.c +++ b/src/main/drivers/light_ws2811strip_hal.c @@ -111,7 +111,7 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag) __DMA2_CLK_ENABLE(); /* Set the parameters to be configured */ -#ifdef STM32H7 +#if defined(STM32H7) || defined(STM32G4) hdma_tim.Init.Request = dmaChannel; #else hdma_tim.Init.Channel = dmaChannel; @@ -123,10 +123,12 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag) hdma_tim.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; hdma_tim.Init.Mode = DMA_NORMAL; hdma_tim.Init.Priority = DMA_PRIORITY_HIGH; +#if !defined(STM32G4) hdma_tim.Init.FIFOMode = DMA_FIFOMODE_DISABLE; hdma_tim.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; hdma_tim.Init.MemBurst = DMA_MBURST_SINGLE; hdma_tim.Init.PeriphBurst = DMA_PBURST_SINGLE; +#endif /* Set hdma_tim instance */ hdma_tim.Instance = (DMA_ARCH_TYPE *)dmaRef;