Add support for displays with blacktab colors and greentab offsets #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 when
initR
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 out
initR
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.