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

Constructor is setting a digital pin before setting OUTPUT mode. #49

Open
midi-mma opened this issue Aug 4, 2020 · 3 comments
Open

Comments

@midi-mma
Copy link

midi-mma commented Aug 4, 2020

In the constructor
Adafruit_TFTLCD::Adafruit_TFTLCD(uint8_t cs, uint8_t cd, uint8_t wr, uint8_t rd, uint8_t reset)

we see the following lines of code:

  if (reset) {
    digitalWrite(reset, HIGH);
    pinMode(reset, OUTPUT);
  }

Is it valid to be setting the line to HIGH before the pinMode is set? On SAMD51 the default pin mode is INPUT_PULLUP.

@ladyada
Copy link
Member

ladyada commented Aug 4, 2020

oh yeah thats an old Arduinoism - if you can submit a tested PR that would be great

@midi-mma
Copy link
Author

midi-mma commented Aug 4, 2020

Unfortunately, I am unable to submit a tested PR at this time, because I am trying to get the HX8357 display working on the Grand Central M4, and I'm working with the code in the SAMD51 branch. Unfortunately my wiring does not match the breakout board exactly. But I noticed this issue while looking through the code. Sorry!

@makermelissa
Copy link
Collaborator

I believe the reasoning for this is to avoid dropping the reset line low between the 2 calls and resetting the processor.

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

2 participants