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:
1 parent
d8b5724c38
commit
e184a81423
2 files changed
+6
-2
No files matched your search
@@ -132,7 +132,7 @@ void halt() {
|
|||||||
bool wifi_enabled = false; // set at boot from prefs; false also when the effective SSID is blank
|
bool wifi_enabled = false; // set at boot from prefs; false also when the effective SSID is blank
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISPLAY_CLASS
|
#if defined(DISPLAY_CLASS) && defined(EINK_REFRESH_LOOP)
|
||||||
static void loopDuringDisplayRefresh();
|
static void loopDuringDisplayRefresh();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -288,7 +288,9 @@ void setup() {
|
|||||||
#ifdef DISPLAY_CLASS
|
#ifdef DISPLAY_CLASS
|
||||||
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
|
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);
|
the_mesh.setListener(&ui_task);
|
||||||
|
#ifdef EINK_REFRESH_LOOP
|
||||||
if (disp != NULL) disp->setBusyHook(loopDuringDisplayRefresh);
|
if (disp != NULL) disp->setBusyHook(loopDuringDisplayRefresh);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
board.onBootComplete();
|
board.onBootComplete();
|
||||||
@@ -302,7 +304,7 @@ static void loopCore() {
|
|||||||
sensors.loop();
|
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.
|
// 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.
|
// Must not touch the display: UI listener callbacks only update state and schedule the next frame.
|
||||||
static void loopDuringDisplayRefresh() {
|
static void loopDuringDisplayRefresh() {
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ build_flags =
|
|||||||
${LilyGo_T-Echo.build_flags}
|
${LilyGo_T-Echo.build_flags}
|
||||||
-I src/helpers/ui
|
-I src/helpers/ui
|
||||||
-I examples/companion_radio/ui-new
|
-I examples/companion_radio/ui-new
|
||||||
|
-D EINK_REFRESH_LOOP
|
||||||
-D MAX_CONTACTS=350
|
-D MAX_CONTACTS=350
|
||||||
-D MAX_GROUP_CHANNELS=40
|
-D MAX_GROUP_CHANNELS=40
|
||||||
-D QSPIFLASH=1
|
-D QSPIFLASH=1
|
||||||
@@ -120,6 +121,7 @@ build_flags =
|
|||||||
${LilyGo_T-Echo.build_flags}
|
${LilyGo_T-Echo.build_flags}
|
||||||
-I src/helpers/ui
|
-I src/helpers/ui
|
||||||
-I examples/companion_radio/ui-new
|
-I examples/companion_radio/ui-new
|
||||||
|
-D EINK_REFRESH_LOOP
|
||||||
-D MAX_CONTACTS=350
|
-D MAX_CONTACTS=350
|
||||||
-D MAX_GROUP_CHANNELS=40
|
-D MAX_GROUP_CHANNELS=40
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
|
|||||||
Reference in new issue
Block a user