From d7c2293cb839d189564c9e3b464f267a2c3d6ddd Mon Sep 17 00:00:00 2001 From: MikesAllotment Date: Thu, 14 Aug 2025 14:17:26 +0100 Subject: [PATCH] Added support for new EnhancedUI MomentaryButton for Heltec V2 and Faketec ProMicro variants --- variants/heltec_v2/platformio.ini | 4 ++++ variants/heltec_v2/target.cpp | 1 + variants/heltec_v2/target.h | 2 ++ variants/promicro/platformio.ini | 5 +++++ variants/promicro/target.cpp | 1 + variants/promicro/target.h | 2 ++ 6 files changed, 15 insertions(+) diff --git a/variants/heltec_v2/platformio.ini b/variants/heltec_v2/platformio.ini index 43bc43ad..04768df4 100644 --- a/variants/heltec_v2/platformio.ini +++ b/variants/heltec_v2/platformio.ini @@ -35,6 +35,7 @@ build_flags = build_src_filter = ${Heltec_lora32_v2.build_src_filter} +<../examples/simple_repeater> + + + lib_deps = ${Heltec_lora32_v2.lib_deps} ${esp32_ota.lib_deps} @@ -53,6 +54,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + + +<../examples/simple_room_server> lib_deps = ${Heltec_lora32_v2.lib_deps} @@ -84,6 +86,7 @@ build_flags = build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + + + +<../examples/companion_radio> lib_deps = ${Heltec_lora32_v2.lib_deps} @@ -104,6 +107,7 @@ build_flags = build_src_filter = ${Heltec_lora32_v2.build_src_filter} + + + + +<../examples/companion_radio> lib_deps = ${Heltec_lora32_v2.lib_deps} diff --git a/variants/heltec_v2/target.cpp b/variants/heltec_v2/target.cpp index 418f1f7f..df71d3f4 100644 --- a/variants/heltec_v2/target.cpp +++ b/variants/heltec_v2/target.cpp @@ -18,6 +18,7 @@ SensorManager sensors; #ifdef DISPLAY_CLASS DISPLAY_CLASS display; + MomentaryButton user_btn(PIN_USER_BTN, 1000, true); #endif bool radio_init() { diff --git a/variants/heltec_v2/target.h b/variants/heltec_v2/target.h index 0c330316..2e5b17de 100644 --- a/variants/heltec_v2/target.h +++ b/variants/heltec_v2/target.h @@ -9,6 +9,7 @@ #include #ifdef DISPLAY_CLASS #include + #include #endif extern HeltecV2Board board; @@ -18,6 +19,7 @@ extern SensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; + extern MomentaryButton user_btn; #endif bool radio_init(); diff --git a/variants/promicro/platformio.ini b/variants/promicro/platformio.ini index 78b25aa7..0ec88070 100644 --- a/variants/promicro/platformio.ini +++ b/variants/promicro/platformio.ini @@ -39,6 +39,7 @@ extends = Faketec build_src_filter = ${Faketec.build_src_filter} +<../examples/simple_repeater> + + + build_flags = ${Faketec.build_flags} -D ADVERT_NAME='"Faketec Repeater"' @@ -57,6 +58,7 @@ extends = Faketec build_src_filter = ${Faketec.build_src_filter} +<../examples/simple_room_server> + + + build_flags = ${Faketec.build_flags} -D ADVERT_NAME='"Faketec Room"' -D ADVERT_LAT=0.0 @@ -93,6 +95,7 @@ build_flags = ${Faketec.build_flags} build_src_filter = ${Faketec.build_src_filter} +<../examples/companion_radio> + + + lib_deps = ${Faketec.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 @@ -112,6 +115,7 @@ build_src_filter = ${Faketec.build_src_filter} + +<../examples/companion_radio> + + + lib_deps = ${Faketec.lib_deps} adafruit/RTClib @ ^2.1.3 densaugeo/base64 @ ~1.4.0 @@ -129,6 +133,7 @@ build_flags = ; -D MESH_DEBUG=1 build_src_filter = ${Faketec.build_src_filter} + + + +<../examples/simple_sensor> lib_deps = ${Faketec.lib_deps} diff --git a/variants/promicro/target.cpp b/variants/promicro/target.cpp index 03a5a16a..b26320e4 100644 --- a/variants/promicro/target.cpp +++ b/variants/promicro/target.cpp @@ -20,6 +20,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; + MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); #endif bool radio_init() { diff --git a/variants/promicro/target.h b/variants/promicro/target.h index de2719e6..38c4b4e8 100644 --- a/variants/promicro/target.h +++ b/variants/promicro/target.h @@ -8,6 +8,7 @@ #include #ifdef DISPLAY_CLASS #include + #include #endif #include @@ -19,6 +20,7 @@ extern EnvironmentSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; + extern MomentaryButton user_btn; #endif bool radio_init();