1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

[G4] LED_STRIP support

This commit is contained in:
jflyper 2019-07-29 02:48:00 +09:00
parent be016dc794
commit a4483b4fe9

View file

@ -111,7 +111,7 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag)
__DMA2_CLK_ENABLE(); __DMA2_CLK_ENABLE();
/* Set the parameters to be configured */ /* Set the parameters to be configured */
#ifdef STM32H7 #if defined(STM32H7) || defined(STM32G4)
hdma_tim.Init.Request = dmaChannel; hdma_tim.Init.Request = dmaChannel;
#else #else
hdma_tim.Init.Channel = dmaChannel; hdma_tim.Init.Channel = dmaChannel;
@ -123,10 +123,12 @@ bool ws2811LedStripHardwareInit(ioTag_t ioTag)
hdma_tim.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; hdma_tim.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_tim.Init.Mode = DMA_NORMAL; hdma_tim.Init.Mode = DMA_NORMAL;
hdma_tim.Init.Priority = DMA_PRIORITY_HIGH; hdma_tim.Init.Priority = DMA_PRIORITY_HIGH;
#if !defined(STM32G4)
hdma_tim.Init.FIFOMode = DMA_FIFOMODE_DISABLE; hdma_tim.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
hdma_tim.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; hdma_tim.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
hdma_tim.Init.MemBurst = DMA_MBURST_SINGLE; hdma_tim.Init.MemBurst = DMA_MBURST_SINGLE;
hdma_tim.Init.PeriphBurst = DMA_PBURST_SINGLE; hdma_tim.Init.PeriphBurst = DMA_PBURST_SINGLE;
#endif
/* Set hdma_tim instance */ /* Set hdma_tim instance */
hdma_tim.Instance = (DMA_ARCH_TYPE *)dmaRef; hdma_tim.Instance = (DMA_ARCH_TYPE *)dmaRef;