companion: enable e-ink refresh loop only with EINK_REFRESH_LOOP

Only builds that define EINK_REFRESH_LOOP install the busy hook; for now
the T-Echo companion BLE/USB envs.
This commit is contained in:
akalinin-softvelum committed 2026-10-29 13:21:11 +00:00
1 parent 05423e516a
commit 1df6262d58
2 files changed
+6 -2

No files matched your search

+4 -2
View File
@@ -132,7 +132,7 @@ void halt() {
bool wifi_enabled = false; // set at boot from prefs; false also when the effective SSID is blank
#endif
#ifdef DISPLAY_CLASS
#if defined(DISPLAY_CLASS) && defined(EINK_REFRESH_LOOP)
static void loopDuringDisplayRefresh();
#endif
@@ -288,7 +288,9 @@ void setup() {
#ifdef DISPLAY_CLASS
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
the_mesh.setListener(&ui_task);
#ifdef EINK_REFRESH_LOOP
if (disp != NULL) disp->setBusyHook(loopDuringDisplayRefresh);
#endif
#endif
board.onBootComplete();
@@ -302,7 +304,7 @@ static void loopCore() {
sensors.loop();
}
#ifdef DISPLAY_CLASS
#if defined(DISPLAY_CLASS) && defined(EINK_REFRESH_LOOP)
// Runs from inside the e-ink busy wait, so radio/BLE/sensors keep going during a panel refresh.
// Must not touch the display: UI listener callbacks only update state and schedule the next frame.
static void loopDuringDisplayRefresh() {
+2
View File
@@ -93,6 +93,7 @@ build_flags =
${LilyGo_T-Echo.build_flags}
-I src/helpers/ui
-I examples/companion_radio/ui-new
-D EINK_REFRESH_LOOP
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D QSPIFLASH=1
@@ -120,6 +121,7 @@ build_flags =
${LilyGo_T-Echo.build_flags}
-I src/helpers/ui
-I examples/companion_radio/ui-new
-D EINK_REFRESH_LOOP
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256