-
Notifications
You must be signed in to change notification settings - Fork 108
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
Watchdog trigger changes #208
base: master
Are you sure you want to change the base?
Conversation
Memory usage change @ 51590db
Click for full report table
Click for full report CSV
|
if ((millis() - start) < 10000) { | ||
WiFi.feedWatchdog(); | ||
} | ||
if (static_cast<int32_t>(trigger_time - millis()) <=0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I see your point. However, can't it be written in a simplified way without needing to cast to int32_t
? Something along the lines of
unsigned long start = millis();
/* ... */
if(feed_watchdog)
{
unsigned long const now = millis();
if(now - start > 10000)
{
WiFi.feedWatchdog();
start = now;
}
}
?
Also feed_watchdog
is there for purpose, only the BearSSL offloaded SSL calls take longe enough to warrant feeding the watchdog outside of update()
.
### Releases v1.8.14-4 1. Fix bugs by using some unmerged PRs from original WiFiNINA, such as: - [WiFi.config - setting defaults as the Ethernet library #219](arduino-libraries/WiFiNINA#219) - [Fix WiFiClient watchdog usage #211](arduino-libraries/WiFiNINA#211) - [Watchdog trigger changes #208](arduino-libraries/WiFiNINA#208) - [added server.accept() #204](arduino-libraries/WiFiNINA#204) - [Fix PinStatus error on some platforms #185](arduino-libraries/WiFiNINA#185) 2. Add many WiFiMulti-related examples in [WiFiMulti](https://github.com/khoih-prog/WiFiNINA_Generic/tree/master/examples/WiFiMulti) 3. Update examples 4. Update `Packages' Patches`
### Releases v1.8.14-4 1. Fix bugs by using some unmerged PRs from original WiFiNINA, such as: - [WiFi.config - setting defaults as the Ethernet library #219](arduino-libraries/WiFiNINA#219) - [Fix WiFiClient watchdog usage #211](arduino-libraries/WiFiNINA#211) - [Watchdog trigger changes #208](arduino-libraries/WiFiNINA#208) - [added server.accept() #204](arduino-libraries/WiFiNINA#204) - [Fix PinStatus error on some platforms #185](arduino-libraries/WiFiNINA#185) 2. Add many WiFiMulti-related examples in [WiFiMulti](https://github.com/khoih-prog/WiFiNINA_Generic/tree/master/examples/WiFiMulti) 3. Update examples 4. Update `Packages' Patches`
### Releases v1.8.14-4 1. Fix bugs by using some unmerged PRs from original WiFiNINA, such as: - [WiFi.config - setting defaults as the Ethernet library #219](arduino-libraries/WiFiNINA#219) - [Fix WiFiClient watchdog usage #211](arduino-libraries/WiFiNINA#211) - [Watchdog trigger changes #208](arduino-libraries/WiFiNINA#208) - [added server.accept() #204](arduino-libraries/WiFiNINA#204) - [Fix PinStatus error on some platforms #185](arduino-libraries/WiFiNINA#185) 2. Add many WiFiMulti-related examples in [WiFiMulti](https://github.com/khoih-prog/WiFiNINA_Generic/tree/master/examples/WiFiMulti) 3. Update examples 4. Update `Packages' Patches`
I'm opening this PR to have a bit of discussion since i'm not 100% sure of the changes:
162049a with the original code the wdog is triggered continously for 10 seconds without delays. Considering a wdog window of 32 seconds i've changed the code in order to kik the wdog each 10 seconds .
a37d350 since the wdog is triggered only if the callback is configured i think we can safely remove the check on
feed_watchdog
and always trigger the wdog if the callback is correctly configured in the library. This change will also extend the wdog trigger to allSpiDrv::waitForSlaveReady()
calls. I have not experienced any drawback doing this, but propably is too much... if we want to drop this change we need to extend the wdog trig at least toServerDrv::getClientState
since i've seen some wdog resets also in this function.51590db I don't have an explanation for this, but i've noticed that without this delay sometimes the board gets stuck in this while loop, maybe is related to the fact
digitalRead
is not a real digital read, but is implemented as spi command...