From 6c783b015f390b45608c83d4b5325e60977923df Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 4 Mar 2021 16:14:30 +0100 Subject: [PATCH] Init button after syslog, allow gpio0 for button --- src/system.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/system.cpp b/src/system.cpp index 4155eb095..14cd78e1a 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -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 @@ -591,7 +591,7 @@ void System::show_system(uuid::console::Shell & shell) { #ifndef EMSESP_STANDALONE shell.printfln(F("SDK version: %s"), ESP.getSdkVersion()); shell.printfln(F("CPU frequency: %u MHz"), ESP.getCpuFreqMHz()); - shell.printfln(F("Free heap: %lu bytes"), (uint32_t)ESP.getFreeHeap()); + shell.printfln(F("Free heap: %lu bytes"), (uint32_t)ESP.getFreeHeap()); shell.println(); switch (WiFi.status()) {