Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiFi] Cleanup code, split ESP32/ESP8266 specific #5149

Open
wants to merge 20 commits into
base: mega
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c731223
[WiFi] Split WiFi code specific for ESP8266 and ESP32
TD-er Oct 26, 2024
44f4bb2
[Cleanup] Get rid of ESP32-IDF code for IDF3.x or older
TD-er Oct 26, 2024
07a6c55
[Cleanup] Fix spelling error in filename
TD-er Oct 26, 2024
e5100b1
[WiFi] First part of moving code around to restructure WiFi code
TD-er Nov 2, 2024
b5f360d
[WiFi] Start using simplified state machine for WiFi
TD-er Nov 2, 2024
ae7d49e
[WiFi] Restructure ESP32/ESP8266 code
TD-er Nov 4, 2024
7fed5ff
[WiFi] Allow connecting to hidden SSID network
TD-er Nov 9, 2024
2e6fa42
[WiFi] Fix build issue due to enum naming conflict
TD-er Nov 9, 2024
0eacd3d
[IPv6] Disable IPv6 for ESP32-C2
TD-er Nov 9, 2024
40df9b2
[PSRAM] Free GPIO-16 and -17 on ESP32-classic when no PSRAM present
TD-er Nov 10, 2024
37d6f38
Merge remote-tracking branch 'letscontrolit/mega' into bugfix/WiFi_st…
TD-er Nov 10, 2024
a1fa226
[PSRAM] Fix build on ESP-IDF 5.1 + add special case of ESP32-picoD4
TD-er Nov 10, 2024
aaa6be7
[PSRAM] Cleanup code
TD-er Nov 10, 2024
c78edee
[PSRAM] Fix solo1 builds
TD-er Nov 10, 2024
d95c763
Merge branch 'mega' into bugfix/WiFi_state_machine
TD-er Nov 13, 2024
ecd4ee5
Merge branch 'mega' into bugfix/WiFi_state_machine
TD-er Dec 6, 2024
9d9821c
[WiFi] Add some debug log to track GotIP event
TD-er Dec 6, 2024
6ab4ba6
[WiFi] Fix not showing /setup page
TD-er Dec 6, 2024
64b9f48
[WiFi] Update to latest ESP-IDF SDK + handle gotIP event on ESP8266
TD-er Dec 6, 2024
b2e26d0
Merge branch 'mega' into bugfix/WiFi_state_machine
TD-er Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/src/CustomBuild/ESPEasyLimits.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@
#endif

#ifndef MAX_GPIO
#if ESP_IDF_VERSION_MAJOR > 3 // IDF 4+
#include <hal/gpio_types.h>
#define MAX_GPIO (GPIO_NUM_MAX - 1)
#else // ESP32 Before IDF 4.0
#define MAX_GPIO 39
#endif
#endif

#endif
Expand Down
6 changes: 0 additions & 6 deletions src/src/DataTypes/EthernetParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ bool isValid(EthPhyType_t phyType) {
#if CONFIG_ETH_USE_ESP32_EMAC
case EthPhyType_t::LAN8720:
case EthPhyType_t::TLK110:
# if ESP_IDF_VERSION_MAJOR > 3
case EthPhyType_t::RTL8201:
#if ETH_TYPE_JL1101_SUPPORTED
case EthPhyType_t::JL1101:
#endif
case EthPhyType_t::DP83848:
case EthPhyType_t::KSZ8041:
case EthPhyType_t::KSZ8081:
# endif // if ESP_IDF_VERSION_MAJOR > 3
return true;
#endif // if CONFIG_ETH_USE_ESP32_EMAC

Expand Down Expand Up @@ -94,15 +92,13 @@ eth_phy_type_t to_ESP_phy_type(EthPhyType_t phyType)
# if CONFIG_ETH_USE_ESP32_EMAC
case EthPhyType_t::LAN8720: return ETH_PHY_LAN8720;
case EthPhyType_t::TLK110: return ETH_PHY_TLK110;
# if ESP_IDF_VERSION_MAJOR > 3
case EthPhyType_t::RTL8201: return ETH_PHY_RTL8201;
# if ETH_TYPE_JL1101_SUPPORTED
case EthPhyType_t::JL1101: return ETH_PHY_JL1101;
# endif
case EthPhyType_t::DP83848: return ETH_PHY_DP83848;
case EthPhyType_t::KSZ8041: return ETH_PHY_KSZ8041;
case EthPhyType_t::KSZ8081: return ETH_PHY_KSZ8081;
# endif // if ESP_IDF_VERSION_MAJOR > 3
# endif // if CONFIG_ETH_USE_ESP32_EMAC

# if ESP_IDF_VERSION_MAJOR >= 5
Expand Down Expand Up @@ -130,15 +126,13 @@ const __FlashStringHelper* toString(EthPhyType_t phyType) {
#if CONFIG_ETH_USE_ESP32_EMAC
case EthPhyType_t::LAN8720: return F("LAN8710/LAN8720");
case EthPhyType_t::TLK110: return F("TLK110");
# if ESP_IDF_VERSION_MAJOR > 3
case EthPhyType_t::RTL8201: return F("RTL8201");
#if ETH_TYPE_JL1101_SUPPORTED
case EthPhyType_t::JL1101: return F("JL1101");
#endif
case EthPhyType_t::DP83848: return F("DP83848");
case EthPhyType_t::KSZ8041: return F("KSZ8041");
case EthPhyType_t::KSZ8081: return F("KSZ8081");
# endif // if ESP_IDF_VERSION_MAJOR > 3
#endif // if CONFIG_ETH_USE_ESP32_EMAC

#if ESP_IDF_VERSION_MAJOR >= 5
Expand Down
3 changes: 0 additions & 3 deletions src/src/DataTypes/EthernetParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ enum class EthPhyType_t : uint8_t {
#if CONFIG_ETH_USE_ESP32_EMAC
LAN8720 = 0,
TLK110 = 1,
#if ESP_IDF_VERSION_MAJOR > 3

RTL8201 = 2,
#if ETH_TYPE_JL1101_SUPPORTED
JL1101 = 3,
Expand All @@ -34,7 +32,6 @@ enum class EthPhyType_t : uint8_t {
KSZ8041 = 5,
KSZ8081 = 6,
#endif
#endif
#if ESP_IDF_VERSION_MAJOR >= 5
#if CONFIG_ETH_SPI_ETHERNET_DM9051
DM9051 = 10,
Expand Down
10 changes: 1 addition & 9 deletions src/src/ESPEasyCore/ESPEasyEth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

#include <ETH.h>
#include <lwip/dns.h>
#if ESP_IDF_VERSION_MAJOR > 3
#include <esp_eth_phy.h>
#else
#include <eth_phy/phy.h>
#endif
#include <esp_eth_phy.h>

#include <WiFi.h>

Expand Down Expand Up @@ -114,11 +110,7 @@ MAC_address ETHMacAddress() {
if(!EthEventData.ethInitSuccess) {
addLog(LOG_LEVEL_ERROR, F("Call NetworkMacAddress() only on connected Ethernet!"));
} else {
#if ESP_IDF_VERSION_MAJOR > 3
ETH.macAddress(mac.mac);
#else
esp_eth_get_mac(mac.mac);
#endif
}
return mac;
}
Expand Down
8 changes: 0 additions & 8 deletions src/src/ESPEasyCore/ESPEasyEthEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

# include <WiFi.h>


# if ESP_IDF_VERSION_MAJOR > 3
void EthEvent(WiFiEvent_t event, arduino_event_info_t info) {
switch (event) {
case ARDUINO_EVENT_ETH_START:
Expand All @@ -42,11 +40,7 @@ void EthEvent(WiFiEvent_t event, arduino_event_info_t info) {
case ARDUINO_EVENT_ETH_STOP:
// addLog(LOG_LEVEL_INFO, F("ETH event: Stopped"));
break;
# if ESP_IDF_VERSION_MAJOR > 3
case ARDUINO_EVENT_ETH_GOT_IP6:
# else // if ESP_IDF_VERSION_MAJOR > 3
case ARDUINO_EVENT_GOT_IP6:
# endif // if ESP_IDF_VERSION_MAJOR > 3
#if FEATURE_USE_IPV6
{
ip_event_got_ip6_t * event = static_cast<ip_event_got_ip6_t*>(&info.got_ip6);
Expand All @@ -65,8 +59,6 @@ void EthEvent(WiFiEvent_t event, arduino_event_info_t info) {
}
}

# endif // if ESP_IDF_VERSION_MAJOR > 3

# endif // if FEATURE_ETHERNET

#endif // ifdef ESP32
2 changes: 0 additions & 2 deletions src/src/ESPEasyCore/ESPEasyEthEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
// ********************************************************************************
#ifdef ESP32
#if FEATURE_ETHERNET
#if ESP_IDF_VERSION_MAJOR > 3
#include <WiFi.h>
#include <WiFiType.h>
void EthEvent(WiFiEvent_t event, arduino_event_info_t info);
#endif
#endif
#endif


#endif // ESPEASY_ETH_EVENT_H
Loading