Skip to content

Changed update example to use different control flow structure #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions libraries/Update/examples/SD_Update/SD_Update.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

updateFromFS(SD_MMC);
rebootEspWithReason("No SD_MMC card attached");
}else{
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() {

}
}