Skip to content

Commit aa84d61

Browse files
committed
States: Turn off WiFi before entering STATE_KEYS_WIFI_TIMEOUT
1 parent abbaa41 commit aa84d61

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Firmware/RTK_Surveyor/States.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,8 @@ void updateSystemState()
820820
changeState(STATE_KEYS_WIFI_CONNECTED);
821821
else
822822
{
823+
wifiShutdown(); // Turn off WiFi
824+
823825
wifiMaxConnectionAttempts =
824826
wifiOriginalMaxConnectionAttempts; // Override setting to 2 attemps during keys
825827
changeState(STATE_KEYS_WIFI_TIMEOUT);
@@ -914,9 +916,6 @@ void updateSystemState()
914916
// No WiFi. No RTC. We don't know if the keys we have are expired. Attempt to use them.
915917
changeState(STATE_KEYS_LBAND_CONFIGURE);
916918
}
917-
918-
// Turn off WiFi
919-
wifiShutdown();
920919
}
921920
break;
922921

@@ -933,7 +932,10 @@ void updateSystemState()
933932
if (wifiIsConnected())
934933
changeState(STATE_KEYS_PROVISION_WIFI_CONNECTED);
935934
else
935+
{
936+
wifiShutdown(); // Turn off WiFi
936937
changeState(STATE_KEYS_WIFI_TIMEOUT);
938+
}
937939
}
938940
break;
939941

0 commit comments

Comments
 (0)