Nkawu / TFT_22_ILI9225

Arduino library for 2.2" TFT display modules with ILI9225 driver
GNU General Public License v3.0
82 stars 43 forks source link

Using FAST_PINIO on dual-core ESP32 is causing fatal errorsdue to si… #62

Closed dl9rdz closed 4 years ago

dl9rdz commented 4 years ago

due to side effects. The operations on the port are non-atomic, and can have unwanted and unexpected side effects on software running on the other CPU core if this software also accesses IO ports.

In addition, FAST_PINIO is also not fast on ESP32. My reference board (T-Beam v1.0) takes 2.48s to flip a pin 10e7 times with digitalWrite(pin, ON); digitalWrite(pin, OFF). It takes 2.52s to flip the same pin 10e7 times with pin |= pinmask; pin &= ~pinmask.

So this modification causes a slight speed-up and removes a serious problem.