mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Updated for new define HASP_USE_ETHSPI to allow ETHSPI to build
This commit is contained in:
parent
7229ce27e7
commit
ab93f3abf2
@ -235,7 +235,7 @@ static WiFiSpiClass WiFi;
|
||||
#if HASP_USE_ETHERNET > 0
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#include "sys/net/hasp_ethernet_esp32.h"
|
||||
#if HASP_USE_SPI_ETHERNET > 0
|
||||
#if HASP_USE_ETHSPI > 0
|
||||
#include <ETHSPI.h>
|
||||
#warning Using ESP32 Ethernet SPI W5500
|
||||
#define HASP_ETHERNET ETHSPI
|
||||
@ -251,7 +251,7 @@ static WiFiSpiClass WiFi;
|
||||
#include <ETH.h>
|
||||
#warning Using ESP32 Ethernet LAN8720
|
||||
#define HASP_ETHERNET ETH
|
||||
#endif // HASP_USE_SPI_ETHERNET
|
||||
#endif // HASP_USE_ETHSPI
|
||||
|
||||
#else
|
||||
#if USE_BUILTIN_ETHERNET > 0
|
||||
|
@ -66,7 +66,7 @@ void ethernetSetup()
|
||||
|
||||
bool started = false;
|
||||
WiFi.onEvent(EthernetEvent);
|
||||
#if HASP_USE_SPI_ETHERNET > 0
|
||||
#if HASP_USE_ETHSPI > 0
|
||||
started = HASP_ETHERNET.begin(ETHSPI_MOSI_GPIO, ETHSPI_MISO_GPIO, ETHSPI_SCLK_GPIO, ETHSPI_CS_GPIO, ETHSPI_INT_GPIO,
|
||||
ETHSPI_HOST);
|
||||
#else
|
||||
@ -113,4 +113,4 @@ void ethernet_get_info(JsonDocument& doc)
|
||||
info[F(D_INFO_MAC_ADDRESS)] = HASP_ETHERNET.macAddress();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -184,7 +184,7 @@ void network_get_ipaddress(char* buffer, size_t len)
|
||||
{
|
||||
#if HASP_USE_ETHERNET > 0
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#if HASP_USE_SPI_ETHERNET > 0
|
||||
#if HASP_USE_ETHSPI > 0
|
||||
IPAddress ip = WiFi.localIP();
|
||||
#else
|
||||
IPAddress ip = ETH.localIP();
|
||||
|
@ -2407,7 +2407,7 @@ void httpStart()
|
||||
#if HASP_USE_ETHERNET > 0
|
||||
IPAddress ip;
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#if HASP_USE_SPI_ETHERNET > 0
|
||||
#if HASP_USE_ETHSPI > 0
|
||||
ip = ETHSPI.localIP();
|
||||
#else
|
||||
ip = ETH.localIP();
|
||||
@ -2478,8 +2478,9 @@ static inline void webStartConfigPortal()
|
||||
webServer.on(F("/style.css"), httpHandleFileUri);
|
||||
webServer.on(F("/script.js"), httpHandleFileUri);
|
||||
// reply to all requests with same HTML
|
||||
#if HASP_USE_WIFI > 0
|
||||
webServer.onNotFound(webHandleWifiConfig);
|
||||
|
||||
#endif
|
||||
LOG_TRACE(TAG_HTTP, F("Wifi access point"));
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ build_flags =
|
||||
-D HASP_START_CONSOLE=0 ; Needs to be disabled as we use TX & RX for SPI
|
||||
-D HASP_USE_WIFI=0 ; Using Ethernet instead..
|
||||
-D HASP_USE_ETHERNET=1
|
||||
-D HASP_USE_SPI_ETHERNET=1
|
||||
-D HASP_USE_ETHSPI=1
|
||||
-D ETHSPI_HOST=HSPI_HOST
|
||||
-D ETHSPI_INT_GPIO=39
|
||||
-D ETHSPI_MOSI_GPIO=1
|
||||
|
Loading…
x
Reference in New Issue
Block a user