Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST7735 initR color tab selection problem #176

Open
JSMSolns opened this issue Dec 21, 2022 · 0 comments
Open

ST7735 initR color tab selection problem #176

JSMSolns opened this issue Dec 21, 2022 · 0 comments

Comments

@JSMSolns
Copy link

JSMSolns commented Dec 21, 2022

Apologies if this has been raised before but I believe there may be a bug in initR/color tab defines?

If INITR_REDTAB is selected and passed to the initR routine in Adafruit_ST7735.cpp , one might expect it to skip all the option checks and arrive at the default else condition (line 243 onwards...)
__} else {
// colstart, rowstart left at default '0' values
displayInit(Rcmd2red);

colstart = 0;
rowstart = 0;
}

however this never happens because the .h file defines INITR_REDTAB as 0x01 and at the same time defines INITR_144GREENTAB as the same value (0x01).
This means that for INITR_REDTAB, the default can never be executed and instead is treated as if it is INITR_144GREENTAB which does not give the correct row/col offset values:

line 229
} else if ((options == INITR_144GREENTAB) || (options == INITR_HALLOWING)) {

Possible fix is to change the INITR_144GREENTAB to 0x03 on line 13 of Adafruit_ST7735.h e.g. #define INITR_144GREENTAB 0x03
The only issue then would be line 259 in the Adafruit_ST7735.cpp:
tabcolor = INITR_144GREENTAB;

Depending on the intended operation(???), this would need to also be changed to
tabcolor = INITR_REDTAB;
or left as is.

A possible temporary work-around without having to change the library would be to call initR with an undefined fixed value e.g. initR(0x06). This would force the default else (red) condition to be executed but this may not work if the library changes in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant