Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TFT Screens don't honor the flip screen display config value #3101

Closed
garthvh opened this issue Jan 15, 2024 · 1 comment
Closed

[Bug]: TFT Screens don't honor the flip screen display config value #3101

garthvh opened this issue Jan 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@garthvh
Copy link
Member

garthvh commented Jan 15, 2024

Category

Hardware Compatibility

Hardware

T-Watch

Firmware Version

2.2.18

Description

I need to flip my twatch screen and the flip screen vertically config option is not doing anything.

Relevant log output

No response

@garthvh garthvh added the bug Something isn't working label Jan 15, 2024
@mverch67
Copy link
Collaborator

mverch67 commented Jan 19, 2024

The issue appears in 2.2.17 where the following changes were made in Screen.h:
image

While it looks nice and clean to use the baseclass pointer it unfortunately does not work anymore, because the OLEDDisplay baseclass is poorly designed as it does not use virtual function declarations (especially in this case flipScreenVertically()). That means now OLEDDisplay::flipScreenVertically() is called instead of TFTDisplay::flipScreenVertically().

There are three possible solutions to fix this:
(1) revert this change (but use pointers as required now in this commit)
(2) Change the library OLEDDisplay to use virtual function declarations (e.g. fork into meshtastic repository)
(3) Use this ugly "hack" in Screen.cpp#1055 (and maybe at other yet undetected broken places)

#if defined(ST7735_CS) || defined(ILI9341_DRIVER) || defined(ST7789_CS) || defined(RAK14014)
    static_cast<TFTDisplay *>(dispdev)->flipScreenVertically();
#endif

@jp-bennett

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants