提交 3fea1019 编写于 作者: K Kevin van den Broek 提交者: Me No Dev

Changed update example to use different controlflow structure (#711)

上级 de408d0b
......@@ -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() {
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册