This code is missing cleaning up for the open file descriptor. Just like we open spi.openSPI() we must also clean up by calling spi.closeSPI(). This is required when dealing various SPI slaves and when you need to open and close to those slaves often. This can cause too many open file descriptors.
This code is missing cleaning up for the open file descriptor. Just like we open
spi.openSPI()
we must also clean up by callingspi.closeSPI()
. This is required when dealing various SPI slaves and when you need to open and close to those slaves often. This can cause too many open file descriptors.