Skip to content

Add Portenta H7 to Arduino_ConnectionHandler #37

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

Merged
merged 1 commit into from
Jul 24, 2020
Merged
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
10 changes: 10 additions & 0 deletions src/Arduino_ConnectionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
#define WIFI_FIRMWARE_VERSION_REQUIRED WIFI_FIRMWARE_LATEST_VERSION
#endif

#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
#include <WiFi.h>
#include <WiFiUdp.h>

#define BOARD_HAS_WIFI
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
#define NETWORK_IDLE_STATUS WL_IDLE_STATUS
#define NETWORK_CONNECTED WL_CONNECTED
#endif

#ifdef ARDUINO_SAMD_MKRGSM1400
#include <MKRGSM.h>
#define BOARD_HAS_GSM
Expand Down
3 changes: 3 additions & 0 deletions src/Arduino_WiFiConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ NetworkConnectionState WiFiConnectionHandler::update_handleInit()

Debug.print(DBG_ERROR, "Current WiFi Firmware: %s", WiFi.firmwareVersion());

#if defined(WIFI_FIRMWARE_VERSION_REQUIRED)
if (WiFi.firmwareVersion() < WIFI_FIRMWARE_VERSION_REQUIRED)
{
Debug.print(DBG_ERROR, "Latest WiFi Firmware: %s", WIFI_FIRMWARE_VERSION_REQUIRED);
Debug.print(DBG_ERROR, "Please update to the latest version for best performance.");
delay(5000);
}
#endif

#else
Debug.print(DBG_ERROR, "WiFi status ESP: %d", WiFi.status());
WiFi.disconnect();
Expand Down