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.
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.