Skip to content

Commit 52c4578

Browse files
committed
PR Feedback + lib_ignore: USBHost
1 parent a21e971 commit 52c4578

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

platformio.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ build_flags = -DUSE_TINYUSB=1
233233
[env:adafruit_pyportal_m4_titano]
234234
extends = common:atsamd
235235
board = adafruit_pyportal_m4_titano
236+
; build_type = debug
237+
; upload_protocol = jlink
238+
; debug_tool = jlink
239+
; monitor_port = jlink
240+
; debug_init_break =
241+
lib_ignore = USBHost
236242
build_flags = -DUSE_TINYUSB=1
237243
-DADAFRUIT_PYPORTAL_M4_TITANO
238244

src/Wippersnapper.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,6 @@ void Wippersnapper::errorWriteHang(String error) {
23062306
WS_DEBUG_PRINTLN(error);
23072307
#ifdef USE_TINYUSB
23082308
_fileSystem->writeToBootOut(error.c_str());
2309-
delay(500);
23102309
TinyUSBDevice.attach();
23112310
delay(500);
23122311
#endif

src/provisioning/littlefs/WipperSnapper_LittleFS.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ WipperSnapper_LittleFS::WipperSnapper_LittleFS() {
3030
if (!LittleFS.begin()) {
3131
setStatusLEDColor(RED);
3232
fsHalt("ERROR: Failure initializing LittleFS!");
33-
while (1)
34-
;
3533
}
3634
}
3735

@@ -94,11 +92,18 @@ void WipperSnapper_LittleFS::parseSecrets() {
9492
LittleFS.end();
9593
}
9694

95+
/**************************************************************************/
96+
/*!
97+
@brief Halts execution and blinks the status LEDs yellow.
98+
@param msg
99+
Error message to print to serial console.
100+
*/
101+
/**************************************************************************/
97102
void WipperSnapper_LittleFS::fsHalt(String msg) {
103+
statusLEDSolid(WS_LED_STATUS_FS_WRITE);
98104
while (1) {
99-
WS_DEBUG_PRINTLN("ERROR: Halted execution!");
105+
WS_DEBUG_PRINTLN("Fatal Error: Halted execution!");
100106
WS_DEBUG_PRINTLN(msg.c_str());
101-
statusLEDSolid(WS_LED_STATUS_FS_WRITE);
102107
delay(1000);
103108
yield();
104109
}

src/provisioning/littlefs/WipperSnapper_LittleFS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class WipperSnapper_LittleFS {
3333
WipperSnapper_LittleFS();
3434
~WipperSnapper_LittleFS();
3535
void parseSecrets();
36-
void fsHalt(String msg = "");
36+
void fsHalt(String msg);
3737
};
3838

3939
extern Wippersnapper WS;

src/provisioning/tinyusb/Wippersnapper_FS.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,14 @@ Wippersnapper_FS::Wippersnapper_FS() {
9898
if (!initFilesystem() && !initFilesystem(true)) {
9999
setStatusLEDColor(RED);
100100
fsHalt("ERROR Initializing Filesystem");
101-
while (1)
102-
;
103101
}
104102

105103
// Initialize USB-MSD
106104
initUSBMSC();
107105

108106
// If we created a new filesystem, halt until user RESETs device.
109107
if (_freshFS)
110-
fsHalt("New filesystem created! Please RESET your board.");
108+
fsHalt("New filesystem created! Press the reset button on your board.");
111109
}
112110

113111
/************************************************************/
@@ -120,6 +118,8 @@ Wippersnapper_FS::~Wippersnapper_FS() {}
120118
/**************************************************************************/
121119
/*!
122120
@brief Initializes the flash filesystem.
121+
@param force_format
122+
If true, forces a new filesystem to be created. [DESTRUCTIVE]
123123
@return True if filesystem initialized correctly, false otherwise.
124124
*/
125125
/**************************************************************************/
@@ -407,11 +407,11 @@ void Wippersnapper_FS::writeToBootOut(PGM_P str) {
407407
/**************************************************************************/
408408
void Wippersnapper_FS::fsHalt(String msg) {
409409
TinyUSBDevice.attach();
410-
delay(1500);
410+
delay(500);
411+
statusLEDSolid(WS_LED_STATUS_FS_WRITE);
411412
while (1) {
412-
WS_DEBUG_PRINTLN("ERROR: Halted execution!");
413+
WS_DEBUG_PRINTLN("Fatal Error: Halted execution!");
413414
WS_DEBUG_PRINTLN(msg.c_str());
414-
// statusLEDSolid(WS_LED_STATUS_FS_WRITE);
415415
delay(1000);
416416
yield();
417417
}

src/provisioning/tinyusb/Wippersnapper_FS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Wippersnapper_FS {
5454
void createSecretsFile();
5555
bool createBootFile();
5656
void writeToBootOut(PGM_P str);
57-
void fsHalt(String msg = "");
57+
void fsHalt(String msg);
5858

5959
void parseSecrets();
6060

0 commit comments

Comments
 (0)