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

Revert HX8357D change #1356

Change #1356 caused issues.
parent 284893c3
// This is the command sequence that rotates the HX8357D driver coordinate frame // This is the command sequence that rotates the HX8357D driver coordinate frame
writecommand(TFT_MADCTL); writecommand(TFT_MADCTL);
rotation = m % 8; rotation = m % 4;
switch (rotation) switch (rotation) {
{ case 0: // Portrait
case 0: // Portrait writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MX); _width = TFT_WIDTH;
_width = _init_width; _height = TFT_HEIGHT;
_height = _init_height; break;
break; case 1: // Landscape (Portrait + 90)
case 1: // Landscape (Portrait + 90) writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MV); _width = TFT_HEIGHT;
_width = _init_height; _height = TFT_WIDTH;
_height = _init_width; break;
break; case 2: // Inverter portrait
case 2: // Inverter portrait writedata(TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MY); _width = TFT_WIDTH;
_width = _init_width; _height = TFT_HEIGHT;
_height = _init_height; break;
break; case 3: // Inverted landscape
case 3: // Inverted landscape writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY); _width = TFT_HEIGHT;
_width = _init_height; _height = TFT_WIDTH;
_height = _init_width; break;
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