modify cdiv calculate, satisfy comment

This commit is contained in:
zxfishhack 2022-03-26 12:38:14 +08:00
parent e7f6c6b433
commit 1139db6580

2
spi.go
View File

@ -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)
}