Skip to content

Commit

Permalink
fix 1.14" tft rotation 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Jan 10, 2022
1 parent 84a5b43 commit bcc7e08
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Adafruit_ST7789.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void Adafruit_ST7789::init(uint16_t width, uint16_t height, uint8_t mode) {

commonInit(NULL);

if (width == 174 && height == 320) {
if (width == 172 && height == 320) {
// 1.47" display
_rowstart = _rowstart2 = 0;
_colstart = _colstart2 = 34;
Expand All @@ -112,11 +112,10 @@ void Adafruit_ST7789::init(uint16_t width, uint16_t height, uint8_t mode) {
_rowstart = 20;
_rowstart2 = 0;
_colstart = _colstart2 = 0;
} else if (width < 240) {
} else if (width == 135 && height == 240) {
// 1.14" display
_rowstart = _rowstart2 = (int)((320 - height + 1) / 2);
_colstart = (int)((240 - width + 1) / 2);
_colstart2 = (int)((240 - width) / 2);
_colstart2 = _colstart = (int)((240 - width + 1) / 2);
} else {
// 1.3", 1.54", and 2.0" displays
_rowstart = (320 - height);
Expand Down

0 comments on commit bcc7e08

Please sign in to comment.