Skip to content

Commit

Permalink
Add support for ESPOE32 board
Browse files Browse the repository at this point in the history
  • Loading branch information
Alibloke committed Feb 20, 2024
1 parent 0a719cb commit 1dbbb6e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
#include <ETH.h>
#endif

#ifdef ESPOE32
#include <ETH.h>
#define ETH_ADDR 1
#define ETH_POWER 5
#define ETH_MDC 23
#define ETH_MDIO 18
#endif

#include <PubSubClient.h>
#include <ArduinoOTA.h>

Expand Down Expand Up @@ -175,7 +183,7 @@ void checkWifi()
}
}

#ifdef WT32_ETH01
#if defined(WT32_ETH01) || defined(ESPOE32)
void WiFiEvent(WiFiEvent_t event)
{
switch (event) {
Expand Down Expand Up @@ -208,7 +216,11 @@ void WiFiEvent(WiFiEvent_t event)
void setupEthernet()
{
WiFi.onEvent(WiFiEvent);
ETH.begin();
#ifdef WT32_ETH01
ETH.begin();
#elif ESPOE32
ETH.begin(ETH_ADDR, ETH_POWER, ETH_MDC, ETH_MDIO, ETH_PHY_IP101, ETH_CLOCK_GPIO0_IN);
#endif

if (ETH.linkUp()) {
Serial.printf("Connected. IP Address: %s\n", ETH.localIP().toString().c_str());
Expand Down Expand Up @@ -334,7 +346,7 @@ void setup()

EEPROM.begin(10);
readEEPROM();//Restore previous state
#ifdef WT32_ETH01
#if defined(WT32_ETH01) || defined(ESPOE32)
mqttSerial.print("Setting up ethernet...");
setupEthernet();
#else
Expand Down

0 comments on commit 1dbbb6e

Please sign in to comment.