mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Init button after syslog, allow gpio0 for button
This commit is contained in:
@@ -192,10 +192,10 @@ void System::start(uint32_t heap_start) {
|
||||
get_settings();
|
||||
|
||||
commands_init(); // console & api commands
|
||||
button_init(false); // the special button
|
||||
led_init(false); // init LED
|
||||
syslog_init(false); // init SysLog
|
||||
adc_init(false); // analog ADC
|
||||
syslog_init(false); // init SysLog
|
||||
button_init(false); // the special button
|
||||
network_init(); // network
|
||||
EMSESP::init_tx(); // start UART
|
||||
}
|
||||
@@ -263,19 +263,19 @@ void System::button_init(bool refresh) {
|
||||
get_settings();
|
||||
}
|
||||
|
||||
if (pbutton_gpio_) {
|
||||
// Allow 0 for Boot-button on NodeMCU-32s?
|
||||
// if (pbutton_gpio_) {
|
||||
if (!myPButton_.init(pbutton_gpio_, HIGH)) {
|
||||
LOG_INFO(F("External multi-functional button not detected"));
|
||||
} else {
|
||||
LOG_INFO(F("External multi-functional button enabled"));
|
||||
}
|
||||
|
||||
|
||||
myPButton_.onClick(BUTTON_Debounce, button_OnClick);
|
||||
myPButton_.onDblClick(BUTTON_DblClickDelay, button_OnDblClick);
|
||||
myPButton_.onLongPress(BUTTON_LongPressDelay, button_OnLongPress);
|
||||
myPButton_.onVLongPress(BUTTON_VLongPressDelay, button_OnVLongPress);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
// set the LED to on or off when in normal operating mode
|
||||
|
||||
Reference in New Issue
Block a user