Skip to content

Commit

Permalink
Feed the watchdog within the busy-wait loop in order to prevent prema…
Browse files Browse the repository at this point in the history
…ture resets by the watchdog.

This change needs at least ArduinoIoTCloud:v1.0.0.
  • Loading branch information
aentinger committed May 21, 2021
1 parent 3ac1a71 commit ae0e109
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/NB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@

#include "NB.h"

__attribute__((weak)) void mkr_nb_feed_watchdog()
{
/* This function can be overwritten by a "strong" implementation
* in a higher level application, such as the ArduinoIoTCloud
* firmware stack.
*/
}

enum {
READY_STATE_SET_ERROR_DISABLED,
READY_STATE_WAIT_SET_ERROR_DISABLED,
Expand Down Expand Up @@ -96,6 +104,8 @@ NB_NetworkStatus_t NB::begin(const char* pin, const char* apn, const char* usern
break;
}

mkr_nb_feed_watchdog();

delay(100);
}
} else {
Expand Down

0 comments on commit ae0e109

Please sign in to comment.