@@ -91,7 +91,7 @@ void menuFirmware()
9191
9292 else if (incoming == ' c' )
9393 {
94- if (wifiNetworkCount () == 0 )
94+ if (networkCanConnect () == false )
9595 {
9696 systemPrintln (" Error: Please enter at least one SSID before updating firmware" );
9797 }
@@ -474,15 +474,14 @@ bool otaCheckVersion(char *versionAvailable, uint8_t versionAvailableLength)
474474 bool wasInAPmode;
475475
476476 uint8_t networkType = networkGetActiveType ();
477- if ((networkType == NETWORK_TYPE_WIFI)
478- && (wifiNetworkCount () == 0 ))
477+ if ((networkType == NETWORK_TYPE_WIFI) && (wifiNetworkCount () == 0 ))
479478 {
480479 systemPrintln (" Error: Please enter at least one SSID before getting keys" );
481480 }
482481 else
483482 {
484- if ((networkType != NETWORK_TYPE_WIFI)
485- || ( wifiConnect (settings. wifiConnectTimeoutMs , true , &wasInAPmode) == true )) // Use WIFI_AP_STA if already in WIFI_AP mode
483+ if ((networkType != NETWORK_TYPE_WIFI) || ( wifiConnect (settings. wifiConnectTimeoutMs , true , &wasInAPmode) ==
484+ true )) // Use WIFI_AP_STA if already in WIFI_AP mode
486485 {
487486 char versionString[21 ];
488487 getFirmwareVersion (versionString, sizeof (versionString), enableRCFirmware);
@@ -522,8 +521,9 @@ bool otaCheckVersion(char *versionAvailable, uint8_t versionAvailableLength)
522521
523522 if (systemState != STATE_WIFI_CONFIG)
524523 {
525- // WIFI_STOP() turns off the entire radio including the webserver. We need to turn off Station mode only.
526- // For now, unit exits AP mode via reset so if we are in AP config mode, leave WiFi Station running.
524+ // WIFI_STOP() turns off the entire radio including the webserver. We need to turn off Station mode
525+ // only. For now, unit exits AP mode via reset so if we are in AP config mode, leave WiFi Station
526+ // running.
527527
528528 // If WiFi was originally off, turn it off again
529529 if (previouslyConnected == false )
@@ -579,7 +579,7 @@ void overTheAirUpdate()
579579 systemPrintln (" OTA Update: Firmware server not available" );
580580 else
581581 systemPrintln (" OTA Update: OTA failed" );
582- #endif // COMPILE_NETWORK
582+ #endif // COMPILE_NETWORK
583583}
584584
585585// Start WiFi and perform the over-the-air update
@@ -590,7 +590,8 @@ void otaUpdate()
590590
591591 bool wasInAPmode;
592592
593- if (wifiConnect (settings.wifiConnectTimeoutMs , true , &wasInAPmode) == true ) // Use WIFI_AP_STA if already in WIFI_AP mode
593+ if (wifiConnect (settings.wifiConnectTimeoutMs , true , &wasInAPmode) ==
594+ true ) // Use WIFI_AP_STA if already in WIFI_AP mode
594595 overTheAirUpdate ();
595596
596597 // Update failed. If we were in WIFI_AP mode, return to WIFI_AP mode
0 commit comments