Skip to content

[WIP] Alignment to mbed-os mainlining #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 40 additions & 36 deletions libraries/WiFi/src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int arduino::WiFiClass::begin(const char* ssid, const char *passphrase) {

int arduino::WiFiClass::beginAP(const char* ssid, const char *passphrase, uint8_t channel) {

#if defined(COMPONENT_4343W)
#if defined(COMPONENT_4343W_FS)
_softAP = WhdSoftAPInterface::get_default_instance();
#endif

Expand Down Expand Up @@ -326,52 +326,56 @@ void arduino::WiFiClass::feedWatchdog()
}


#if defined(COMPONENT_4343W)

#include "QSPIFBlockDevice.h"
#include "MBRBlockDevice.h"
#include "FATFileSystem.h"
#if defined(COMPONENT_4343W_FS)

#define WIFI_FIRMWARE_PATH "/wlan/4343WA1.BIN"

QSPIFBlockDevice root(PD_11, PD_12, PF_7, PD_13, PF_10, PG_6, QSPIF_POLARITY_MODE_1, 40000000);
mbed::MBRBlockDevice wifi_data(&root, 1);
mbed::FATFileSystem wifi_data_fs("wlan");

bool firmware_available = false;

extern "C" bool wiced_filesystem_mount() {
mbed::MBRBlockDevice::partition(&root, 1, 0x0B, 0, 1024 * 1024);
int err = wifi_data_fs.mount(&wifi_data);
if (err) {
#include "wiced_filesystem.h"
#include "resources.h"

void wiced_filesystem_mount_error(void) {
Serial.println("Failed to mount the filesystem containing the WiFi firmware.");
Serial.println("Usually that means that the WiFi firmware has not been installed yet"
" or was overwritten with another firmware.");
goto error;
}

DIR *dir;
struct dirent *ent;
if ((dir = opendir("/wlan")) != NULL) {
/* print all the files and directories within directory */
while ((ent = readdir(dir)) != NULL) {
String fullname = "/wlan/" + String(ent->d_name);
if (fullname == WIFI_FIRMWARE_PATH) {
closedir(dir);
firmware_available = true;
return true;
}
whd_print_logbuffer();
while (1) {}
}

void wiced_filesystem_firmware_error(void) {
Serial.println("Please run the \"PortentaWiFiFirmwareUpdater\" sketch once to install the WiFi firmware.");
whd_print_logbuffer();
while (1) {}
}

wiced_result_t whd_firmware_check_hook(const char *mounted_name, int mount_err)
{
DIR *dir;
struct dirent *ent;
String dir_name(mounted_name);
if(mount_err) {
wiced_filesystem_mount_error();
} else {
if ((dir = opendir(mounted_name)) != NULL) {
// print all the files and directories within directory
while ((ent = readdir(dir)) != NULL) {
String fullname = "/" + dir_name + "/" + String(ent->d_name);
if (fullname == WIFI_FIRMWARE_PATH) {
closedir(dir);
firmware_available = true;
return WICED_SUCCESS;
}
}
Serial.println("File not found");
closedir(dir);
}
wiced_filesystem_firmware_error();
}
Serial.println("File not found");
closedir(dir);
}
error:
Serial.println("Please run the \"PortentaWiFiFirmwareUpdater\" sketch once to install the WiFi firmware.");
whd_print_logbuffer();
while (1) {}
return false;
return WICED_ERROR;
}


#include "whd_version.h"
char* arduino::WiFiClass::firmwareVersion() {
if (firmware_available) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {

#include "netsocket/NetworkInterface.h"

#if defined(COMPONENT_4343W)
#if defined(COMPONENT_4343W_FS)
#include "WhdSoftAPInterface.h"
#endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1e2af1abb650e90fd45c25f5c1a4930752056475 Mon Sep 17 00:00:00 2001
From 43055a819d0da3bb6a46c6d83524155f1450d6e6 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Thu, 11 Mar 2021 15:05:20 +0100
Subject: [PATCH] PACKAGING: remove gdb exta information to slim library
Subject: [PATCH 01/87] PACKAGING: remove gdb exta information to slim library

---
tools/profiles/develop.json | 2 +-
Expand All @@ -21,5 +21,5 @@ index 21ba5c88d5..5995d276e4 100644
"c": ["-c", "-std=gnu11"],
"cxx": ["-c", "-std=gnu++14", "-fno-rtti", "-Wvla"],
--
2.30.1
2.30.2

136 changes: 0 additions & 136 deletions patches/0001-WHD-make-independent-from-TARGET_Cypress.patch

This file was deleted.

Loading