mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 06:06:23 +01:00
Reset flasher if it shared the pins with the SDCard
If the flasher and the SDCard share pins the ESP will need to be reset to bring VSPI and HSPI back into sane states. Trying to reinit them without a reset will lead to heap corruptions. Better safe than sorry. Signed-off-by: Mimoja <git@mimoja.de>
This commit is contained in:
@@ -748,6 +748,15 @@ void APTask(void* parameter) {
|
||||
#endif
|
||||
Serial.println("Please verify your wiring and try again!");
|
||||
}
|
||||
#ifdef HAS_SDCARD
|
||||
if (SD_CARD_CLK == FLASHER_AP_CLK ||
|
||||
SD_CARD_MISO == FLASHER_AP_MISO ||
|
||||
SD_CARD_MOSI == FLASHER_AP_MOSI) {
|
||||
Serial.println("Reseting in 30 seconds to restore SPI state!\n");
|
||||
flashCountDown(30);
|
||||
ESP.restart();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t attempts = 0;
|
||||
|
||||
Reference in New Issue
Block a user