We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de408d0 commit 3fea101Copy full SHA for 3fea101
libraries/Update/examples/SD_Update/SD_Update.ino
@@ -88,25 +88,25 @@ void setup() {
88
89
//first init and check SD card
90
if (!SD_MMC.begin()) {
91
- Serial.println("Card Mount Failed");
92
- goto end;
+ rebootEspWithReason("Card Mount Failed");
93
}
94
95
cardType = SD_MMC.cardType();
96
97
if (cardType == CARD_NONE) {
98
- Serial.println("No SD_MMC card attached");
99
100
- }
101
-
102
- updateFromFS(SD_MMC);
+ rebootEspWithReason("No SD_MMC card attached");
+ }else{
+ updateFromFS(SD_MMC);
+ }
+}
103
104
-end:
105
- delay(1000);
106
- ESP.restart();
+void rebootEspWithReason(String reason){
+ Serial.println(reason);
+ delay(1000);
+ ESP.restart();
107
108
109
//will not be reached
110
void loop() {
111
112
-}
0 commit comments