Closed txoof closed 3 years ago
I have discovered the root of this problem: the module does clean up as expected.
It is critical that you keep track of every single init()
call and follow it up with a sleep()
call before doing any other init.
Switching to a with open()
context might be a good way to prevent this type of untidy behavior in future updates.
I have a fix for this in development. All of the write/clear functions will be wrapped in an init/cleanup decorator.
Corrected in this commit.
SPI file handles should be closed appropriately in most cases though may remain open after a crash.
This appears to be a problem in the WaveShare epdconfig.py. The SPI handle is opened, but it is not closed anywhere after writing.
Putting the display to sleep does not close out the SPI handle.
Adding an
self.SPI.close()
call to themodule_exit()
method does not appear to help