mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +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 HASP_USE_ETHERNET > 0
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#include "sys/net/hasp_ethernet_esp32.h"
|
#include "sys/net/hasp_ethernet_esp32.h"
|
||||||
#if HASP_USE_SPI_ETHERNET > 0
|
#if HASP_USE_ETHSPI > 0
|
||||||
#include <ETHSPI.h>
|
#include <ETHSPI.h>
|
||||||
#warning Using ESP32 Ethernet SPI W5500
|
#warning Using ESP32 Ethernet SPI W5500
|
||||||
#define HASP_ETHERNET ETHSPI
|
#define HASP_ETHERNET ETHSPI
|
||||||
@ -251,7 +251,7 @@ static WiFiSpiClass WiFi;
|
|||||||
#include <ETH.h>
|
#include <ETH.h>
|
||||||
#warning Using ESP32 Ethernet LAN8720
|
#warning Using ESP32 Ethernet LAN8720
|
||||||
#define HASP_ETHERNET ETH
|
#define HASP_ETHERNET ETH
|
||||||
#endif // HASP_USE_SPI_ETHERNET
|
#endif // HASP_USE_ETHSPI
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#if USE_BUILTIN_ETHERNET > 0
|
#if USE_BUILTIN_ETHERNET > 0
|
||||||
|
@ -66,7 +66,7 @@ void ethernetSetup()
|
|||||||
|
|
||||||
bool started = false;
|
bool started = false;
|
||||||
WiFi.onEvent(EthernetEvent);
|
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,
|
started = HASP_ETHERNET.begin(ETHSPI_MOSI_GPIO, ETHSPI_MISO_GPIO, ETHSPI_SCLK_GPIO, ETHSPI_CS_GPIO, ETHSPI_INT_GPIO,
|
||||||
ETHSPI_HOST);
|
ETHSPI_HOST);
|
||||||
#else
|
#else
|
||||||
|
@ -184,7 +184,7 @@ void network_get_ipaddress(char* buffer, size_t len)
|
|||||||
{
|
{
|
||||||
#if HASP_USE_ETHERNET > 0
|
#if HASP_USE_ETHERNET > 0
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#if HASP_USE_SPI_ETHERNET > 0
|
#if HASP_USE_ETHSPI > 0
|
||||||
IPAddress ip = WiFi.localIP();
|
IPAddress ip = WiFi.localIP();
|
||||||
#else
|
#else
|
||||||
IPAddress ip = ETH.localIP();
|
IPAddress ip = ETH.localIP();
|
||||||
|
@ -2407,7 +2407,7 @@ void httpStart()
|
|||||||
#if HASP_USE_ETHERNET > 0
|
#if HASP_USE_ETHERNET > 0
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
#if defined(ARDUINO_ARCH_ESP32)
|
#if defined(ARDUINO_ARCH_ESP32)
|
||||||
#if HASP_USE_SPI_ETHERNET > 0
|
#if HASP_USE_ETHSPI > 0
|
||||||
ip = ETHSPI.localIP();
|
ip = ETHSPI.localIP();
|
||||||
#else
|
#else
|
||||||
ip = ETH.localIP();
|
ip = ETH.localIP();
|
||||||
@ -2478,8 +2478,9 @@ static inline void webStartConfigPortal()
|
|||||||
webServer.on(F("/style.css"), httpHandleFileUri);
|
webServer.on(F("/style.css"), httpHandleFileUri);
|
||||||
webServer.on(F("/script.js"), httpHandleFileUri);
|
webServer.on(F("/script.js"), httpHandleFileUri);
|
||||||
// reply to all requests with same HTML
|
// reply to all requests with same HTML
|
||||||
|
#if HASP_USE_WIFI > 0
|
||||||
webServer.onNotFound(webHandleWifiConfig);
|
webServer.onNotFound(webHandleWifiConfig);
|
||||||
|
#endif
|
||||||
LOG_TRACE(TAG_HTTP, F("Wifi access point"));
|
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_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_WIFI=0 ; Using Ethernet instead..
|
||||||
-D HASP_USE_ETHERNET=1
|
-D HASP_USE_ETHERNET=1
|
||||||
-D HASP_USE_SPI_ETHERNET=1
|
-D HASP_USE_ETHSPI=1
|
||||||
-D ETHSPI_HOST=HSPI_HOST
|
-D ETHSPI_HOST=HSPI_HOST
|
||||||
-D ETHSPI_INT_GPIO=39
|
-D ETHSPI_INT_GPIO=39
|
||||||
-D ETHSPI_MOSI_GPIO=1
|
-D ETHSPI_MOSI_GPIO=1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user