@@ -470,11 +470,9 @@ void System::network_init(bool refresh) {
470
470
last_system_check_ = 0 ; // force the LED to go from fast flash to pulse
471
471
send_heartbeat ();
472
472
473
- /*
474
-
475
- // check board profile for those which use ethernet (id > 10)
473
+ // check board profile for those which use ethernet
476
474
// 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 " ) ) {
478
476
return ;
479
477
}
480
478
@@ -485,23 +483,23 @@ void System::network_init(bool refresh) {
485
483
eth_phy_type_t type; // Type of the Ethernet PHY (LAN8720 or TLK110)
486
484
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
487
485
488
- if (board_profile_ == 10 ) {
486
+ if (board_profile_. equals ( " E32 " ) || board_profile_. equals ( " LAN8720 " ) ) {
489
487
// Gateway E32 (LAN8720)
490
488
phy_addr = 1 ;
491
489
power = 16 ;
492
490
mdc = 23 ;
493
491
mdio = 18 ;
494
492
type = ETH_PHY_LAN8720;
495
493
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)
498
496
phy_addr = 0 ;
499
497
power = -1 ;
500
498
mdc = 23 ;
501
499
mdio = 18 ;
502
500
type = ETH_PHY_LAN8720;
503
501
clock_mode = ETH_CLOCK_GPIO0_IN;
504
- } else if (board_profile_ == 12 ) {
502
+ } else if (board_profile_. equals ( " TLK110 " ) ) {
505
503
// Ethernet (TLK110)
506
504
phy_addr = 31 ;
507
505
power = -1 ;
@@ -533,7 +531,6 @@ void System::network_init(bool refresh) {
533
531
" local" );
534
532
#endif
535
533
}
536
- */
537
534
}
538
535
539
536
// 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 &
1047
1044
} else if (board_profile == " NODEMCU" ) {
1048
1045
data = {2 , 18 , 23 , 5 , 0 }; // NodeMCU 32S
1049
1046
} else if (board_profile == " LOLIN" ) {
1050
- data = {2 , 14 , 17 , 16 , 0 }; // Lolin D32
1047
+ data = {2 , 18 , 17 , 16 , 0 }; // Lolin D32
1051
1048
} 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
1053
1050
} 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
1055
1052
} 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)
1057
1056
} else {
1058
1057
data = {EMSESP_DEFAULT_LED_GPIO, EMSESP_DEFAULT_DALLAS_GPIO, EMSESP_DEFAULT_RX_GPIO, EMSESP_DEFAULT_TX_GPIO, EMSESP_DEFAULT_PBUTTON_GPIO};
1059
1058
return false ;
0 commit comments