only kick watchdog if its enabled

This commit is contained in:
ladyada 2015-12-10 14:46:40 -05:00
parent a339810b75
commit 0f9627c73c
1 changed files with 4 additions and 0 deletions

View File

@ -50,7 +50,9 @@ class Adafruit_MQTT_FONA : public Adafruit_MQTT {
bool connectServer() {
char server[40];
strncpy_P(server, servername, 40);
#ifdef ADAFRUIT_SLEEPYDOG_H
Watchdog.reset();
#endif
// connect to server
DEBUG_PRINTLN(F("Connecting to TCP"));
@ -116,7 +118,9 @@ class Adafruit_MQTT_FONA : public Adafruit_MQTT {
}
}
#ifdef ADAFRUIT_SLEEPYDOG_H
Watchdog.reset();
#endif
timeout -= MQTT_FONA_INTERAVAILDELAY;
timeout -= MQTT_FONA_QUERYDELAY; // this is how long it takes to query the FONA for avail()
delay(MQTT_FONA_INTERAVAILDELAY);