@@ -2734,7 +2734,38 @@ void get_and_print_reset_reason_for_cpu(int cpuCore) {
2734
2734
print_reset_reason (rtc_get_reset_reason (cpuCore));
2735
2735
}
2736
2736
2737
- #endif // ARDUINO_ARCH_ESP32
2737
+ // end of ARDUINO_ARCH_ESP32
2738
+ #elif defined(ARDUINO_ARCH_RP2040)
2739
+
2740
+ void print_reset_reason ()
2741
+ {
2742
+ RP2040::resetReason_t reason = rp2040.getResetReason ();
2743
+ WS_DEBUG_PRINT (" RP2040 RESET REASON: " );
2744
+ switch (reason)
2745
+ {
2746
+ case RP2040::resetReason_t::UNKNOWN_RESET:
2747
+ WS_DEBUG_PRINTLN (" Unknown Reset" );
2748
+ case RP2040::resetReason_t::PWRON_RESET:
2749
+ WS_DEBUG_PRINTLN (" Power-On Reset" );
2750
+ case RP2040::resetReason_t::RUN_PIN_RESET:
2751
+ WS_DEBUG_PRINTLN (" Run Pin Reset" );
2752
+ case RP2040::resetReason_t::SOFT_RESET:
2753
+ WS_DEBUG_PRINTLN (" Soft Reset" );
2754
+ case RP2040::resetReason_t::WDT_RESET:
2755
+ WS_DEBUG_PRINTLN (" Watchdog Timer Reset" );
2756
+ case RP2040::resetReason_t::DEBUG_RESET:
2757
+ WS_DEBUG_PRINTLN (" Debug Reset" );
2758
+ case RP2040::resetReason_t::GLITCH_RESET:
2759
+ WS_DEBUG_PRINTLN (" Glitch Reset" );
2760
+ case RP2040::resetReason_t::BROWNOUT_RESET:
2761
+ WS.brownOutCausedReset = true ;
2762
+ WS_DEBUG_PRINTLN (" Brownout Reset" );
2763
+ default :
2764
+ WS_DEBUG_PRINTLN (" Unknown Reset Reason" );
2765
+ }
2766
+ }
2767
+
2768
+ #endif
2738
2769
2739
2770
/* *************************************************************************/
2740
2771
/* !
@@ -2765,12 +2796,14 @@ void printDeviceInfo() {
2765
2796
get_and_print_reset_reason_for_cpu (0 );
2766
2797
WS_DEBUG_PRINT (" ESP32 CPU1 RESET REASON: " );
2767
2798
get_and_print_reset_reason_for_cpu (1 );
2799
+ #elif defined(ARDUINO_ARCH_RP2040) || defined(PICO_RP2350)
2800
+ print_reset_reason ();
2768
2801
#endif
2769
2802
}
2770
2803
2771
2804
/* *************************************************************************/
2772
2805
/* !
2773
- @brief Connects to Adafruit IO+ Wippersnapper broker.
2806
+ @brief Connects to Adafruit IO Wippersnapper broker.
2774
2807
*/
2775
2808
/* *************************************************************************/
2776
2809
void Wippersnapper::connect () {
0 commit comments