Skip to content

Commit c1bcc43

Browse files
authored
Merge pull request #412 from sparkfun/Fix_flaw_in_wifiConnect
Only exit wifiConnect early when connected && AP_STA mode is not needed
2 parents 3828134 + 579fc3b commit c1bcc43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,11 @@ bool wifiConnect(unsigned long timeout)
498498

499499
bool wifiConnect(unsigned long timeout, bool useAPSTAMode, bool *wasInAPmode)
500500
{
501-
if (wifiIsConnected())
501+
// If WiFi is already connected and AP_STA mode is not needed, then return true now
502+
if (wifiIsConnected() && !useAPSTAMode)
503+
{
502504
return (true); // Nothing to do
505+
}
503506

504507
displayWiFiConnect();
505508

0 commit comments

Comments
 (0)