Skip to content

Commit d8d5e21

Browse files
committed
Fix issue 64 - Avoid WiFi deinit unless we've init.
1 parent ee6352d commit d8d5e21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Firmware/RTK_Surveyor/System.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ void stopWiFi()
138138
#ifdef COMPILE_WIFI
139139
caster.stop();
140140
WiFi.mode(WIFI_OFF);
141-
esp_wifi_deinit(); //Free all resources
141+
142+
if(radioState == WIFI_ON_NOCONNECTION || radioState == WIFI_CONNECTED)
143+
esp_wifi_deinit(); //Free all resources
142144
#endif
143145

144146
Serial.println("WiFi Stopped");

0 commit comments

Comments
 (0)