Skip to content

Commit 2475f33

Browse files
committed
RP2040 WDT=8.3secs - enable after wifi connect
1 parent 16bc28a commit 2475f33

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

platformio.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,12 @@ upload_port = /dev/cu.usbmodem1201
471471
[env:raspberypi_picow]
472472
extends = common:rp2040
473473

474+
[env:raspberypi_picow_debug_port_only]
475+
extends = common:rp2040
476+
build_flags =
477+
-DUSE_TINYUSB
478+
-DDEBUG_RP2040_PORT=Serial
479+
474480
[env:raspberypi_picow_debug]
475481
extends = common:rp2040
476482
platform = https://github.com/maxgerhardt/platform-raspberrypi.git

src/Wippersnapper.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2748,8 +2748,10 @@ void Wippersnapper::connect() {
27482748
// Dump device info to the serial monitor
27492749
printDeviceInfo();
27502750

2751-
// enable global WDT
2751+
// enable global WDT
2752+
#ifndef ARDUINO_ARCH_RP2040
27522753
WS.enableWDT(WS_WDT_TIMEOUT);
2754+
#endif
27532755

27542756
// Generate device identifier
27552757
if (!generateDeviceUID()) {
@@ -2772,7 +2774,11 @@ void Wippersnapper::connect() {
27722774
WS_DEBUG_PRINTLN("Running Network FSM...");
27732775
// Run the network fsm
27742776
runNetFSM();
2777+
#ifdef ARDUINO_ARCH_RP2040
2778+
WS.enableWDT(WS_WDT_TIMEOUT); // wifi multi doesn't feed the WDT
2779+
#else
27752780
WS.feedWDT();
2781+
#endif
27762782

27772783
#ifdef USE_DISPLAY
27782784
WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud);

src/Wippersnapper.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,12 @@ typedef enum {
214214
FSM_NET_ESTABLISH_MQTT,
215215
} fsm_net_t;
216216

217-
#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
217+
#ifdef ARDUINO_ARCH_RP2040
218+
#define WS_WDT_TIMEOUT 8388 ///< Pico Max WDT timeout
219+
#else
220+
#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
221+
#endif
222+
218223
#define WS_MAX_ALT_WIFI_NETWORKS 3 ///< Maximum number of alternative networks
219224
/* MQTT Configuration */
220225
#define WS_KEEPALIVE_INTERVAL_MS \

0 commit comments

Comments
 (0)