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

Fix broken reset logic if reset pin exceeds 127 due to int8 overflow #20

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

nocnokneo
Copy link
Contributor

@nocnokneo nocnokneo commented Jun 5, 2024

When initializing a display like:

display.begin(0, true);

And with a rst_pin number greater than 127 (like 0xC2 in my case) fails because the number overflows the largest int8_t number and wraps around to negative value which is interpreted as "not connected".

This is in conjunction with adafruit/Adafruit-GFX-Library#449

@nocnokneo
Copy link
Contributor Author

@ladyada @evaherrada Aside from fixing the CI check, any other changes you'd like to see to get this merged?

@ladyada
Copy link
Member

ladyada commented Sep 10, 2024

hihi yes please fix the CI but also please use int32_t so we can still pass in -1
int16_t would also be plennnnty

@nocnokneo nocnokneo marked this pull request as draft September 11, 2024 20:36
@nocnokneo
Copy link
Contributor Author

hihi yes please fix the CI but also please use int32_t so we can still pass in -1 int16_t would also be plennnnty

Done! Went with int16_t

@nocnokneo nocnokneo marked this pull request as ready for review September 11, 2024 21:23
@ladyada ladyada merged commit 24755bf into adafruit:master Sep 11, 2024
1 check passed
@ladyada
Copy link
Member

ladyada commented Sep 11, 2024

thank you :)

@nocnokneo
Copy link
Contributor Author

Thanks! Don't forget the corresponding PR: adafruit/Adafruit-GFX-Library#449

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

Successfully merging this pull request may close these issues.

2 participants