mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
fix color swap
This commit is contained in:
@@ -195,15 +195,14 @@ static void SetLayout( struct GDS_Device* Device, struct GDS_Layout *Layout ) {
|
|||||||
if (Layout->Rotate) Private->Offset.Width += Layout->HFlip ? 320 - Device->Width : 0;
|
if (Layout->Rotate) Private->Offset.Width += Layout->HFlip ? 320 - Device->Width : 0;
|
||||||
else Private->Offset.Height += Layout->HFlip ? 320 - Device->Height : 0;
|
else Private->Offset.Height += Layout->HFlip ? 320 - Device->Height : 0;
|
||||||
Device->WriteCommand( Device, Layout->Invert ? 0x20 : 0x21 );
|
Device->WriteCommand( Device, Layout->Invert ? 0x20 : 0x21 );
|
||||||
Private->MADCtl = Layout->ColorSwap ? (Private->MADCtl & ~(1 << 3)) : (Private->MADCtl | (1 << 3));
|
|
||||||
} else {
|
} else {
|
||||||
Device->WriteCommand( Device, Layout->Invert ? 0x21 : 0x20 );
|
Device->WriteCommand( Device, Layout->Invert ? 0x21 : 0x20 );
|
||||||
Private->MADCtl = Layout->ColorSwap ? (Private->MADCtl | (1 << 3)) : (Private->MADCtl & ~(1 << 3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Private->MADCtl = Layout->HFlip ? (Private->MADCtl | (1 << 7)) : (Private->MADCtl & ~(1 << 7));
|
Private->MADCtl = Layout->HFlip ? (Private->MADCtl | (1 << 7)) : (Private->MADCtl & ~(1 << 7));
|
||||||
Private->MADCtl = Layout->VFlip ? (Private->MADCtl | (1 << 6)) : (Private->MADCtl & ~(1 << 6));
|
Private->MADCtl = Layout->VFlip ? (Private->MADCtl | (1 << 6)) : (Private->MADCtl & ~(1 << 6));
|
||||||
Private->MADCtl = Layout->Rotate ? (Private->MADCtl | (1 << 5)) : (Private->MADCtl & ~(1 << 5));
|
Private->MADCtl = Layout->Rotate ? (Private->MADCtl | (1 << 5)) : (Private->MADCtl & ~(1 << 5));
|
||||||
|
Private->MADCtl = Layout->ColorSwap ? (Private->MADCtl & ~(1 << 3)) : (Private->MADCtl | (1 << 3));
|
||||||
|
|
||||||
Device->WriteCommand( Device, 0x36 );
|
Device->WriteCommand( Device, 0x36 );
|
||||||
WriteByte( Device, Private->MADCtl );
|
WriteByte( Device, Private->MADCtl );
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ void display_init(char *welcome) {
|
|||||||
.Invert = strcasestr(config, "invert"),
|
.Invert = strcasestr(config, "invert"),
|
||||||
.ColorSwap = strcasestr(config, "cswap"),
|
.ColorSwap = strcasestr(config, "cswap"),
|
||||||
};
|
};
|
||||||
|
|
||||||
GDS_SetLayout(display, &Layout);
|
GDS_SetLayout(display, &Layout);
|
||||||
GDS_SetFont(display, &Font_line_2);
|
GDS_SetFont(display, &Font_line_2);
|
||||||
GDS_TextPos(display, GDS_FONT_DEFAULT, GDS_TEXT_CENTERED, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, welcome);
|
GDS_TextPos(display, GDS_FONT_DEFAULT, GDS_TEXT_CENTERED, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, welcome);
|
||||||
|
|||||||
Reference in New Issue
Block a user