Fixing screen orientation for MD380

This commit is contained in:
Silvano Seva 2020-11-03 22:46:58 +01:00
parent 6c2e3153c7
commit b4b3b3fa5a
1 changed files with 6 additions and 2 deletions

View File

@ -282,7 +282,7 @@ void display_init()
/** The registers and commands below are the same in HX8353-E controller **/
/*
* Configuring screen's memory access control: TYT MD380 has the screen
* Configuring screen's memory access control: TYT MD390 has the screen
* rotated by 90° degrees, so we have to exgange row and coloumn indexing.
* Moreover, we need to invert the vertical updating order to avoid painting
* an image from bottom to top (that is, horizontally mirrored).
@ -299,7 +299,11 @@ void display_init()
* - bit 1 and 0: don't care
*/
writeCmd(CMD_MADCTL);
writeData(0x60);
#ifndef PLATFORM_MD380
writeData(0x60); /* MD390 */
#else
writeData(0xA0); /* MD380 */
#endif
writeCmd(CMD_CASET);
writeData(0x00);