Skip to content

Commit e21ad6a

Browse files
committed
re-enable ethernet detection code
1 parent 7fe4b99 commit e21ad6a

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/system.cpp

+12-13
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,9 @@ void System::network_init(bool refresh) {
470470
last_system_check_ = 0; // force the LED to go from fast flash to pulse
471471
send_heartbeat();
472472

473-
/*
474-
475-
// check board profile for those which use ethernet (id > 10)
473+
// check board profile for those which use ethernet
476474
// ethernet uses lots of additional memory so we only start it when it's explicitly set in the config
477-
if (board_profile_ < 10) {
475+
if (!board_profile_.equals("E32") && !board_profile_.equals("TLK110") && !board_profile_.equals("LAN8720") && !board_profile_.equals("OLIMEX")) {
478476
return;
479477
}
480478

@@ -485,23 +483,23 @@ void System::network_init(bool refresh) {
485483
eth_phy_type_t type; // Type of the Ethernet PHY (LAN8720 or TLK110)
486484
eth_clock_mode_t clock_mode; // ETH_CLOCK_GPIO0_IN or ETH_CLOCK_GPIO0_OUT, ETH_CLOCK_GPIO16_OUT, ETH_CLOCK_GPIO17_OUT for 50Hz inverted clock
487485

488-
if (board_profile_ == 10) {
486+
if (board_profile_.equals("E32") || board_profile_.equals("LAN8720")) {
489487
// Gateway E32 (LAN8720)
490488
phy_addr = 1;
491489
power = 16;
492490
mdc = 23;
493491
mdio = 18;
494492
type = ETH_PHY_LAN8720;
495493
clock_mode = ETH_CLOCK_GPIO0_IN;
496-
} else if (board_profile_ == 11) {
497-
// Olimex ESP32-EVB-EA (LAN8720)
494+
} else if (board_profile_.equals("OLIMEX")) {
495+
// Olimex ESP32-EVB (LAN8720)
498496
phy_addr = 0;
499497
power = -1;
500498
mdc = 23;
501499
mdio = 18;
502500
type = ETH_PHY_LAN8720;
503501
clock_mode = ETH_CLOCK_GPIO0_IN;
504-
} else if (board_profile_ == 12) {
502+
} else if (board_profile_.equals("TLK110")) {
505503
// Ethernet (TLK110)
506504
phy_addr = 31;
507505
power = -1;
@@ -533,7 +531,6 @@ void System::network_init(bool refresh) {
533531
"local");
534532
#endif
535533
}
536-
*/
537534
}
538535

539536
// check health of system, done every few seconds
@@ -1047,13 +1044,15 @@ bool System::load_board_profile(std::vector<uint8_t> & data, const std::string &
10471044
} else if (board_profile == "NODEMCU") {
10481045
data = {2, 18, 23, 5, 0}; // NodeMCU 32S
10491046
} else if (board_profile == "LOLIN") {
1050-
data = {2, 14, 17, 16, 0}; // Lolin D32
1047+
data = {2, 18, 17, 16, 0}; // Lolin D32
10511048
} else if (board_profile == "WEMOS") {
1052-
data = {2, 14, 17, 16, 0}; // Wemos Mini D1-32
1049+
data = {2, 18, 17, 16, 0}; // Wemos Mini D1 ESP32
10531050
} else if (board_profile == "OLIMEX") {
1054-
data = {32, 4, 5, 17, 34}; // Olimex ESP32-EVB-EA
1051+
data = {0, 4, 5, 17, 34}; // Olimex ESP32-EVB
10551052
} else if (board_profile == "TLK110") {
1056-
data = {2, 4, 5, 17, 33}; // Ethernet (TLK110)
1053+
data = {2, 4, 5, 17, 33}; // Generic Ethernet (TLK110)
1054+
} else if (board_profile == "LAN8720") {
1055+
data = {2, 4, 5, 17, 33}; // Generic Ethernet (LAN8720)
10571056
} else {
10581057
data = {EMSESP_DEFAULT_LED_GPIO, EMSESP_DEFAULT_DALLAS_GPIO, EMSESP_DEFAULT_RX_GPIO, EMSESP_DEFAULT_TX_GPIO, EMSESP_DEFAULT_PBUTTON_GPIO};
10591058
return false;

0 commit comments

Comments
 (0)