1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Improve cycle times by avoiding an led strip update while one is still

in progress.
This commit is contained in:
Dominic Clifton 2014-06-08 12:54:52 +01:00
parent b200e2cb2d
commit 0861310537
3 changed files with 16 additions and 1 deletions

View file

@ -149,6 +149,11 @@ void DMA1_Channel6_IRQHandler(void)
}
}
bool isWS2811LedStripReady(void)
{
return !ws2811LedDataTransferInProgress;
}
static uint16_t dmaBufferOffset;
static int16_t ledIndex;
@ -176,7 +181,11 @@ void updateLEDDMABuffer(uint8_t componentValue)
*/
void ws2811UpdateStrip(void)
{
while(ws2811LedDataTransferInProgress); // wait until previous transfer completes
static uint32_t waitCounter = 0;
// wait until previous transfer completes
while(ws2811LedDataTransferInProgress) {
waitCounter++;
}
dmaBufferOffset = 0; // reset buffer memory index
ledIndex = 0; // reset led index