diff --git a/platform/drivers/display/HX83XX_MDxx380.c b/platform/drivers/display/HX83XX_MDxx380.c index fcd40315..203aa8ce 100644 --- a/platform/drivers/display/HX83XX_MDxx380.c +++ b/platform/drivers/display/HX83XX_MDxx380.c @@ -282,8 +282,8 @@ void display_init() /** The registers and commands below are the same in HX8353-E controller **/ /* - * Configuring screen's memory access control: TYT MD390 has the screen - * rotated by 90° degrees, so we have to exgange row and coloumn indexing. + * Configuring screen's memory access control: TYT MD3x0 radios have the screen + * rotated by 90° degrees, so we have to exchange 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). * For reference see, in HX8353-E datasheet, MADCTL description at page 149 @@ -299,10 +299,10 @@ void display_init() * - bit 1 and 0: don't care */ writeCmd(CMD_MADCTL); - #ifndef PLATFORM_MD380 - writeData(0x60); /* MD390 */ + #ifndef DISPLAY_MIRROR_X + writeData(0x60); /* MD390 and similar radios: screen "normal" */ #else - writeData(0xA0); /* MD380 */ + writeData(0xA0); /* MD380 and similar radios: screen mirrored */ #endif writeCmd(CMD_CASET); diff --git a/platform/targets/MD380/hwconfig.h b/platform/targets/MD380/hwconfig.h index 9bea489b..c0052c6b 100644 --- a/platform/targets/MD380/hwconfig.h +++ b/platform/targets/MD380/hwconfig.h @@ -28,6 +28,9 @@ #define SCREEN_WIDTH 160 #define SCREEN_HEIGHT 128 +/* Screen needs x-axis mirroring */ +#define DISPLAY_MIRROR_X + /* Display */ #define LCD_D0 GPIOD,14 #define LCD_D1 GPIOD,15