This change fixes #191, #180 and #154 by creating a flag named INITR_BLACKTAB_OFFSETS for initR for the displays described in the issue reports. When initR is called with this flag, the commands for second stage initialization of greentab displays are used, but MADCTL is modified like when INITR_BLACKTAB is used. I have also modified Adafruit_ST7735::setRotation, as it alters MADCTL. I have simplified the function to avoid repeating code for checking if the color order flag in MADCTL should be changed. This change is tested, it works on the mentioned displays and doesn't alter the functionality when INITR_BLACKTAB or INITR_GREENTAB is used.
This pull request aims to fix the same issue as #168, which contains a bug that causes an erroneous modification of its behavior when initR is used with INITR_GREENTAB, which I have described in comments below that pull request.
My pull request doesn't modify the examples, as I wasn't sure if adding a commented out initR with INITR_BLACKTAB_OFFSETS to e.g. graphicstest is suitable, as this type of displays isn't an official one.
PS: In #191, I was told to contact Deek-Robot rather than submitting a pull request myself. I decided otherwise, as their website doesn't list my TFT as one of their products (even though the URL of the company is written on the display) and I didn't want to risk waiting for a long time if I can fix this myself. Another reason is that this issue isn't exclusive to Deek-Robot displays.
This change fixes #191, #180 and #154 by creating a flag named
INITR_BLACKTAB_OFFSETS
forinitR
for the displays described in the issue reports. WheninitR
is called with this flag, the commands for second stage initialization of greentab displays are used, but MADCTL is modified like whenINITR_BLACKTAB
is used. I have also modifiedAdafruit_ST7735::setRotation
, as it alters MADCTL. I have simplified the function to avoid repeating code for checking if the color order flag in MADCTL should be changed. This change is tested, it works on the mentioned displays and doesn't alter the functionality whenINITR_BLACKTAB
orINITR_GREENTAB
is used. This pull request aims to fix the same issue as #168, which contains a bug that causes an erroneous modification of its behavior wheninitR
is used withINITR_GREENTAB
, which I have described in comments below that pull request. My pull request doesn't modify the examples, as I wasn't sure if adding a commented outinitR
withINITR_BLACKTAB_OFFSETS
to e.g.graphicstest
is suitable, as this type of displays isn't an official one. PS: In #191, I was told to contact Deek-Robot rather than submitting a pull request myself. I decided otherwise, as their website doesn't list my TFT as one of their products (even though the URL of the company is written on the display) and I didn't want to risk waiting for a long time if I can fix this myself. Another reason is that this issue isn't exclusive to Deek-Robot displays.