Skip to content

Commit 8b62a09

Browse files
committed
Merge remote-tracking branch 'tyeth/WDT-RP2040-enable-after-wifi-connect' into uat-xmas2024
2 parents bcd502d + 24cf180 commit 8b62a09

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,9 +2748,6 @@ void Wippersnapper::connect() {
27482748
// Dump device info to the serial monitor
27492749
printDeviceInfo();
27502750

2751-
// enable global WDT
2752-
WS.enableWDT(WS_WDT_TIMEOUT);
2753-
27542751
// Generate device identifier
27552752
if (!generateDeviceUID()) {
27562753
haltError("Unable to generate Device UID");
@@ -2772,7 +2769,9 @@ void Wippersnapper::connect() {
27722769
WS_DEBUG_PRINTLN("Running Network FSM...");
27732770
// Run the network fsm
27742771
runNetFSM();
2775-
WS.feedWDT();
2772+
2773+
// Enable WDT after wifi connection as wifiMulti doesnt feed WDT
2774+
WS.enableWDT(WS_WDT_TIMEOUT);
27762775

27772776
#ifdef USE_DISPLAY
27782777
WS._ui_helper->set_load_bar_icon_complete(loadBarIconCloud);

src/Wippersnapper.h

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

217+
#ifdef ARDUINO_ARCH_RP2040
218+
#define WS_WDT_TIMEOUT 8388 ///< RP2040 Max WDT timeout
219+
#else
217220
#define WS_WDT_TIMEOUT 60000 ///< WDT timeout
221+
#endif
222+
223+
#define WS_MAX_ALT_WIFI_NETWORKS 3 ///< Maximum number of alternative networks
218224
/* MQTT Configuration */
219225
#define WS_KEEPALIVE_INTERVAL_MS \
220226
5000 ///< Session keepalive interval time, in milliseconds

0 commit comments

Comments
 (0)