adafruit / Adafruit-GFX-Library

Adafruit GFX graphics core Arduino library, this is the 'core' class that all our other graphics libraries derive from
https://learn.adafruit.com/adafruit-gfx-graphics-library
Other
2.32k stars 1.52k forks source link

Enable STM32 fastio for softspi #451

Open omicronns opened 2 weeks ago

omicronns commented 2 weeks ago

There was a digitalPinToPort macro usage missing in softspi fastio implementation for Teensy, that worked by accident, only because Teensy implementation of this macro is trivial: #define digitalPinToPort(pin) (pin). After that Teensy fastio implementation becomes pretty cross platform, so I enabled STM32 as a consumer of it.

Also did some PORTreg_t cleanup, because comments were contradicting the code, but I don't have hardware to test it on different platforms. I mean this comment specifically:

      // Port direction register pointers are always 8-bit regardless of
      // PORTreg_t -- even if 32-bit port, we modify a byte-aligned 8 bits.

Here it was not consistent with the code, but here it was, so I'm not sure if this fix is correct, but it seemd odd that direction register would be different size than access register.