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

Use int16_t for pins instead of int8_t #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asukiaaa
Copy link

@asukiaaa asukiaaa commented Sep 6, 2022

As I said on adafruit/Adafruit-GFX-Library#399, I could use PA4 pin (204) as CS with this code.
Thank you.

@dhalbert
Copy link

dhalbert commented Sep 6, 2022

Pin numbers in Arduino are generally uint8_t, and the lower-level code generally assumes that. In this library and the other one you PR'd, int8_t is used to allow specifying -1 to indicate "no pin".

It might have been better for this and the other library to use uint8_t and to use 0xff to indicate "no pin". But that did not happen in the past. It would be an incompatible change to fix that.

In your particular case, have you tried just casting: (int8_t) 204 ? That may allow you to use the pin without changing the signatures of these routines.

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