e-Paper
e-Paper copied to clipboard
Efficiently wait for pin change
Use the kernel notification (poll) of Pin level change.
For libbcm2835 and wiringpi, a wait loop with delay is used instead. Replace the usleep loop with a nanosleep.
some displays had a full-busy-wait loop resulting in 100% cpu usage during waiting for the busy pin. These will see a huge reduction in sys and user cputime consumption.
Note that some displays require (apparently) sending of a SPI command in the waiting loop for the busy pin. These are not changed.