adafruit / Adafruit_CircuitPython_BusDevice

Two helper classes that handle transaction related state for I2C and SPI including locks.
MIT License
108 stars 76 forks source link

Optimization: remove read/write from SPI device and return SPI bus on context manager enter #2

Closed tdicola closed 7 years ago

tdicola commented 7 years ago

Since these functions just pass through to the SPI bus, as a small optimization directly return the SPI bus when it's locked. This removes the need to wrap the functions and the calling overhead.

tannewt commented 7 years ago

Thanks @tdicola!