|
28 | 28 | defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \
|
29 | 29 | defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \
|
30 | 30 | defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2)
|
31 |
| -#include "print_dependencies.h" |
32 | 31 | #include "Wippersnapper_FS.h"
|
| 32 | +#include "print_dependencies.h" |
33 | 33 | // On-board external flash (QSPI or SPI) macros should already
|
34 | 34 | // defined in your board variant if supported
|
35 | 35 | // - EXTERNAL_FLASH_USE_QSPI
|
@@ -92,11 +92,11 @@ bool setVolumeLabel() {
|
92 | 92 | /**************************************************************************/
|
93 | 93 | Wippersnapper_FS::Wippersnapper_FS() {
|
94 | 94 | #if PRINT_DEPENDENCIES
|
95 |
| - WS_DEBUG_PRINTLN("Build Dependencies:"); |
96 |
| - WS_DEBUG_PRINTLN("*********************"); |
97 |
| - WS_DEBUG_PRINTLN(project_dependencies); |
98 |
| - WS_DEBUG_PRINTLN("*********************"); |
99 |
| - WS_PRINTER.flush(); |
| 95 | + WS_DEBUG_PRINTLN("Build Dependencies:"); |
| 96 | + WS_DEBUG_PRINTLN("*********************"); |
| 97 | + WS_DEBUG_PRINTLN(project_dependencies); |
| 98 | + WS_DEBUG_PRINTLN("*********************"); |
| 99 | + WS_PRINTER.flush(); |
100 | 100 | #endif
|
101 | 101 | // Detach USB device during init.
|
102 | 102 | TinyUSBDevice.detach();
|
@@ -291,15 +291,15 @@ bool Wippersnapper_FS::createBootFile() {
|
291 | 291 | bootFile.println(project_dependencies);
|
292 | 292 | #endif
|
293 | 293 |
|
294 |
| - // Print ESP-specific info to boot file |
295 |
| - #ifdef ARDUINO_ARCH_ESP32 |
| 294 | +// Print ESP-specific info to boot file |
| 295 | +#ifdef ARDUINO_ARCH_ESP32 |
296 | 296 | // Get version of ESP-IDF
|
297 | 297 | bootFile.print("ESP-IDF Version: ");
|
298 | 298 | bootFile.println(ESP.getSdkVersion());
|
299 | 299 | // Get version of this core
|
300 | 300 | bootFile.print("ESP32 Core Version: ");
|
301 | 301 | bootFile.println(ESP.getCoreVersion());
|
302 |
| - #endif |
| 302 | +#endif |
303 | 303 |
|
304 | 304 | bootFile.flush();
|
305 | 305 | bootFile.close();
|
@@ -327,19 +327,17 @@ void Wippersnapper_FS::createSecretsFile() {
|
327 | 327 | strcpy(secretsConfig.network.pass, "YOUR_WIFI_PASS_HERE");
|
328 | 328 | secretsConfig.status_pixel_brightness = 0.2;
|
329 | 329 |
|
330 |
| - // Create and fill JSON document from secretsConfig |
| 330 | + // Serialize the struct to a JSON document |
331 | 331 | JsonDocument doc;
|
332 | 332 | doc.set(secretsConfig);
|
333 |
| - |
334 |
| - // Serialize JSON to file |
335 | 333 | serializeJsonPretty(doc, secretsFile);
|
336 |
| - |
337 |
| - // Flush and close file |
338 | 334 | secretsFile.flush();
|
339 | 335 | secretsFile.close();
|
340 |
| - delay(2500); |
341 | 336 |
|
342 |
| - // Signal to user that action must be taken (edit secrets.json) |
| 337 | + // Re-attach the USB device for file access |
| 338 | + delay(500); |
| 339 | + initUSBMSC(); |
| 340 | + |
343 | 341 | writeToBootOut(
|
344 | 342 | "ERROR: Please edit the secrets.json file. Then, reset your board.\n");
|
345 | 343 | #ifdef USE_DISPLAY
|
|
0 commit comments