mirror of
https://github.com/esphome/esphome.git
synced 2024-12-18 15:57:58 +01:00
Fix 18 bit displays. (#5908)
This commit is contained in:
parent
0906559afe
commit
b62c099d54
@ -30,13 +30,24 @@ class ILI9XXXDisplay : public display::DisplayBuffer,
|
|||||||
const uint8_t *addr = init_sequence;
|
const uint8_t *addr = init_sequence;
|
||||||
while ((cmd = *addr++) != 0) {
|
while ((cmd = *addr++) != 0) {
|
||||||
num_args = *addr++ & 0x7F;
|
num_args = *addr++ & 0x7F;
|
||||||
if (cmd == ILI9XXX_MADCTL) {
|
bits = *addr;
|
||||||
bits = *addr;
|
switch (cmd) {
|
||||||
this->swap_xy_ = (bits & MADCTL_MV) != 0;
|
case ILI9XXX_MADCTL: {
|
||||||
this->mirror_x_ = (bits & MADCTL_MX) != 0;
|
this->swap_xy_ = (bits & MADCTL_MV) != 0;
|
||||||
this->mirror_y_ = (bits & MADCTL_MY) != 0;
|
this->mirror_x_ = (bits & MADCTL_MX) != 0;
|
||||||
this->color_order_ = (bits & MADCTL_BGR) ? display::COLOR_ORDER_BGR : display::COLOR_ORDER_RGB;
|
this->mirror_y_ = (bits & MADCTL_MY) != 0;
|
||||||
break;
|
this->color_order_ = (bits & MADCTL_BGR) ? display::COLOR_ORDER_BGR : display::COLOR_ORDER_RGB;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ILI9XXX_PIXFMT: {
|
||||||
|
if ((bits & 0xF) == 6)
|
||||||
|
this->is_18bitdisplay_ = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
addr += num_args;
|
addr += num_args;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user