adafruit / Adafruit_ILI9341

Library for Adafruit ILI9341 displays
406 stars 281 forks source link

Use int16_t for pins instead of int8_t #82

Open asukiaaa opened 2 years ago

asukiaaa commented 2 years ago

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

dhalbert commented 2 years ago

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.