Change settings without reboot

This commit is contained in:
iranl
2025-06-18 16:21:19 +02:00
parent 61ec292100
commit da837599d3
12 changed files with 567 additions and 405 deletions

View File

@@ -15,7 +15,6 @@ Gpio::Gpio(Preferences* preferences)
: _preferences(preferences)
{
_inst = this;
loadPinConfiguration();
_inst->init();
}
@@ -120,6 +119,13 @@ void Gpio::init()
_inst->_triggerState.push_back(0);
}
_inst->setPins();
}
void Gpio::setPins()
{
loadPinConfiguration();
bool hasInputPin = false;
if (_inst->_preferences->getBool(preference_cred_bypass_boot_btn_enabled, false))
@@ -180,8 +186,9 @@ void Gpio::init()
}
}
if(hasInputPin)
if(hasInputPin && _first)
{
_first = false;
_inst->timer = timerBegin(1000000);
timerAttachInterrupt(_inst->timer, isrOnTimer);
timerAlarm(_inst->timer, 100000, true, 0);