From 0731e1b72c5023a4091a34d862a894471286d57e Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 11 Feb 2023 13:13:02 -0800 Subject: [PATCH] solve #894 --- utility/pigpio/spi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility/pigpio/spi.cpp b/utility/pigpio/spi.cpp index 3a962a96c..6768f261b 100644 --- a/utility/pigpio/spi.cpp +++ b/utility/pigpio/spi.cpp @@ -16,7 +16,7 @@ void SPI::begin(int busNo, uint32_t spi_speed) } spiIsInitialized = true; gpioInitialise(); - spiHandle = spiOpen(busNo, spi_speed, 0); + spiHandle = spiOpen((unsigned int)(busNo & 2), spi_speed, (unsigned int)((busNo / 10) << 7)); } void SPI::init(uint32_t speed)