Skip to content

Allow watchdog kick while waiting for network #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 9, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/ArduinoCellular.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@


#include "ArduinoCellular.h"
#if defined(ARDUINO_ARCH_MBED)
#include "Watchdog.h"
#endif
Comment on lines +4 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is mbed only. This change is related to ArduinoIotCloud integration that enables watchdog for mbed and samd boards but not for the renesas one.


unsigned long ArduinoCellular::getTime() {
int year, month, day, hour, minute, second;
Expand Down Expand Up @@ -214,12 +217,17 @@ bool ArduinoCellular::awaitNetworkRegistration(){
if(this->debugStream != nullptr){
this->debugStream->println("Waiting for network registration...");
}
while (!modem.waitForNetwork()) {
while (!modem.waitForNetwork(20000L)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract this constant into a constexpr

if(this->debugStream != nullptr){
this->debugStream->print(".");
}
#if defined(ARDUINO_ARCH_MBED)
if(mbed::Watchdog::get_instance().is_running()) {
mbed::Watchdog::get_instance().kick();
}
#endif
delay(2000);
}
}
return true;
}

Expand Down
Loading