Skip to content

Commit 06ed4f5

Browse files
authored
Merge pull request #963 from pennam/wifi-version-fix
WiFi.firmwareVersion: try to mount wifi fs only if needed
2 parents 6ae4fb5 + dc6d0c5 commit 06ed4f5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: libraries/WiFi/src/WiFi.cpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,17 @@ wiced_result_t whd_firmware_check_hook(const char* mounted_name, int mount_err)
373373

374374
#include "whd_version.h"
375375
const char* arduino::WiFiClass::firmwareVersion() {
376-
if ((wiced_filesystem_init() != WICED_ERROR) && (wiced_filesystem_mount_default() != WICED_ERROR)) {
377-
if (firmware_available) {
378-
return WHD_VERSION;
379-
}
376+
if (!firmware_available) {
377+
/* Try to mount WiFi firmware filesystem */
378+
wiced_filesystem_init();
379+
wiced_filesystem_mount_default();
380+
}
381+
382+
if (firmware_available) {
383+
return WHD_VERSION;
384+
} else {
385+
return "v0.0.0";
380386
}
381-
return "v0.0.0";
382387
}
383388

384389
arduino::WiFiClass WiFi(WiFiInterface::get_default_instance());

0 commit comments

Comments
 (0)