Fix logic in SPIClass::setHwCs. (#4559)

Fixes #4558
This commit is contained in:
Marc J 2020-11-23 04:22:43 -08:00 committed by GitHub
parent 18832bb418
commit 6b0114366b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,7 @@ void SPIClass::setHwCs(bool use)
if(use && !_use_hw_ss) {
spiAttachSS(_spi, 0, _ss);
spiSSEnable(_spi);
} else if(_use_hw_ss) {
} else if(!use && _use_hw_ss) {
spiSSDisable(_spi);
spiDetachSS(_spi, _ss);
}