set phy_mode after reset

This commit is contained in:
Martin Gergeleit committed 2026-06-08 18:05:40 +02:00
1 parent 1f73415217
commit 03536034e2
4 files changed
+10 -7

No files matched your search

Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -1,3 +1,3 @@
b05bd9ddf02b481b1091d1ad01dd6da6151fdb30 firmware/0x02000.bin
8024f70b10e9af7c791f1070809f87706774f7f1 firmware/0x82000.bin
19e1bc3e4a3df78ed84bc1eb56b1f31b3b0e9936 firmware/0x02000.bin
35f85e1dc3c92445162190563380678077273d26 firmware/0x82000.bin
9bd7d25204d71b3db5f35e0b2def8a6aaa7f765c firmware/0x00000.bin
+8 -5
View File
@@ -2804,11 +2804,14 @@ void ICACHE_FLASH_ATTR console_handle_command(struct espconn *pespconn)
if (strcmp(tokens[1], "phy_mode") == 0)
{
uint16_t mode = atoi(tokens[2]);
bool succ = wifi_set_phy_mode(mode);
if (succ)
config.phy_mode = mode;
os_sprintf(response, "Phy mode setting %s\r\n",
succ ? "successful" : "failed");
if (mode < 1 || mode > 3)
{
os_sprintf_flash(response, "Invalid phy_mode (1=b, 2=g, 3=n)\r\n");
goto command_handled;
}
config.phy_mode = mode;
config_save(&config);
os_sprintf_flash(response, "Phy mode set, reboot to apply\r\n");
goto command_handled;
}
#endif