Skip to content

Commit

Permalink
Merge pull request #963 from pennam/wifi-version-fix
Browse files Browse the repository at this point in the history
WiFi.firmwareVersion: try to mount wifi fs only if needed
  • Loading branch information
pennam authored Oct 2, 2024
2 parents 6ae4fb5 + dc6d0c5 commit 06ed4f5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions libraries/WiFi/src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,17 @@ wiced_result_t whd_firmware_check_hook(const char* mounted_name, int mount_err)

#include "whd_version.h"
const char* arduino::WiFiClass::firmwareVersion() {
if ((wiced_filesystem_init() != WICED_ERROR) && (wiced_filesystem_mount_default() != WICED_ERROR)) {
if (firmware_available) {
return WHD_VERSION;
}
if (!firmware_available) {
/* Try to mount WiFi firmware filesystem */
wiced_filesystem_init();
wiced_filesystem_mount_default();
}

if (firmware_available) {
return WHD_VERSION;
} else {
return "v0.0.0";
}
return "v0.0.0";
}

arduino::WiFiClass WiFi(WiFiInterface::get_default_instance());
Expand Down

0 comments on commit 06ed4f5

Please sign in to comment.