diff --git a/libraries/MySensors/MySensor.cpp b/libraries/MySensors/MySensor.cpp index f8a49bd..7c2933f 100644 --- a/libraries/MySensors/MySensor.cpp +++ b/libraries/MySensors/MySensor.cpp @@ -472,7 +472,7 @@ void wakeUp() //place to send the interrupts continueTimer = false; } -void MySensor::internalSleep(int ms) { +void MySensor::internalSleep(unsigned long ms) { while (continueTimer && ms >= 8000) { LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); ms -= 8000; } if (continueTimer && ms >= 4000) { LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF); ms -= 4000; } if (continueTimer && ms >= 2000) { LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF); ms -= 2000; } @@ -485,7 +485,7 @@ void MySensor::internalSleep(int ms) { if (continueTimer && ms >= 16) { LowPower.powerDown(SLEEP_15Ms, ADC_OFF, BOD_OFF); ms -= 15; } } -void MySensor::sleep(int ms) { +void MySensor::sleep(unsigned long ms) { // Let serial prints finish (debug, log etc) Serial.flush(); RF24::powerDown(); @@ -493,7 +493,7 @@ void MySensor::sleep(int ms) { internalSleep(ms); } -bool MySensor::sleep(int interrupt, int mode, int ms) { +bool MySensor::sleep(int interrupt, int mode, unsigned long ms) { // Let serial prints finish (debug, log etc) bool pinTriggeredWakeup = true; Serial.flush(); diff --git a/libraries/MySensors/MySensor.h b/libraries/MySensors/MySensor.h index 6e16071..38f16e4 100644 --- a/libraries/MySensors/MySensor.h +++ b/libraries/MySensors/MySensor.h @@ -203,7 +203,7 @@ class MySensor : public RF24 * Sleep (PowerDownMode) the Arduino and radio. Wake up on timer. * @param ms Number of milliseconds to sleep. */ - void sleep(int ms); + void sleep(unsigned long ms); /** * Sleep (PowerDownMode) the Arduino and radio. Wake up on timer or pin change. @@ -214,7 +214,7 @@ class MySensor : public RF24 * @param ms Number of milliseconds to sleep or 0 to sleep forever * @return true if wake up was triggered by pin change and false means timer woke it up. */ - bool sleep(int interrupt, int mode, int ms=0); + bool sleep(int interrupt, int mode, unsigned long ms=0); /** * getInternalTemp @@ -264,7 +264,7 @@ class MySensor : public RF24 uint8_t getChildRoute(uint8_t childId); void addChildRoute(uint8_t childId, uint8_t route); void removeChildRoute(uint8_t childId); - void internalSleep(int ms); + void internalSleep(unsigned long ms); }; #endif