Skip to content

Fix if defined preprocessor directive for watchdog handling #263

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 1 commit into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
* call to ArduinoIoTCloudTCP::update() it is wise to
* set a rather large timeout at first.
*/
#if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
if (enable_watchdog) {
watchdog_enable();
#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC
Expand All @@ -300,7 +300,7 @@ void ArduinoIoTCloudTCP::update()
/* Feed the watchdog. If any of the functions called below
* get stuck than we can at least reset and recover.
*/
#if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
watchdog_reset();
#endif

Expand All @@ -322,7 +322,7 @@ void ArduinoIoTCloudTCP::update()
* maximum watchdog window is 8389ms; despite this we feed it for all
* supported ARCH to keep code aligned.
*/
#if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
watchdog_reset();
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/utility/watchdog/Watchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void mbed_watchdog_trigger_reset()
}
#endif /* ARDUINO_ARCH_MBED */

#if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
void watchdog_enable()
{
#ifdef ARDUINO_ARCH_SAMD
Expand Down
2 changes: 1 addition & 1 deletion src/utility/watchdog/Watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* FUNCTION DECLARATION
******************************************************************************/

#if defined (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED)
#if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED)
void watchdog_enable();
void watchdog_reset();
#endif /* (ARDUINO_ARCH_SAMD) || (ARDUINO_ARCH_MBED) */
Expand Down