Skip to content

Commit be738f2

Browse files
committed
only call wifi_set_opmode when really needed
1 parent 2aab78a commit be738f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ ESP8266WiFiClass::ESP8266WiFiClass()
4545

4646
void ESP8266WiFiClass::mode(WiFiMode m)
4747
{
48+
if(wifi_get_opmode() == (uint8)m) {
49+
return;
50+
}
4851
ETS_UART_INTR_DISABLE();
4952
wifi_set_opmode(m);
5053
ETS_UART_INTR_ENABLE();

0 commit comments

Comments
 (0)