mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Re-design DMA driver
This commit is contained in:
parent
1c1dff4b12
commit
2d070a3507
16 changed files with 299 additions and 394 deletions
|
@ -80,18 +80,9 @@ void setStripColors(const hsvColor_t *colors)
|
|||
}
|
||||
}
|
||||
|
||||
void ws2811DMAHandler(DMA_Channel_TypeDef *channel) {
|
||||
if (DMA_GetFlagStatus(WS2811_DMA_TC_FLAG)) {
|
||||
ws2811LedDataTransferInProgress = 0;
|
||||
DMA_Cmd(channel, DISABLE);
|
||||
DMA_ClearFlag(WS2811_DMA_TC_FLAG);
|
||||
}
|
||||
}
|
||||
|
||||
void ws2811LedStripInit(void)
|
||||
{
|
||||
memset(&ledStripDMABuffer, 0, WS2811_DMA_BUFFER_SIZE);
|
||||
dmaSetHandler(WS2811_DMA_HANDLER_IDENTIFER, ws2811DMAHandler);
|
||||
ws2811LedStripHardwareInit();
|
||||
ws2811UpdateStrip();
|
||||
}
|
||||
|
@ -173,4 +164,4 @@ void ws2811UpdateStrip(void)
|
|||
ws2811LedStripDMAEnable();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue