From 5f46347348a2595b5469b5a548bd798839b9e121 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 23 Jul 2020 17:16:43 +0200 Subject: [PATCH] Add PortentaH7 target --- src/Arduino_ConnectionHandler.h | 10 ++++++++++ src/Arduino_WiFiConnectionHandler.cpp | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/Arduino_ConnectionHandler.h b/src/Arduino_ConnectionHandler.h index 64520189..195ab13f 100644 --- a/src/Arduino_ConnectionHandler.h +++ b/src/Arduino_ConnectionHandler.h @@ -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 + #include + + #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 #define BOARD_HAS_GSM diff --git a/src/Arduino_WiFiConnectionHandler.cpp b/src/Arduino_WiFiConnectionHandler.cpp index 24bbceb0..728bc062 100644 --- a/src/Arduino_WiFiConnectionHandler.cpp +++ b/src/Arduino_WiFiConnectionHandler.cpp @@ -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();