Skip to content

Commit

Permalink
putback main way to attach msc
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Nov 21, 2024
1 parent 8eea7ec commit 26c62ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Wippersnapper_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void setup() {

Serial.begin(115200);
while (!Serial) delay(10);

Serial.println("Adafruit Wippersnapper API Manager Demo");
Serial.print("Running Wippersnapper API Version: ");
Serial.println(manager.getAPIVersion());
Expand Down
13 changes: 6 additions & 7 deletions src/provisioning/tinyusb/Wippersnapper_FS_V2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ Wippersnapper_FS_V2::Wippersnapper_FS_V2() {
fsHalt("FATAL ERROR: Could not write filesystem contents!");
}

// Initialize USB-MSC
initUSBMSC();

// 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)
Expand All @@ -146,8 +149,6 @@ Wippersnapper_FS_V2::Wippersnapper_FS_V2() {
"values\n. Using a text editor, edit it to reflect your Adafruit IO "
"and WiFi credentials. Then, reset the board.");
}
delay(500);
initUSBMSC(); // re-init USB MSC to show new file to user for editing
}

/************************************************************/
Expand Down Expand Up @@ -243,11 +244,9 @@ void Wippersnapper_FS_V2::initUSBMSC() {

// If already enumerated, additional class driverr begin() e.g msc, hid, midi
// won't take effect until re-enumeration
if (TinyUSBDevice.mounted()) {
TinyUSBDevice.detach();
delay(10);
TinyUSBDevice.attach();
}
// Attach MSC and wait for enumeration
TinyUSBDevice.attach();
delay(500);
}

/**************************************************************************/
Expand Down
1 change: 0 additions & 1 deletion src/provisioning/tinyusb/Wippersnapper_FS_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "fatfs/diskio.h"

#include "Wippersnapper_V2.h"
#define SD_FAT_TYPE 3 // TODO: Remove this and move to sdcard class instead?

// forward decl.
class Wippersnapper_V2;
Expand Down

0 comments on commit 26c62ab

Please sign in to comment.