Changed update example to use different controlflow structure (#711)
This commit is contained in:
parent
de408d0b59
commit
3fea101944
@ -88,25 +88,25 @@ void setup() {
|
||||
|
||||
//first init and check SD card
|
||||
if (!SD_MMC.begin()) {
|
||||
Serial.println("Card Mount Failed");
|
||||
goto end;
|
||||
rebootEspWithReason("Card Mount Failed");
|
||||
}
|
||||
|
||||
cardType = SD_MMC.cardType();
|
||||
|
||||
if (cardType == CARD_NONE) {
|
||||
Serial.println("No SD_MMC card attached");
|
||||
goto end;
|
||||
}
|
||||
rebootEspWithReason("No SD_MMC card attached");
|
||||
}else{
|
||||
updateFromFS(SD_MMC);
|
||||
}
|
||||
}
|
||||
|
||||
updateFromFS(SD_MMC);
|
||||
|
||||
end:
|
||||
delay(1000);
|
||||
ESP.restart();
|
||||
void rebootEspWithReason(String reason){
|
||||
Serial.println(reason);
|
||||
delay(1000);
|
||||
ESP.restart();
|
||||
}
|
||||
|
||||
//will not be reached
|
||||
void loop() {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user