Unverified Commit aa7bad45 authored by Bodmer's avatar Bodmer Committed by GitHub

Merge pull request #1356 from DaveBben/hx8357D-rotation

Fix HX8375D rotation values
parents 0ad6de91 f3135aea
// This is the command sequence that rotates the ILI9481 driver coordinate frame // This is the command sequence that rotates the HX8357D driver coordinate frame
writecommand(TFT_MADCTL); writecommand(TFT_MADCTL);
rotation = m % 4; rotation = m % 8;
switch (rotation) { switch (rotation)
case 0: // Portrait {
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB); case 0: // Portrait
_width = TFT_WIDTH; writedata(TFT_MAD_BGR | TFT_MAD_MX);
_height = TFT_HEIGHT; _width = _init_width;
break; _height = _init_height;
case 1: // Landscape (Portrait + 90) break;
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_RGB); case 1: // Landscape (Portrait + 90)
_width = TFT_HEIGHT; writedata(TFT_MAD_BGR | TFT_MAD_MV);
_height = TFT_WIDTH; _width = _init_height;
break; _height = _init_width;
case 2: // Inverter portrait break;
writedata(TFT_MAD_RGB); case 2: // Inverter portrait
_width = TFT_WIDTH; writedata(TFT_MAD_BGR | TFT_MAD_MY);
_height = TFT_HEIGHT; _width = _init_width;
break; _height = _init_height;
case 3: // Inverted landscape break;
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_RGB); case 3: // Inverted landscape
_width = TFT_HEIGHT; writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
_height = TFT_WIDTH; _width = _init_height;
break; _height = _init_width;
} break;
case 4: // Portrait
writedata(TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_MY);
_width = _init_width;
_height = _init_height;
break;
case 5: // Landscape (Portrait + 90)
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX);
_width = _init_height;
_height = _init_width;
break;
case 6: // Inverter portrait
writedata(TFT_MAD_BGR);
_width = _init_width;
_height = _init_height;
break;
case 7: // Inverted landscape
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MY);
_width = _init_height;
_height = _init_width;
break;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment