Skip to content

Commit bf2e43c

Browse files
committed
Report SD CS Pin in event of failure
1 parent 10f0a20 commit bf2e43c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Wippersnapper_V2.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,14 @@ void Wippersnapper_V2::provision() {
9696
if (WsV2._sdCardV2->isSDCardInitialized()) {
9797
return; // SD card initialized, cede control back to loop()
9898
} else {
99+
uint8_t cspin = WsV2.pin_sd_cs;
100+
if (cspin == 255) {
101+
// No CS pin found in config.json, so we've used the default
102+
cspin = SD_CS_PIN;
103+
}
99104
haltErrorV2("SD initialization failed.\nDo not reformat the card!\nIs the "
100105
"card correctly inserted?\nIs there a wiring/soldering "
101-
"problem\nIs the config.json file malformed?");
102-
// SD card not initialized, so just continue with online-mode provisioning
106+
"problem\nIs the config.json file malformed?\nSD CS Pin: " + String(cspin));
103107
}
104108

105109
#ifdef USE_DISPLAY

0 commit comments

Comments
 (0)