mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Honor user set values for col/row start for INITR_MINI_160X80. (#2976)
If the caller sets a value for colstart and/or rowstart when using the INITR_MINI_160X80 model, use those values instead of the default 24 and 0. After this patch devices with a 160x80 TFT like the m5stick C can set row/col start (26, 1 for m5stick) and avoid garbage lines showing in the display.
This commit is contained in:
parent
c855bc31b4
commit
c8f4fbb7dd
1 changed files with 2 additions and 2 deletions
|
@ -265,8 +265,8 @@ void ST7735::setup() {
|
||||||
height_ == 0 ? height_ = ST7735_TFTHEIGHT_160 : height_;
|
height_ == 0 ? height_ = ST7735_TFTHEIGHT_160 : height_;
|
||||||
width_ == 0 ? width_ = ST7735_TFTWIDTH_80 : width_;
|
width_ == 0 ? width_ = ST7735_TFTWIDTH_80 : width_;
|
||||||
display_init_(RCMD2GREEN160X80);
|
display_init_(RCMD2GREEN160X80);
|
||||||
colstart_ = 24;
|
colstart_ == 0 ? colstart_ = 24 : colstart_;
|
||||||
rowstart_ = 0; // For default rotation 0
|
rowstart_ == 0 ? rowstart_ = 0 : rowstart_;
|
||||||
} else {
|
} else {
|
||||||
// colstart, rowstart left at default '0' values
|
// colstart, rowstart left at default '0' values
|
||||||
display_init_(RCMD2RED);
|
display_init_(RCMD2RED);
|
||||||
|
|
Loading…
Reference in a new issue