Add dry contact support for IO Remote and Relays #165

This commit is contained in:
Robert Strouse 2023-10-10 11:41:21 -07:00
parent 87995bf707
commit bb36ed0f82
9 changed files with 194 additions and 122 deletions

View file

@ -492,6 +492,15 @@ bool EthernetSettings::toJSON(JsonObject &obj) {
obj["MDIOPin"] = this->MDIOPin;
return true;
}
bool EthernetSettings::usesPin(uint8_t pin) {
if((this->CLKMode == 0 || this->CLKMode == 1) && pin == 0) return true;
else if(this->CLKMode == 2 && pin == 16) return true;
else if(this->CLKMode == 3 && pin == 17) return true;
else if(this->PWRPin == pin) return true;
else if(this->MDCPin == pin) return true;
else if(this->MDIOPin == pin) return true;
return false;
}
bool EthernetSettings::save() {
pref.begin("ETH");
pref.clear();