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:
Mimoja
2023-06-19 16:43:20 +02:00
committed by Mimoja
parent 9c83d8b5a5
commit 48b2925b9f

View File

@@ -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;