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

Unbalanced TFT_RD_LOW() / TFT_RD_HIGH() due to conditional assembly #357

Open
spiro-trikaliotis opened this issue Jul 2, 2021 · 0 comments

Comments

@spiro-trikaliotis
Copy link

spiro-trikaliotis commented Jul 2, 2021

Hello,

since sporadically, I have some problems with my SPI communication on an esp8266 device, I was looking into the code to see if there are some unbalanced calls to TFT_RD_HIGH(), TFT_RD_LOW(), SPI_CS_LOW() and _HIGH(), and so on. You get the idea.

While I do not think this is related to my problem, from looking at the code, I believe that the TFT_RD_HIGH() here:

TFT_RD_HIGH(); // Read line HIGH

is not correctly balanced with its corresponding TFT_RD_LOW().

Why?
The TFT_RD_LOW is on line 2151, (

TFT_RD_LOW(); // Read line LOW
), before an #if defined(AVR). The TFT_RD_HIGH in line 2178 is inside the #else block of that #if. Thus, if AVR is defined, the TFT_RD_HIGH is not executed.

Unfortunately, I do not have an AVR with a corresponding TFT, so I cannot do some tests on my own.

My recommendation is to exchanges lines 2178 (

TFT_RD_HIGH(); // Read line HIGH
) and 2179 (
#endif // end !__AVR__
), so the TFT_RD_HIGH() is outside if that #if / #else / #endif block.

Do you agree on this?

EDIT: If you agree on this, I can send a PR.

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