Skip to content

Commit eda059e

Browse files
committed
fix OFFLINE requirement that is causing msc detach/attach after logging
1 parent 4912417 commit eda059e

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

examples/Wippersnapper_demo_offline_netiface/Wippersnapper_demo_offline_netiface.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "ws_adapters.h"
1313
ws_adapter_wifi wipper;
1414
#define WS_DEBUG // Enable debug output!
15-
#define BUILD_OFFLINE_ONLY
1615

1716
void setup() {
1817
Serial.begin(115200);

examples/Wippersnapper_demo_offline_nonetiface/Wippersnapper_demo_offline_nonetiface.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "ws_adapters.h"
1313
ws_adapter_offline wipper;
1414
#define WS_DEBUG // Enable debug output!
15-
#define BUILD_OFFLINE_ONLY
1615

1716
void setup() {
1817
Serial.begin(115200);

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop
434434
board = adafruit_feather_adalogger
435435
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
436436
board_build.filesystem_size = 0.5m
437-
build_flags = -DUSE_TINYUSB -DBUILD_OFFLINE_ONLY
437+
build_flags = -DUSE_TINYUSB
438438
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
439439
lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library
440440

src/Wippersnapper_V2.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,9 @@ void Wippersnapper_V2::provision() {
9696
if (WsV2._sdCardV2->isSDCardInitialized()) {
9797
return; // SD card initialized, cede control back to loop()
9898
} else {
99-
#ifdef BUILD_OFFLINE_ONLY
10099
haltErrorV2("SD initialization failed.\nDo not reformat the card!\nIs the "
101100
"card correctly inserted?\nIs there a wiring/soldering "
102101
"problem\nIs the config.json file malformed?");
103-
#endif
104102
// SD card not initialized, so just continue with online-mode provisioning
105103
}
106104

src/Wippersnapper_demo.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// Adafruit IO WipperSnapper
1+
// Adafruit IO WipperSnapper - Offline Mode
2+
// USE ONLY WITH DEVICES WITH A NETWORK ADAPTER LIKE ESP32-x
23
//
34
// Adafruit invests time and resources providing this open source code.
45
// Please support Adafruit and open source hardware by purchasing
56
// products from Adafruit!
67
//
7-
// Brent Rubell for Adafruit Industries, 2020-2025
8+
// Brent Rubell for Adafruit Industries, 2025
89
//
910
// All text above must be included in any redistribution.
1011

1112
#include "ws_adapters.h"
12-
ws_adapter_wifi wipper;
13-
13+
ws_adapter_offline wipper;
1414
#define WS_DEBUG // Enable debug output!
1515

1616
void setup() {

src/provisioning/tinyusb/Wippersnapper_FS.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ Wippersnapper_FS::Wippersnapper_FS() {
143143
HaltFilesystem("FATAL ERROR: Could not write filesystem contents!");
144144
}
145145

146-
// Initialize USB-MSC
147-
#ifndef BUILD_OFFLINE_ONLY
148-
InitUsbMsc();
149-
#endif
150-
151146
// If we wrote a fresh secrets.json file, halt until user edits the file and
152147
// RESETs the device Signal to user that action must be taken (edit
153148
// secrets.json)
@@ -683,6 +678,7 @@ void Wippersnapper_FS::WriteFileBoot(PGM_P str) {
683678
/**************************************************************************/
684679
void Wippersnapper_FS::HaltFilesystem(String msg) {
685680
if (!_did_init_msc) {
681+
WS_DEBUG_PRINTLN("HaltFilesystem: InitUsbMsc");
686682
InitUsbMsc();
687683
}
688684
TinyUSBDevice.attach();
@@ -706,6 +702,7 @@ void Wippersnapper_FS::HaltFilesystem(String msg) {
706702
void Wippersnapper_FS::HaltFilesystem(String msg,
707703
ws_led_status_t ledStatusColor) {
708704
if (!_did_init_msc) {
705+
WS_DEBUG_PRINTLN("HaltFilesystem: InitUsbMsc");
709706
InitUsbMsc();
710707
}
711708
TinyUSBDevice.attach();

0 commit comments

Comments
 (0)