Skip to content

Commit

Permalink
Merge remote-tracking branch 'tyeth/WDT-RP2040-enable-after-wifi-conn…
Browse files Browse the repository at this point in the history
…ect' into uat-xmas2024
  • Loading branch information
tyeth committed Dec 20, 2024
2 parents bcd502d + 24cf180 commit 8b62a09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
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
7 changes: 3 additions & 4 deletions src/Wippersnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,9 +2748,6 @@ void Wippersnapper::connect() {
// Dump device info to the serial monitor
printDeviceInfo();

// enable global WDT
WS.enableWDT(WS_WDT_TIMEOUT);

// Generate device identifier
if (!generateDeviceUID()) {
haltError("Unable to generate Device UID");
Expand All @@ -2772,7 +2769,9 @@ void Wippersnapper::connect() {
WS_DEBUG_PRINTLN("Running Network FSM...");
// Run the network fsm
runNetFSM();
WS.feedWDT();

// Enable WDT after wifi connection as wifiMulti doesnt feed WDT
WS.enableWDT(WS_WDT_TIMEOUT);

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

#ifdef ARDUINO_ARCH_RP2040
#define WS_WDT_TIMEOUT 8388 ///< RP2040 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 \
5000 ///< Session keepalive interval time, in milliseconds
Expand Down

0 comments on commit 8b62a09

Please sign in to comment.