lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
237 stars 156 forks source link

Small fix suggestion for ili9XXX.py, as "invert=False" is being ignored #286

Closed jetsen-os closed 11 months ago

jetsen-os commented 11 months ago

I have a display with a ST7789Vi controller. The colors were inverted and I noticed that the parameter "invert" was ignored by the driver ili9XXX.py. So I added the following two lines:

if invert:
    self.init_cmds.append({'cmd': 0x21})
else: # <--
    self.init_cmds.append({'cmd': 0x20}) # <--

in: https://github.com/lvgl/lv_binding_micropython/blob/6369315bb7bc3dc47f0b2cc33f7e7f8d830a5749/driver/esp32/ili9XXX.py#L146-L147

Now everything works as expected! I hope it helps others ;)

amirgon commented 11 months ago

Thanks for this suggestion. This should probably be added as another ili9XXX subclass that sets this specific option for this display. Feel free to open a PR.