mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-16 10:12:09 +02:00
Merge pull request #242 from airgradienthq/hw-watchdog-feed
Update hardware watchdog reset
This commit is contained in:
@ -206,11 +206,7 @@ void loop() {
|
|||||||
tvocSchedule.run();
|
tvocSchedule.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Auto reset watchdog timer if offline mode or postDataToAirGradient */
|
watchdogFeedSchedule.run();
|
||||||
if (configuration.isOfflineMode() ||
|
|
||||||
(configuration.isPostDataToAirGradient() == false)) {
|
|
||||||
watchdogFeedSchedule.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check for handle WiFi reconnect */
|
/** Check for handle WiFi reconnect */
|
||||||
wifiConnector.handle();
|
wifiConnector.handle();
|
||||||
@ -282,9 +278,7 @@ static void initMqtt(void) {
|
|||||||
|
|
||||||
static void wdgFeedUpdate(void) {
|
static void wdgFeedUpdate(void) {
|
||||||
ag.watchdog.reset();
|
ag.watchdog.reset();
|
||||||
Serial.println();
|
Serial.println("External watchdog feed!");
|
||||||
Serial.println("Offline mode or isPostToAirGradient = false: watchdog reset");
|
|
||||||
Serial.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sgp41Init(void) {
|
static bool sgp41Init(void) {
|
||||||
@ -549,13 +543,11 @@ static void sendDataToServer(void) {
|
|||||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||||
&ag, &configuration);
|
&ag, &configuration);
|
||||||
if (apiClient.postToServer(syncData)) {
|
if (apiClient.postToServer(syncData)) {
|
||||||
ag.watchdog.reset();
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println(
|
Serial.println(
|
||||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
measurements.bootCount++;
|
measurements.bootCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,11 +204,7 @@ void loop() {
|
|||||||
tvocSchedule.run();
|
tvocSchedule.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Auto reset watchdog timer if offline mode or postDataToAirGradient */
|
watchdogFeedSchedule.run();
|
||||||
if (configuration.isOfflineMode() ||
|
|
||||||
(configuration.isPostDataToAirGradient() == false)) {
|
|
||||||
watchdogFeedSchedule.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check for handle WiFi reconnect */
|
/** Check for handle WiFi reconnect */
|
||||||
wifiConnector.handle();
|
wifiConnector.handle();
|
||||||
@ -339,9 +335,7 @@ static void factoryConfigReset(void) {
|
|||||||
|
|
||||||
static void wdgFeedUpdate(void) {
|
static void wdgFeedUpdate(void) {
|
||||||
ag.watchdog.reset();
|
ag.watchdog.reset();
|
||||||
Serial.println();
|
Serial.println("External watchdog feed!");
|
||||||
Serial.println("Offline mode or isPostToAirGradient = false: watchdog reset");
|
|
||||||
Serial.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sgp41Init(void) {
|
static bool sgp41Init(void) {
|
||||||
@ -601,13 +595,11 @@ static void sendDataToServer(void) {
|
|||||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||||
&ag, &configuration);
|
&ag, &configuration);
|
||||||
if (apiClient.postToServer(syncData)) {
|
if (apiClient.postToServer(syncData)) {
|
||||||
ag.watchdog.reset();
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println(
|
Serial.println(
|
||||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
measurements.bootCount++;
|
measurements.bootCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,11 +231,7 @@ void loop() {
|
|||||||
tvocSchedule.run();
|
tvocSchedule.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Auto reset watchdog timer if offline mode or postDataToAirGradient */
|
watchdogFeedSchedule.run();
|
||||||
if (configuration.isOfflineMode() ||
|
|
||||||
(configuration.isPostDataToAirGradient() == false)) {
|
|
||||||
watchdogFeedSchedule.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check for handle WiFi reconnect */
|
/** Check for handle WiFi reconnect */
|
||||||
wifiConnector.handle();
|
wifiConnector.handle();
|
||||||
@ -362,9 +358,7 @@ static void factoryConfigReset(void) {
|
|||||||
|
|
||||||
static void wdgFeedUpdate(void) {
|
static void wdgFeedUpdate(void) {
|
||||||
ag.watchdog.reset();
|
ag.watchdog.reset();
|
||||||
Serial.println();
|
Serial.println("External watchdog feed!");
|
||||||
Serial.println("Offline mode or isPostToAirGradient = false: watchdog reset");
|
|
||||||
Serial.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sgp41Init(void) {
|
static bool sgp41Init(void) {
|
||||||
@ -642,13 +636,11 @@ static void sendDataToServer(void) {
|
|||||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||||
&ag, &configuration);
|
&ag, &configuration);
|
||||||
if (apiClient.postToServer(syncData)) {
|
if (apiClient.postToServer(syncData)) {
|
||||||
ag.watchdog.reset();
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println(
|
Serial.println(
|
||||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
measurements.bootCount++;
|
measurements.bootCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,11 +296,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Auto reset watchdog timer if offline mode or postDataToAirGradient */
|
watchdogFeedSchedule.run();
|
||||||
if (configuration.isOfflineMode() ||
|
|
||||||
(configuration.isPostDataToAirGradient() == false)) {
|
|
||||||
watchdogFeedSchedule.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Check for handle WiFi reconnect */
|
/** Check for handle WiFi reconnect */
|
||||||
wifiConnector.handle();
|
wifiConnector.handle();
|
||||||
@ -464,9 +460,7 @@ static void factoryConfigReset(void) {
|
|||||||
|
|
||||||
static void wdgFeedUpdate(void) {
|
static void wdgFeedUpdate(void) {
|
||||||
ag->watchdog.reset();
|
ag->watchdog.reset();
|
||||||
Serial.println();
|
Serial.println("External watchdog feed!");
|
||||||
Serial.println("Offline mode or isPostToAirGradient = false: watchdog reset");
|
|
||||||
Serial.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ledBarEnabledUpdate(void) {
|
static void ledBarEnabledUpdate(void) {
|
||||||
@ -1229,13 +1223,11 @@ static void sendDataToServer(void) {
|
|||||||
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
String syncData = measurements.toString(false, fwMode, wifiConnector.RSSI(),
|
||||||
ag, &configuration);
|
ag, &configuration);
|
||||||
if (apiClient.postToServer(syncData)) {
|
if (apiClient.postToServer(syncData)) {
|
||||||
ag->watchdog.reset();
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.println(
|
Serial.println(
|
||||||
"Online mode and isPostToAirGradient = true: watchdog reset");
|
"Online mode and isPostToAirGradient = true: watchdog reset");
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
measurements.bootCount++;
|
measurements.bootCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user