update t internet poe

pull/344/head
Peter Buchegger 2023-09-27 19:31:55 +00:00
rodzic 36511531ae
commit b4e7d8853b
2 zmienionych plików z 27 dodań i 22 usunięć

Wyświetl plik

@ -78,27 +78,29 @@ EthTask::~EthTask() {
bool EthTask::setup(System &system) {
WiFi.onEvent(WiFiEvent);
// if (system.getBoardConfig()->Ethernet.nReset != -1) {
// pinMode(system.getBoardConfig()->Ethernet.nReset, OUTPUT);
// digitalWrite(system.getBoardConfig()->Ethernet.nReset, 0);
// delay(200);
// digitalWrite(system.getBoardConfig()->Ethernet.nReset, 1);
// delay(200);
// digitalWrite(system.getBoardConfig()->Ethernet.nReset, 0);
// delay(200);
// digitalWrite(system.getBoardConfig()->Ethernet.nReset, 1);
// }
//
// ETH.begin(system.getBoardConfig()->Ethernet.Addr, system.getBoardConfig()->Ethernet.Power, system.getBoardConfig()->Ethernet.MDC, system.getBoardConfig()->Ethernet.MDIO, system.getBoardConfig()->Ethernet.Type, system.getBoardConfig()->Ethernet.CLK);
//
// if (!system.getUserConfig()->network.DHCP) {
// ETH.config(system.getUserConfig()->network.static_.ip, system.getUserConfig()->network.static_.gateway, system.getUserConfig()->network.static_.subnet, system.getUserConfig()->network.static_.dns1, system.getUserConfig()->network.static_.dns2);
//}
// if (system.getUserConfig()->network.hostname.overwrite) {
// ETH.setHostname(system.getUserConfig()->network.hostname.name.c_str());
//} else {
// ETH.setHostname(system.getUserConfig()->callsign.c_str());
//}
#ifdef T_INTERNET_POE
if (ETH_NRESET != -1) {
pinMode(ETH_NRESET, OUTPUT);
digitalWrite(ETH_NRESET, 0);
delay(200);
digitalWrite(ETH_NRESET, 1);
delay(200);
digitalWrite(ETH_NRESET, 0);
delay(200);
digitalWrite(ETH_NRESET, 1);
}
ETH.begin(ETH_ADDR, ETH_POWER, ETH_MDC, ETH_MDIO, (eth_phy_type_t)ETH_TYPE, (eth_clock_mode_t)ETH_CLOCK);
if (!system.getUserConfig()->network.DHCP) {
ETH.config(system.getUserConfig()->network.static_.ip, system.getUserConfig()->network.static_.gateway, system.getUserConfig()->network.static_.subnet, system.getUserConfig()->network.static_.dns1, system.getUserConfig()->network.static_.dns2);
}
if (system.getUserConfig()->network.hostname.overwrite) {
ETH.setHostname(system.getUserConfig()->network.hostname.name.c_str());
} else {
ETH.setHostname(system.getUserConfig()->callsign.c_str());
}
#endif
return true;
}

Wyświetl plik

@ -2,4 +2,7 @@
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
${esp32_base.build_flags} -DTINTERNET_POE -DOLED_SDA=33 -DOLED_SCL=32 -DLORA_SCK=14 -DLORA_MISO=2 -DLORA_MOSI=15 -DLORA_CS=12 -DLORA_IRQ=36 -DLORA_RST=4 -DUSE_SX1278
${esp32_base.build_flags} -DT_INTERNET_POE
-DOLED_SDA=33 -DOLED_SCL=32
-DLORA_SCK=14 -DLORA_MISO=2 -DLORA_MOSI=15 -DLORA_CS=12 -DLORA_IRQ=36 -DLORA_RST=4 -DUSE_SX1278
-DETH_MDC=23 -DETH_MDIO=18 -DETH_NRESET=5 -DETH_ADDR=0 -DETH_POWER=-1 -DETH_CLOCK=3 -DETH_TYPE=0