Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3fea101

Browse filesBrowse files
Kevintjebme-no-dev
authored andcommitted
Changed update example to use different controlflow structure (espressif#711)
1 parent de408d0 commit 3fea101
Copy full SHA for 3fea101

File tree

Expand file treeCollapse file tree

1 file changed

+11
-11
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-11
lines changed

‎libraries/Update/examples/SD_Update/SD_Update.ino

Copy file name to clipboardExpand all lines: libraries/Update/examples/SD_Update/SD_Update.ino
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff 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
110110
void loop() {
111111

112-
}
112+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.