File tree 1 file changed +11
-11
lines changed
libraries/Update/examples/SD_Update
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -88,25 +88,25 @@ void setup() {
88
88
89
89
// first init and check SD card
90
90
if (!SD_MMC.begin ()) {
91
- Serial.println (" Card Mount Failed" );
92
- goto end;
91
+ rebootEspWithReason (" Card Mount Failed" );
93
92
}
94
93
95
94
cardType = SD_MMC.cardType ();
96
95
97
96
if (cardType == CARD_NONE) {
98
- Serial. println (" No SD_MMC card attached" );
99
- goto end;
100
- }
101
-
102
- updateFromFS (SD_MMC);
97
+ rebootEspWithReason (" No SD_MMC card attached" );
98
+ } else {
99
+ updateFromFS (SD_MMC);
100
+ }
101
+ }
103
102
104
- end:
105
- delay (1000 );
106
- ESP.restart ();
103
+ void rebootEspWithReason (String reason){
104
+ Serial.println (reason);
105
+ delay (1000 );
106
+ ESP.restart ();
107
107
}
108
108
109
109
// will not be reached
110
110
void loop () {
111
111
112
- }
112
+ }
You can’t perform that action at this time.
0 commit comments