Skip to content

Commit b86cfc1

Browse files
committed
haltErrorV2 reattach MSC by default
1 parent 91c2ee8 commit b86cfc1

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/Wippersnapper_V2.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,13 @@ void Wippersnapper_V2::runNetFSMV2() {
882882
*/
883883
/**************************************************************************/
884884
void Wippersnapper_V2::haltErrorV2(String error, ws_led_status_t ledStatusColor,
885-
bool reboot) {
885+
bool reboot, bool reattach_usb_filesystem) {
886+
#ifdef USE_TINYUSB
887+
if (reattach_usb_filesystem) {
888+
WsV2._fileSystemV2->InitUsbMsc();
889+
delay(1500);
890+
}
891+
#endif
886892
WS_DEBUG_PRINT("ERROR ");
887893
if (reboot) {
888894
WS_DEBUG_PRINT("[RESET]: ");

src/Wippersnapper_V2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class Wippersnapper_V2 {
217217
// Error handling helpers
218218
void haltErrorV2(String error,
219219
ws_led_status_t ledStatusColor = WS_LED_STATUS_ERROR_RUNTIME,
220-
bool reboot = true);
220+
bool reboot = true, bool reattach_usb_filesystem = true);
221221
void errorWriteHangV2(String error);
222222

223223
bool _is_offline_mode; ///< Global flag for if the device is in offline mode

src/ws_adapters.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ typedef ws_wifi_ninafw ws_adapter_wifi;
5656
defined(ARDUINO_RASPBERRY_PI_PICO) || \
5757
defined(ARDUINO_ADAFRUIT_FEATHER_RP2040_ADALOGGER) || \
5858
defined(ARDUINO_ADAFRUIT_METRO_RP2350)
59-
#define SD_CS_PIN 23
59+
#define SD_CS_PIN 23 // TODO: fix this as is ignored by picow and results in 33
60+
// see https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/issues/747
6061
#include "adapters/offline/ws_offline_pico.h"
6162
typedef ws_offline_pico ws_adapter_offline;
6263
#else

0 commit comments

Comments
 (0)