From f7f160353683a6da3a3e34bc6378b87f9cb11b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20Calv=C3=A1rio?= <12759754+Calvario@users.noreply.github.com> Date: Wed, 20 May 2026 17:16:12 +0100 Subject: [PATCH 1/2] Fix T114 long press --- zephcore/CMakeLists.txt | 15 +++++++++++++++ zephcore/boards/nrf52840/heltec_t114/board.conf | 4 ++++ .../nrf52840/heltec_t114/heltec_t114_nrf52840.dts | 2 +- .../boards/nrf52840/heltec_t114/no_display.conf | 3 +++ .../nrf52840/heltec_t114/no_display.overlay | 11 +++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 zephcore/boards/nrf52840/heltec_t114/no_display.overlay diff --git a/zephcore/CMakeLists.txt b/zephcore/CMakeLists.txt index 85c5661..4238f94 100644 --- a/zephcore/CMakeLists.txt +++ b/zephcore/CMakeLists.txt @@ -333,6 +333,21 @@ if(ZEPHCORE_BOARD_OVERLAY AND EXISTS ${ZEPHCORE_BOARD_OVERLAY}) endif() endif() +# Auto-pair: for each .conf in EXTRA_CONF_FILE, if a same-named .overlay exists +# next to it, include it automatically (e.g. no_display.conf → no_display.overlay). +if(EXTRA_CONF_FILE) + foreach(_conf IN LISTS EXTRA_CONF_FILE) + string(REPLACE ".conf" ".overlay" _paired_overlay "${_conf}") + if(EXISTS "${_paired_overlay}") + if(EXTRA_DTC_OVERLAY_FILE) + set(EXTRA_DTC_OVERLAY_FILE "${EXTRA_DTC_OVERLAY_FILE};${_paired_overlay}" CACHE STRING "" FORCE) + else() + set(EXTRA_DTC_OVERLAY_FILE "${_paired_overlay}" CACHE STRING "" FORCE) + endif() + endif() + endforeach() +endif() + # Debug: Show what configs are being used message(STATUS "ZephCore config hierarchy:") message(STATUS " Common: ${ZEPHCORE_COMMON_CONF}") diff --git a/zephcore/boards/nrf52840/heltec_t114/board.conf b/zephcore/boards/nrf52840/heltec_t114/board.conf index 718f379..a406dc9 100644 --- a/zephcore/boards/nrf52840/heltec_t114/board.conf +++ b/zephcore/boards/nrf52840/heltec_t114/board.conf @@ -29,3 +29,7 @@ CONFIG_HEAP_MEM_POOL_SIZE=6144 # 1.14" 240×135 TFT - the default 6×8 font is illegible at this pixel density. # Switch to the smallest Zephyr built-in CFB font >= 16 px tall (typically 10×16). CONFIG_ZEPHCORE_DISPLAY_LARGE_FONT=y + +# Long-press emits KEY_ENTER (1000ms hold), so two confirms + release gap +# do not fit in the default 500ms window. Like T-Echo / ThinkNode M1. +CONFIG_ZEPHCORE_UI_CONFIRM_WINDOW_MS=3000 diff --git a/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts b/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts index 8a44036..b6d3e99 100644 --- a/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts +++ b/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts @@ -50,7 +50,7 @@ input = <&buttons>; input-codes = ; short-codes = ; - long-codes = ; + long-codes = ; long-delay-ms = <1000>; }; diff --git a/zephcore/boards/nrf52840/heltec_t114/no_display.conf b/zephcore/boards/nrf52840/heltec_t114/no_display.conf index 7584a55..3de7dc9 100644 --- a/zephcore/boards/nrf52840/heltec_t114/no_display.conf +++ b/zephcore/boards/nrf52840/heltec_t114/no_display.conf @@ -3,6 +3,9 @@ # Pass via -DEXTRA_CONF_FILE when building for units without the TFT module. # TFT panel VDD (P0.03) stays off for the entire session. # +# no_display.overlay (long-press => deep sleep) is auto-included by CMakeLists.txt +# whenever this file is in EXTRA_CONF_FILE their is no need to pass it separately. +# # west build -b heltec_t114 zephcore --pristine -- \ # -DEXTRA_CONF_FILE="boards/common/prod.conf;boards/nrf52840/heltec_t114/no_display.conf" diff --git a/zephcore/boards/nrf52840/heltec_t114/no_display.overlay b/zephcore/boards/nrf52840/heltec_t114/no_display.overlay new file mode 100644 index 0000000..e5eb07a --- /dev/null +++ b/zephcore/boards/nrf52840/heltec_t114/no_display.overlay @@ -0,0 +1,11 @@ +/* + * Heltec T114 - screenless build overlay + * + * Restores long-press => KEY_POWER (deep sleep) for headless units. + * The display variant uses KEY_ENTER (action_page_enter) + * Without a display there are no pages to enter, so KEY_POWER is more useful. + */ + +&user_btn_longpress { + long-codes = ; +}; From 0eedb72d739bab9552932b07a25dcce3cf97443d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steve=20Calv=C3=A1rio?= <12759754+Calvario@users.noreply.github.com> Date: Wed, 20 May 2026 20:02:27 +0100 Subject: [PATCH 2/2] Improve CMakeLists handling for T114 --- zephcore/CMakeLists.txt | 10 ++++++---- .../nrf52840/heltec_t114/heltec_t114_nrf52840.dts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/zephcore/CMakeLists.txt b/zephcore/CMakeLists.txt index 4238f94..e1d6f6b 100644 --- a/zephcore/CMakeLists.txt +++ b/zephcore/CMakeLists.txt @@ -335,14 +335,16 @@ endif() # Auto-pair: for each .conf in EXTRA_CONF_FILE, if a same-named .overlay exists # next to it, include it automatically (e.g. no_display.conf → no_display.overlay). +# Relative paths are resolved against CMAKE_CURRENT_SOURCE_DIR (the app source dir). if(EXTRA_CONF_FILE) foreach(_conf IN LISTS EXTRA_CONF_FILE) - string(REPLACE ".conf" ".overlay" _paired_overlay "${_conf}") - if(EXISTS "${_paired_overlay}") + get_filename_component(_abs_conf "${_conf}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + string(REPLACE ".conf" ".overlay" _abs_overlay "${_abs_conf}") + if(EXISTS "${_abs_overlay}") if(EXTRA_DTC_OVERLAY_FILE) - set(EXTRA_DTC_OVERLAY_FILE "${EXTRA_DTC_OVERLAY_FILE};${_paired_overlay}" CACHE STRING "" FORCE) + set(EXTRA_DTC_OVERLAY_FILE "${EXTRA_DTC_OVERLAY_FILE};${_abs_overlay}" CACHE STRING "" FORCE) else() - set(EXTRA_DTC_OVERLAY_FILE "${_paired_overlay}" CACHE STRING "" FORCE) + set(EXTRA_DTC_OVERLAY_FILE "${_abs_overlay}" CACHE STRING "" FORCE) endif() endif() endforeach() diff --git a/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts b/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts index b6d3e99..f369acf 100644 --- a/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts +++ b/zephcore/boards/nrf52840/heltec_t114/heltec_t114_nrf52840.dts @@ -45,7 +45,7 @@ }; /* Input filter: user button long-press detection (1000ms) */ - user_btn_longpress { + user_btn_longpress: user_btn_longpress { compatible = "zephyr,input-longpress"; input = <&buttons>; input-codes = ;