From 4a45b11cd66eca70a271351f61df76653b89dea1 Mon Sep 17 00:00:00 2001 From: MeetTheTree Date: Mon, 30 Mar 2026 23:11:25 +0200 Subject: [PATCH 1/4] Added without_display variant for repeater. Added an variant to use the heltec v3 without display as a repeater. This is intended for those whose display is either broken or who want to use the heltec v3 without the display. --- variants/heltec_v3/platformio.ini | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/variants/heltec_v3/platformio.ini b/variants/heltec_v3/platformio.ini index 803ee683e0..99bff77e27 100644 --- a/variants/heltec_v3/platformio.ini +++ b/variants/heltec_v3/platformio.ini @@ -57,6 +57,31 @@ lib_deps = ${esp32_ota.lib_deps} bakercp/CRC32 @ ^2.0.0 + +[env:Heltec_v3_without_display_repeater] +extends = Heltec_lora32_v3 +build_flags = + ${Heltec_lora32_v3.build_flags} + -D DISPLAY_CLASS=NullDisplayDriver + -D ADVERT_NAME='"Heltec Repeater"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' + -D MAX_NEIGHBOURS=50 +; -D MESH_PACKET_LOGGING=1 +; -D MESH_DEBUG=1 +build_src_filter = ${Heltec_lora32_v3.build_src_filter} + - + - + - + - + +<../examples/simple_repeater> +lib_deps = + ${Heltec_lora32_v3.lib_deps} + ${esp32_ota.lib_deps} + bakercp/CRC32 @ ^2.0.0 + + [env:Heltec_v3_repeater_bridge_rs232] extends = Heltec_lora32_v3 build_flags = @@ -376,4 +401,4 @@ build_flags = build_src_filter = ${Heltec_lora32_v3.build_src_filter} +<../examples/kiss_modem/> lib_deps = - ${Heltec_lora32_v3.lib_deps} \ No newline at end of file + ${Heltec_lora32_v3.lib_deps} From 76f6fbb932c27321a2e4d11bbd9e513146cc0a07 Mon Sep 17 00:00:00 2001 From: MeetTheTree Date: Mon, 30 Mar 2026 23:26:12 +0200 Subject: [PATCH 2/4] Implemented check for conditional loading of display libraries. Implemented check if for conditional loading of display related libraries. If DISPLAY_CLASS is NULL_DISPLAY_DRIVER omit any display related code elsewise include the display. --- variants/heltec_v3/target.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/variants/heltec_v3/target.h b/variants/heltec_v3/target.h index 21a209f993..b90655d2e4 100644 --- a/variants/heltec_v3/target.h +++ b/variants/heltec_v3/target.h @@ -8,9 +8,20 @@ #include #include #include -#ifdef DISPLAY_CLASS - #include - #include +// --------------------------------------------------------- +// Display handling +// If DISPLAY_CLASS is defined AND not NullDisplayDriver, +// include display support. +// --------------------------------------------------------- +#if defined(DISPLAY_CLASS) && !defined(NULL_DISPLAY_DRIVER) + #if !defined(DISPLAY_CLASS_IS_NULL) && !defined(DISPLAY_CLASS_NULL) + // Only include display headers if DISPLAY_CLASS is not NullDisplayDriver + #if !defined(DISPLAY_CLASS) || !__has_include() + // Default behavior: SSD1306Display + #include + #endif + #include + #endif #endif extern HeltecV3Board board; @@ -18,9 +29,12 @@ extern WRAPPER_CLASS radio_driver; extern AutoDiscoverRTCClock rtc_clock; extern EnvironmentSensorManager sensors; -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; +// --------------------------------------------------------- +// Display globals only if DISPLAY_CLASS is not NullDisplayDriver +// --------------------------------------------------------- +#if defined(DISPLAY_CLASS) && DISPLAY_CLASS != NullDisplayDriver +extern DISPLAY_CLASS display; +extern MomentaryButton user_btn; #endif bool radio_init(); From 4cd24f297070e92f392ee694b9d29c10a8065af5 Mon Sep 17 00:00:00 2001 From: MeetTheTree Date: Mon, 30 Mar 2026 23:43:36 +0200 Subject: [PATCH 3/4] Update platformio.ini added NO_DISPLAY FLAG --- variants/heltec_v3/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/heltec_v3/platformio.ini b/variants/heltec_v3/platformio.ini index 99bff77e27..14b9e573de 100644 --- a/variants/heltec_v3/platformio.ini +++ b/variants/heltec_v3/platformio.ini @@ -63,6 +63,7 @@ extends = Heltec_lora32_v3 build_flags = ${Heltec_lora32_v3.build_flags} -D DISPLAY_CLASS=NullDisplayDriver + -D NO_DISPLAY -D ADVERT_NAME='"Heltec Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 From c4932eb43975f10bbaa551cce45c8cf90e1407a1 Mon Sep 17 00:00:00 2001 From: MeetTheTree Date: Mon, 30 Mar 2026 23:46:13 +0200 Subject: [PATCH 4/4] Update target.h simplified logic for inclusion of display code --- variants/heltec_v3/target.h | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/variants/heltec_v3/target.h b/variants/heltec_v3/target.h index b90655d2e4..1f674ee1e1 100644 --- a/variants/heltec_v3/target.h +++ b/variants/heltec_v3/target.h @@ -8,20 +8,14 @@ #include #include #include -// --------------------------------------------------------- -// Display handling -// If DISPLAY_CLASS is defined AND not NullDisplayDriver, -// include display support. -// --------------------------------------------------------- -#if defined(DISPLAY_CLASS) && !defined(NULL_DISPLAY_DRIVER) - #if !defined(DISPLAY_CLASS_IS_NULL) && !defined(DISPLAY_CLASS_NULL) - // Only include display headers if DISPLAY_CLASS is not NullDisplayDriver - #if !defined(DISPLAY_CLASS) || !__has_include() - // Default behavior: SSD1306Display - #include - #endif - #include + +#ifdef DISPLAY_CLASS + #ifdef NO_DISPLAY + #include + #else + #include #endif + #include #endif extern HeltecV3Board board; @@ -29,12 +23,9 @@ extern WRAPPER_CLASS radio_driver; extern AutoDiscoverRTCClock rtc_clock; extern EnvironmentSensorManager sensors; -// --------------------------------------------------------- -// Display globals only if DISPLAY_CLASS is not NullDisplayDriver -// --------------------------------------------------------- -#if defined(DISPLAY_CLASS) && DISPLAY_CLASS != NullDisplayDriver -extern DISPLAY_CLASS display; -extern MomentaryButton user_btn; +#ifdef DISPLAY_CLASS + extern DISPLAY_CLASS display; + extern MomentaryButton user_btn; #endif bool radio_init();