mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
feat(eink): landscape and portrait builds, 8x13 font in landscape
The L1 e-ink solo build splits in two, one per screen shape, so each screen can be laid out for a single shape. Settings > Rotation now only turns the screen upside down, and the joystick turns with it. Landscape writes in misc-fixed 8x13 at the panel's own resolution (EINK_LARGE_FONT); portrait keeps the 6x9. All drawing moves into EinkGfxDisplay, which the panel driver and the simulator share; the FreeSans fonts and the CRC32 library go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2803,6 +2803,9 @@ void UITask::loop() {
|
||||
if (status_screen) ((StatusScreen*)status_screen)->sample(); // Status history lines, once a minute
|
||||
#if UI_HAS_JOYSTICK
|
||||
uint8_t joy_rot = _node_prefs ? _node_prefs->joystick_rotation : JOYSTICK_ROTATION;
|
||||
#if FEAT_DISPLAY_ROTATION_SETTING && defined(JOYSTICK_UPRIGHT_ROTATION)
|
||||
if (_node_prefs) joy_rot += (JOYSTICK_UPRIGHT_ROTATION - _node_prefs->display_rotation) & 3;
|
||||
#endif
|
||||
int ev = user_btn.check();
|
||||
if (ev == BUTTON_EVENT_CLICK) {
|
||||
if (back_btn.isPressed() && !_unlock_kb) {
|
||||
@@ -3606,6 +3609,13 @@ void UITask::applyBrightness() {
|
||||
|
||||
void UITask::applyRotation() {
|
||||
if (_display != NULL && _node_prefs != NULL) {
|
||||
#if FEAT_DISPLAY_ROTATION_SETTING && defined(DISPLAY_ROTATION)
|
||||
// Each build is laid out for one shape and only turns it upside down: a
|
||||
// rotation of the other shape (a fresh device's 0, another build's, or
|
||||
// from before the split) comes back to this build's own.
|
||||
uint8_t& rot = _node_prefs->display_rotation;
|
||||
if ((rot ^ DISPLAY_ROTATION) & 1) rot = DISPLAY_ROTATION & 3;
|
||||
#endif
|
||||
_display->setDisplayRotation(_node_prefs->display_rotation);
|
||||
_next_refresh = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user