Skip to content

Commit b10b5e1

Browse files
committed
Add watchdog kick while waiting for the network
1 parent 90b3e2a commit b10b5e1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: src/ArduinoCellular.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22

33
#include "ArduinoCellular.h"
4+
#if defined(ARDUINO_ARCH_MBED)
5+
#include "Watchdog.h"
6+
#endif
47

58
unsigned long ArduinoCellular::getTime() {
69
int year, month, day, hour, minute, second;
@@ -218,8 +221,13 @@ bool ArduinoCellular::awaitNetworkRegistration(){
218221
if(this->debugStream != nullptr){
219222
this->debugStream->print(".");
220223
}
224+
#if defined(ARDUINO_ARCH_MBED)
225+
if(mbed::Watchdog::get_instance().is_running()) {
226+
mbed::Watchdog::get_instance().kick();
227+
}
228+
#endif
221229
delay(2000);
222-
}
230+
}
223231
return true;
224232
}
225233

0 commit comments

Comments
 (0)