sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.6k stars 621 forks source link

Moved ss pin toggling inside of spi transaction block. #653

Closed LeedanJohnson closed 12 months ago

LeedanJohnson commented 1 year ago

On the ESP32 platform, preventing concurrent access to the SPI peripheral is managed using a mutex in the SpiClass::beginTransaction and SpiClass::endTransaction functions. Toggling the _ss pin before this mutex is obtained can cause crosstalk between the LoRa module and another spi device. Moving the _ss pin toggling inside of the transaction block rectifies this.