Init button after syslog, allow gpio0 for button

This commit is contained in:
MichaelDvP
2021-03-04 16:14:30 +01:00
parent 7299be15df
commit 6c783b015f

View File

@@ -192,10 +192,10 @@ void System::start(uint32_t heap_start) {
get_settings(); get_settings();
commands_init(); // console & api commands commands_init(); // console & api commands
button_init(false); // the special button
led_init(false); // init LED led_init(false); // init LED
syslog_init(false); // init SysLog
adc_init(false); // analog ADC adc_init(false); // analog ADC
syslog_init(false); // init SysLog
button_init(false); // the special button
network_init(); // network network_init(); // network
EMSESP::init_tx(); // start UART EMSESP::init_tx(); // start UART
} }
@@ -263,19 +263,19 @@ void System::button_init(bool refresh) {
get_settings(); get_settings();
} }
if (pbutton_gpio_) { // Allow 0 for Boot-button on NodeMCU-32s?
// if (pbutton_gpio_) {
if (!myPButton_.init(pbutton_gpio_, HIGH)) { if (!myPButton_.init(pbutton_gpio_, HIGH)) {
LOG_INFO(F("External multi-functional button not detected")); LOG_INFO(F("External multi-functional button not detected"));
} else { } else {
LOG_INFO(F("External multi-functional button enabled")); LOG_INFO(F("External multi-functional button enabled"));
} }
myPButton_.onClick(BUTTON_Debounce, button_OnClick); myPButton_.onClick(BUTTON_Debounce, button_OnClick);
myPButton_.onDblClick(BUTTON_DblClickDelay, button_OnDblClick); myPButton_.onDblClick(BUTTON_DblClickDelay, button_OnDblClick);
myPButton_.onLongPress(BUTTON_LongPressDelay, button_OnLongPress); myPButton_.onLongPress(BUTTON_LongPressDelay, button_OnLongPress);
myPButton_.onVLongPress(BUTTON_VLongPressDelay, button_OnVLongPress); myPButton_.onVLongPress(BUTTON_VLongPressDelay, button_OnVLongPress);
} // }
} }
// set the LED to on or off when in normal operating mode // set the LED to on or off when in normal operating mode