From ebfc59387fd67ac8f3eee357af9f92d8a9481cc5 Mon Sep 17 00:00:00 2001 From: pmantoine Date: Thu, 18 Apr 2024 15:48:08 +0800 Subject: [PATCH] Add Mega definitions to allow compilation --- Wifi_NINA.cpp | 9 ++++++++- platformio.ini | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Wifi_NINA.cpp b/Wifi_NINA.cpp index aefd88d..2890fe5 100644 --- a/Wifi_NINA.cpp +++ b/Wifi_NINA.cpp @@ -53,6 +53,12 @@ #define SPIWIFI_ACK 7 // a.k.a BUSY or READY pin #define ESP32_RESETN 5 // Reset pin #define ESP32_GPIO0 -1 // Not connected +#elif defined(ARDUINO_AVR_MEGA2560) + #define SPIWIFI SPI // The SPI port + #define SPIWIFI_SS 53 // Chip select pin + #define ESP32_RESETN 22 // Reset pin + #define SPIWIFI_ACK 23 // a.k.a BUSY or READY pin + #define ESP32_GPIO0 -1 #else #warning "WiFiNINA has no SPI port or pin allocations for this archiecture yet!" #endif @@ -88,7 +94,8 @@ bool WifiNINA::setup(const char *SSid, if (WiFi.status() == WL_NO_MODULE) { DIAG(F("Communication with WiFi module failed!")); // don't continue for now! - while (true); + // while (true); + return; } // Print firmware version on the module diff --git a/platformio.ini b/platformio.ini index b3e9dd5..b232e1f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -105,6 +105,7 @@ lib_deps = ${env.lib_deps} arduino-libraries/Ethernet SPI + https://github.com/adafruit/WiFiNINA monitor_speed = 115200 monitor_echo = yes build_flags =