diff --git a/spi.go b/spi.go index e2cd64a..5b5809d 100644 --- a/spi.go +++ b/spi.go @@ -65,7 +65,7 @@ func SpiSpeed(speed int) { if isBCM2711() { coreFreq = 550 * 1000000 } - cdiv := uint32((coreFreq + 2*speed) / speed) + cdiv := uint32((coreFreq + 2*speed - 1) / speed) setSpiDiv(cdiv) }