fix OFFLINE requirement that is causing msc detach/attach after logging
This commit is contained in:
parent
49124174eb
commit
eda059e13b
6 changed files with 7 additions and 14 deletions
|
|
@ -12,7 +12,6 @@
|
|||
#include "ws_adapters.h"
|
||||
ws_adapter_wifi wipper;
|
||||
#define WS_DEBUG // Enable debug output!
|
||||
#define BUILD_OFFLINE_ONLY
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include "ws_adapters.h"
|
||||
ws_adapter_offline wipper;
|
||||
#define WS_DEBUG // Enable debug output!
|
||||
#define BUILD_OFFLINE_ONLY
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop
|
|||
board = adafruit_feather_adalogger
|
||||
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
|
||||
board_build.filesystem_size = 0.5m
|
||||
build_flags = -DUSE_TINYUSB -DBUILD_OFFLINE_ONLY
|
||||
build_flags = -DUSE_TINYUSB
|
||||
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
|
||||
lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library
|
||||
|
||||
|
|
|
|||
|
|
@ -96,11 +96,9 @@ void Wippersnapper_V2::provision() {
|
|||
if (WsV2._sdCardV2->isSDCardInitialized()) {
|
||||
return; // SD card initialized, cede control back to loop()
|
||||
} else {
|
||||
#ifdef BUILD_OFFLINE_ONLY
|
||||
haltErrorV2("SD initialization failed.\nDo not reformat the card!\nIs the "
|
||||
"card correctly inserted?\nIs there a wiring/soldering "
|
||||
"problem\nIs the config.json file malformed?");
|
||||
#endif
|
||||
// SD card not initialized, so just continue with online-mode provisioning
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
// Adafruit IO WipperSnapper
|
||||
// Adafruit IO WipperSnapper - Offline Mode
|
||||
// USE ONLY WITH DEVICES WITH A NETWORK ADAPTER LIKE ESP32-x
|
||||
//
|
||||
// Adafruit invests time and resources providing this open source code.
|
||||
// Please support Adafruit and open source hardware by purchasing
|
||||
// products from Adafruit!
|
||||
//
|
||||
// Brent Rubell for Adafruit Industries, 2020-2025
|
||||
// Brent Rubell for Adafruit Industries, 2025
|
||||
//
|
||||
// All text above must be included in any redistribution.
|
||||
|
||||
#include "ws_adapters.h"
|
||||
ws_adapter_wifi wipper;
|
||||
|
||||
ws_adapter_offline wipper;
|
||||
#define WS_DEBUG // Enable debug output!
|
||||
|
||||
void setup() {
|
||||
|
|
|
|||
|
|
@ -143,11 +143,6 @@ Wippersnapper_FS::Wippersnapper_FS() {
|
|||
HaltFilesystem("FATAL ERROR: Could not write filesystem contents!");
|
||||
}
|
||||
|
||||
// Initialize USB-MSC
|
||||
#ifndef BUILD_OFFLINE_ONLY
|
||||
InitUsbMsc();
|
||||
#endif
|
||||
|
||||
// If we wrote a fresh secrets.json file, halt until user edits the file and
|
||||
// RESETs the device Signal to user that action must be taken (edit
|
||||
// secrets.json)
|
||||
|
|
@ -683,6 +678,7 @@ void Wippersnapper_FS::WriteFileBoot(PGM_P str) {
|
|||
/**************************************************************************/
|
||||
void Wippersnapper_FS::HaltFilesystem(String msg) {
|
||||
if (!_did_init_msc) {
|
||||
WS_DEBUG_PRINTLN("HaltFilesystem: InitUsbMsc");
|
||||
InitUsbMsc();
|
||||
}
|
||||
TinyUSBDevice.attach();
|
||||
|
|
@ -706,6 +702,7 @@ void Wippersnapper_FS::HaltFilesystem(String msg) {
|
|||
void Wippersnapper_FS::HaltFilesystem(String msg,
|
||||
ws_led_status_t ledStatusColor) {
|
||||
if (!_did_init_msc) {
|
||||
WS_DEBUG_PRINTLN("HaltFilesystem: InitUsbMsc");
|
||||
InitUsbMsc();
|
||||
}
|
||||
TinyUSBDevice.attach();
|
||||
|
|
|
|||
Loading…
Reference in a new issue