display/input rotate

This commit is contained in:
liquidraver
2026-08-25 15:19:11 +02:00
parent 4632797e3e
commit 2e3f5f3f59
20 changed files with 544 additions and 19 deletions
+14
View File
@@ -29,6 +29,9 @@ LOG_MODULE_REGISTER(zephcore_main, CONFIG_ZEPHCORE_MAIN_LOG_LEVEL);
#include <helpers/time_sync.h>
#include "ui_task.h"
#include "ui_mesh_actions.h"
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DISPLAY)
#include "display.h"
#endif
#include "oled_power.h"
#include "led_gate.h"
#include "buzzer_gate.h"
@@ -1522,6 +1525,17 @@ int main(void)
companion_mesh.vcontactNotify(boot_cause_msg);
}
/* Physical mounting orientation, from prefs. This is the earliest it can
* run — ui_init() brings the panel up before prefs are loaded, so the
* splash may flash upright for a moment before the remap lands. A panel
* that cannot rotate logs a warning and stays native. */
zephcore_input_set_flipped(companion_mesh.prefs.input_rotate != 0);
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DISPLAY)
if (companion_mesh.prefs.display_rotate) {
mc_display_set_rotated(true);
}
#endif
/* Push initial state to UI display */
ui_set_node_name(companion_mesh.prefs.node_name);
ui_set_radio_params(
+15
View File
@@ -57,6 +57,9 @@ extern "C" void bt_ctlr_assert_handle(char *file, uint32_t line)
/* UI subsystem (display, buttons, buzzer) */
#include "ui_task.h"
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DISPLAY)
#include "display.h"
#endif
/* Headless repeaters link the weak no-op ui_* stubs (ui_headless_stubs.c), so
* the periodic UI refresh in the maintenance pass is pure work for nothing on
@@ -762,6 +765,18 @@ int main(void)
}
}
/* Physical mounting orientation, from prefs. Both are immediate and
* cheap: the panel rotation is a two-byte SEGMENT_MAP/COM_SCAN remap and
* the axis swap is a flag the input callbacks read per event. A panel
* that cannot rotate logs a warning and stays in its native orientation
* rather than failing the boot. */
zephcore_input_set_flipped(prefs->input_rotate != 0);
#if IS_ENABLED(CONFIG_ZEPHCORE_UI_DISPLAY)
if (prefs->display_rotate) {
mc_display_set_rotated(true);
}
#endif
/* Feed initial UI state from loaded prefs */
ui_set_node_name(prefs->node_name);
refresh_repeater_ui_radio_state();