Finish LED pattern before low-power sleep

Wait until no LEDs are blinking anymore before going to sleep.
Decrement LED blink counter before acting on the value, otherwise LED
state will always lag behind.
This commit is contained in:
Embedded Innovation
2016-11-08 20:06:53 +01:00
parent 9254b45150
commit 7f0e23b728
3 changed files with 44 additions and 28 deletions
+5
View File
@@ -43,6 +43,11 @@
void ledsBlinkTx(uint8_t cnt);
void ledsBlinkErr(uint8_t cnt);
void ledsProcess(); // do the actual blinking
/**
* Test if any LED is currently blinking.
* @return true when one or more LEDs are blinking, false otherwise.
*/
bool ledsBlinking();
#else
// Remove led functions if feature is disabled