modify cdiv calculate, satisfy comment

This commit is contained in:
zxfishhack 2022-03-26 12:32:04 +08:00
parent d8d85b3536
commit e7f6c6b433

2
spi.go
View File

@ -65,7 +65,7 @@ func SpiSpeed(speed int) {
if isBCM2711() {
coreFreq = 550 * 1000000
}
cdiv := uint32(coreFreq / speed)
cdiv := uint32((coreFreq + 2*speed) / speed)
setSpiDiv(cdiv)
}