mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-15 14:36:00 +08:00
Fix the ESP crash after first flash
seems wifi_set_phy_mode need to be set before anything
This commit is contained in:
parent
511be0e94d
commit
a8fd5e06b6
@ -84,12 +84,21 @@ void setup() {
|
|||||||
if(breset_config)
|
if(breset_config)
|
||||||
{
|
{
|
||||||
//update EEPROM with default settings
|
//update EEPROM with default settings
|
||||||
|
Serial.begin(9600);
|
||||||
|
delay(2000);
|
||||||
|
Serial.println("M117 Reset requested");
|
||||||
CONFIG::reset_config();
|
CONFIG::reset_config();
|
||||||
delay(1000);
|
delay(1000);
|
||||||
//use default baud rate and ports
|
//put some default value to a void some exception at first start
|
||||||
baud_rate=DEFAULT_BAUD_RATE;
|
WiFi.mode(WIFI_AP);
|
||||||
wifi_config.iweb_port=DEFAULT_WEB_PORT;
|
wifi_set_phy_mode(PHY_MODE_11G);
|
||||||
wifi_config.idata_port=DEFAULT_DATA_PORT;
|
Serial.flush();
|
||||||
|
delay(500);
|
||||||
|
Serial.swap();
|
||||||
|
delay(100);
|
||||||
|
//restart once reset config is done
|
||||||
|
ESP.restart();
|
||||||
|
while (1){delay(1);};
|
||||||
}
|
}
|
||||||
//setup serial
|
//setup serial
|
||||||
Serial.begin(baud_rate);
|
Serial.begin(baud_rate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user