Skip to content

Commit 40118bd

Browse files
committed
Invert colors and partial flush for ILI9488 display
1 parent e7afe9b commit 40118bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/nanoFramework.Graphics/Graphics/Displays/ILI9488_480x320_SPI.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ enum ILI9488_Orientation : CLR_UINT8
8787
MADCTL_MX = 0x40, // sets the Column Order, 0=Left-Right and 1=Right-Left
8888
MADCTL_MY = 0x80, // sets the Row Order, 0=Top-Bottom and 1=Bottom-Top
8989

90-
MADCTL_BGR = 0x00, // Red-Green-Blue pixel order
90+
MADCTL_RGB = 0x00, // Red-Green-Blue pixel order
9191
};
9292

9393
bool DisplayDriver::Initialize()
@@ -172,27 +172,27 @@ bool DisplayDriver::ChangeOrientation(DisplayOrientation orientation)
172172
Attributes.Height = Attributes.LongerSide;
173173
Attributes.Width = Attributes.ShorterSide;
174174
g_DisplayInterface.SendCommand(2, Memory_Access_Control,
175-
(MADCTL_MX | MADCTL_BGR)); // Portrait + BGR
175+
(MADCTL_MX | MADCTL_RGB)); // Portrait
176176
break;
177177
case DisplayOrientation::DisplayOrientation_Portrait180:
178178
Attributes.Height = Attributes.LongerSide;
179179
Attributes.Width = Attributes.ShorterSide;
180180
g_DisplayInterface.SendCommand(2, Memory_Access_Control,
181-
(MADCTL_MY | MADCTL_BGR)); // Portrait 180 + BGR
181+
(MADCTL_MY | MADCTL_RGB)); // Portrait 180
182182
break;
183183
case DisplayOrientation::DisplayOrientation_Landscape:
184184
Attributes.Height = Attributes.ShorterSide;
185185
Attributes.Width = Attributes.LongerSide;
186186
g_DisplayInterface.SendCommand(2, Memory_Access_Control,
187-
(MADCTL_MV | MADCTL_BGR)); // Landscape + BGR
187+
(MADCTL_MV | MADCTL_RGB)); // Landscape
188188
break;
189189
case DisplayOrientation::DisplayOrientation_Landscape180:
190190
Attributes.Height = Attributes.ShorterSide;
191191
Attributes.Width = Attributes.LongerSide;
192192
g_DisplayInterface.SendCommand(
193193
2,
194194
Memory_Access_Control,
195-
(MADCTL_MX | MADCTL_MY | MADCTL_MV | MADCTL_BGR)); // Landscape 180 + BGR
195+
(MADCTL_MX | MADCTL_MY | MADCTL_MV | MADCTL_RGB)); // Landscape 180
196196
break;
197197
}
198198
return true;

0 commit comments

Comments
 (0)