File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
libraries/Update/examples/SD_Update Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -88,25 +88,25 @@ void setup() {
8888
8989 // first init and check SD card
9090 if (!SD_MMC.begin ()) {
91- Serial.println (" Card Mount Failed" );
92- goto end;
91+ rebootEspWithReason (" Card Mount Failed" );
9392 }
9493
9594 cardType = SD_MMC.cardType ();
9695
9796 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+ }
103102
104- end:
105- delay (1000 );
106- ESP.restart ();
103+ void rebootEspWithReason (String reason){
104+ Serial.println (reason);
105+ delay (1000 );
106+ ESP.restart ();
107107}
108108
109109// will not be reached
110110void loop () {
111111
112- }
112+ }
You can’t perform that action at this time.
0 commit comments