Fix ESP32 restart hang when USE_EMERGENCY_RESET is enabled

This commit is contained in:
Theo Arends 2021-10-02 14:04:32 +02:00
parent 789c3acf38
commit 21c0200bd7

View File

@ -303,6 +303,11 @@ void EmergencyReset(void) {
}
}
while (Serial.available()) { Serial.read(); } // Flush input buffer
#ifdef ESP32
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
Serial.end();
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
#endif // ESP32
}
#endif // USE_EMERGENCY_RESET