Skip to content

Commit 26c62ab

Browse files
committed
putback main way to attach msc
1 parent 8eea7ec commit 26c62ab

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/Wippersnapper_demo.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void setup() {
3131

3232
Serial.begin(115200);
3333
while (!Serial) delay(10);
34+
3435
Serial.println("Adafruit Wippersnapper API Manager Demo");
3536
Serial.print("Running Wippersnapper API Version: ");
3637
Serial.println(manager.getAPIVersion());

src/provisioning/tinyusb/Wippersnapper_FS_V2.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ Wippersnapper_FS_V2::Wippersnapper_FS_V2() {
129129
fsHalt("FATAL ERROR: Could not write filesystem contents!");
130130
}
131131

132+
// Initialize USB-MSC
133+
initUSBMSC();
134+
132135
// If we wrote a fresh secrets.json file, halt until user edits the file and
133136
// RESETs the device Signal to user that action must be taken (edit
134137
// secrets.json)
@@ -146,8 +149,6 @@ Wippersnapper_FS_V2::Wippersnapper_FS_V2() {
146149
"values\n. Using a text editor, edit it to reflect your Adafruit IO "
147150
"and WiFi credentials. Then, reset the board.");
148151
}
149-
delay(500);
150-
initUSBMSC(); // re-init USB MSC to show new file to user for editing
151152
}
152153

153154
/************************************************************/
@@ -243,11 +244,9 @@ void Wippersnapper_FS_V2::initUSBMSC() {
243244

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

253252
/**************************************************************************/

src/provisioning/tinyusb/Wippersnapper_FS_V2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "fatfs/diskio.h"
2424

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

2827
// forward decl.
2928
class Wippersnapper_V2;

0 commit comments

Comments
 (0)