mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Fix divide by zero error which resulted in way too many LED updates
being sent. This was the root cause of the loop time increase that was seen.
This commit is contained in:
parent
57cfac24ec
commit
0e59bc7b02
1 changed files with 2 additions and 1 deletions
|
@ -509,7 +509,8 @@ void updateLedStrip(void)
|
|||
|
||||
uint8_t rollScale = abs(rcCommand[ROLL]) / 50;
|
||||
uint8_t pitchScale = abs(rcCommand[PITCH]) / 50;
|
||||
nextIndicatorFlashAt = now + (LED_STRIP_5HZ / max(rollScale, pitchScale));
|
||||
uint8_t scale = max(rollScale, pitchScale);
|
||||
nextIndicatorFlashAt = now + (LED_STRIP_5HZ / max(1, scale));
|
||||
|
||||
if (indicatorFlashState == 0) {
|
||||
indicatorFlashState = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue