From 0f9627c73cbac888742672d04bcd29eb465240d6 Mon Sep 17 00:00:00 2001 From: ladyada Date: Thu, 10 Dec 2015 14:46:40 -0500 Subject: [PATCH] only kick watchdog if its enabled --- Adafruit_MQTT_FONA.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Adafruit_MQTT_FONA.h b/Adafruit_MQTT_FONA.h index a65b99d..4a73b0f 100644 --- a/Adafruit_MQTT_FONA.h +++ b/Adafruit_MQTT_FONA.h @@ -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);