Skip to content

Commit aac1d62

Browse files
committed
flip bgr logic to work without driver re-registration
1 parent 191c0ce commit aac1d62

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

driver/generic/ili9xxx.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, **kw):
112112
],
113113
model=None,
114114
suppModel=None,
115-
bgr=True,
115+
bgr=False,
116116
**kw,
117117
)
118118

@@ -130,7 +130,6 @@ def config_hw(self):
130130
(_PWCTR2, b"\x10"), # Pwr ctrl 2
131131
(_VMCTR1, b"\x3E\x28"), # VCOM ctrl 1
132132
(_VMCTR2, b"\x86"), # VCOM ctrl 2
133-
# (_MADCTL, self.rotation"), # Memory access ctrl # TODO: rotation?
134133
(_VSCRSADD, b"\x00"), # Vertical scrolling start address
135134
(_PIXFMT, b"\x55"), # COLMOD: Pixel format
136135
(_FRMCTR1, b"\x00\x18"), # Frame rate ctrl
@@ -158,7 +157,7 @@ def apply_rotation(self, rot):
158157
self.height, self.width = self.res
159158
self.write_register(
160159
_MADCTL,
161-
bytes([(_MADCTL_BGR if self.bgr else 0) | _MADCTL_ROTS[self.rot % 4]]),
160+
bytes([_MADCTL_BGR | _MADCTL_ROTS[self.rot % 4]]),
162161
)
163162

164163

@@ -169,5 +168,3 @@ def __init__(self, doublebuffer=True, factor=4, **kw):
169168

170169
Ili9341_hw.__init__(self, **kw)
171170
st77xx.St77xx_lvgl.__init__(self, doublebuffer, factor)
172-
self.disp_drv.color_format = lv.COLOR_FORMAT.NATIVE_REVERSE
173-
self.disp_drv.register()

0 commit comments

Comments
 (0)