Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 6 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ upload_port = /dev/cu.usbmodem1201
[env:raspberypi_picow]
extends = common:rp2040

[env:raspberypi_picow_debug_port_only]
extends = common:rp2040
build_flags =
-DUSE_TINYUSB
-DDEBUG_RP2040_PORT=Serial

[env:raspberypi_picow_debug]
extends = common:rp2040
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
Expand Down
8 changes: 7 additions & 1 deletion src/Wippersnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,8 +2748,10 @@ void Wippersnapper::connect() {
// Dump device info to the serial monitor
printDeviceInfo();

// enable global WDT
// enable global WDT
#ifndef ARDUINO_ARCH_RP2040
WS.enableWDT(WS_WDT_TIMEOUT);
Copy link
Member

Choose a reason for hiding this comment

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

Consider moving this guard into the enableWDT() call, so we aren't ifndef''ing each time we call enableWDT()`

#endif

// Generate device identifier
if (!generateDeviceUID()) {
Expand All @@ -2772,7 +2774,11 @@ void Wippersnapper::connect() {
WS_DEBUG_PRINTLN("Running Network FSM...");
// Run the network fsm
runNetFSM();
#ifdef ARDUINO_ARCH_RP2040
WS.enableWDT(WS_WDT_TIMEOUT); // wifi multi doesn't feed the WDT
#else
WS.feedWDT();
#endif

#ifdef USE_DISPLAY
WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud);
Expand Down
7 changes: 6 additions & 1 deletion src/Wippersnapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ typedef enum {
FSM_NET_ESTABLISH_MQTT,
} fsm_net_t;

#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
#ifdef ARDUINO_ARCH_RP2040
#define WS_WDT_TIMEOUT 8388 ///< Pico Max WDT timeout
#else
#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
#endif

#define WS_MAX_ALT_WIFI_NETWORKS 3 ///< Maximum number of alternative networks
/* MQTT Configuration */
#define WS_KEEPALIVE_INTERVAL_MS \
Expand Down
Loading