mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 13:55:18 +03:00
Fix F4 ledstip
This commit is contained in:
parent
7f8758ddd2
commit
00692145ef
3 changed files with 9 additions and 1 deletions
|
@ -39,7 +39,11 @@
|
||||||
#include "drivers/dma.h"
|
#include "drivers/dma.h"
|
||||||
#include "drivers/light_ws2811strip.h"
|
#include "drivers/light_ws2811strip.h"
|
||||||
|
|
||||||
|
#if defined(STM32F4)
|
||||||
|
uint32_t ledStripDMABuffer[WS2811_DMA_BUFFER_SIZE];
|
||||||
|
#else
|
||||||
uint8_t ledStripDMABuffer[WS2811_DMA_BUFFER_SIZE];
|
uint8_t ledStripDMABuffer[WS2811_DMA_BUFFER_SIZE];
|
||||||
|
#endif
|
||||||
volatile uint8_t ws2811LedDataTransferInProgress = 0;
|
volatile uint8_t ws2811LedDataTransferInProgress = 0;
|
||||||
|
|
||||||
static hsvColor_t ledColorBuffer[WS2811_LED_STRIP_LENGTH];
|
static hsvColor_t ledColorBuffer[WS2811_LED_STRIP_LENGTH];
|
||||||
|
|
|
@ -51,5 +51,9 @@ void setStripColors(const hsvColor_t *colors);
|
||||||
|
|
||||||
bool isWS2811LedStripReady(void);
|
bool isWS2811LedStripReady(void);
|
||||||
|
|
||||||
|
#if defined(STM32F4)
|
||||||
|
extern uint32_t ledStripDMABuffer[WS2811_DMA_BUFFER_SIZE];
|
||||||
|
#else
|
||||||
extern uint8_t ledStripDMABuffer[WS2811_DMA_BUFFER_SIZE];
|
extern uint8_t ledStripDMABuffer[WS2811_DMA_BUFFER_SIZE];
|
||||||
|
#endif
|
||||||
extern volatile uint8_t ws2811LedDataTransferInProgress;
|
extern volatile uint8_t ws2811LedDataTransferInProgress;
|
||||||
|
|
|
@ -50,7 +50,7 @@ static void WS2811_DMA_IRQHandler(dmaChannelDescriptor_t *descriptor)
|
||||||
if (DMA_GET_FLAG_STATUS(descriptor, DMA_IT_TCIF)) {
|
if (DMA_GET_FLAG_STATUS(descriptor, DMA_IT_TCIF)) {
|
||||||
ws2811LedDataTransferInProgress = 0;
|
ws2811LedDataTransferInProgress = 0;
|
||||||
DMA_Cmd(descriptor->stream, DISABLE);
|
DMA_Cmd(descriptor->stream, DISABLE);
|
||||||
TIM_DMACmd(TIM5, TIM_DMA_CC1, DISABLE);
|
TIM_DMACmd(WS2811_TIMER, timDMASource, DISABLE);
|
||||||
DMA_CLEAR_FLAG(descriptor, DMA_IT_TCIF);
|
DMA_CLEAR_FLAG(descriptor, DMA_IT_TCIF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue