Skip to content

Comments

Fixing display rotation for ili9488 after #19010#19043

Closed
TheNitek wants to merge 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
TheNitek:bugfix-2.0.x-rotation
Closed

Fixing display rotation for ili9488 after #19010#19043
TheNitek wants to merge 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
TheNitek:bugfix-2.0.x-rotation

Conversation

@TheNitek
Copy link
Contributor

Description

After #19010 the rotation of the ili9488 doesn't match the rotation of the touch screen (if button is down left, touch area is on the top right).
I guess the same applys for st7796, but I am not sure and don't own hardware to test.

Benefits

Fixes rotation, so it matches the touch screen again

Related Issues

Caused by #19010

@mmajoor
Copy link
Contributor

mmajoor commented Aug 16, 2020

You can 'rotate' the touch screen by 'negating' the calibration and offset settings.
#define XPT2046_X_CALIBRATION
#define XPT2046_Y_CALIBRATION
#define XPT2046_X_OFFSET
#define XPT2046_Y_OFFSET

which are typically defined in configuration.h

@TheNitek
Copy link
Contributor Author

TheNitek commented Aug 16, 2020

What do you mean by negating? If have them set and the worked fine before #19010

My current settings:

#define XPT2046_X_CALIBRATION 12316
#define XPT2046_Y_CALIBRATION -8981
#define XPT2046_X_OFFSET -43
#define XPT2046_Y_OFFSET 257

@thisiskeithb
Copy link
Contributor

Tagging @tpruvot for review. Do these changes affect the TFTs you’re using?

@TheNitek TheNitek changed the title Fixing display rotation after #19010 Fixing display rotation for ili9488 after #19010 Aug 16, 2020
@tpruvot
Copy link
Contributor

tpruvot commented Aug 17, 2020

not anymore, no... negating = reverse the sign of XPT2046_X_CALIBRATION and/or XPT2046_Y_CALIBRATION to mirror the touch

@mmajoor
Copy link
Contributor

mmajoor commented Aug 17, 2020

With 'negating' I mean changing the sign:
#define XPT2046_X_CALIBRATION 12316 --> -12316
#define XPT2046_Y_CALIBRATION -8981 --> 8981
#define XPT2046_X_OFFSET -43 --> 43
#define XPT2046_Y_OFFSET 257 --> -257

Or, maybe doing a touch calibration (TOUCH_SCREEN_CALIBRATION) also does the job.

@rhapsodyv
Copy link
Member

I'm doing a refactoring in all TFT code for Emulated DOGM, Color UI and LVGL. I'm working now in "merging" all those init codes in a unique class, to remove repeated code and duplicated bugs.

@rhapsodyv
Copy link
Member

With this refactoring, almost all options will be available for all Ui:

  • tft interface
  • tft resolution
  • tft driver
  • tft rotation
  • tft mirror x or y
  • tft type: color ui, classic ui or lvgl ui

@TheNitek
Copy link
Contributor Author

I will wait fir the refactoring then.

@TheNitek TheNitek closed this Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants