Fix led blinking

This commit is contained in:
Yveaux
2015-08-27 11:20:35 +02:00
parent 0bb5e223b2
commit d6cc1b46fc
2 changed files with 3 additions and 4 deletions
+2 -4
View File
@@ -95,14 +95,12 @@ bool MySensor::isValidFirmware() {
#ifdef WITH_LEDS_BLINKING
void MySensor::handleLedsBlinking() {
static unsigned long next_time = hw_millis() + ledBlinkPeriod;
// Just return if it is not the time...
// http://playground.arduino.cc/Code/TimingRollover
if ((long)(hw_millis() - next_time) < 0)
if ((long)(hw_millis() - blink_next_time) < 0)
return;
else
next_time = hw_millis() + ledBlinkPeriod;
blink_next_time = hw_millis() + ledBlinkPeriod;
// do the actual blinking
if(countRx && countRx != 255) {
+1
View File
@@ -361,6 +361,7 @@ class MySensor
unsigned long ledBlinkPeriod;
void handleLedsBlinking(); // do the actual blinking
unsigned long blink_next_time;
#endif
MyTransport& radio;