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