mirror of
https://github.com/stianeikeland/go-rpio.git
synced 2025-03-21 23:48:42 +01:00
fixup! Use mash filter if it makes sense
This commit is contained in:
parent
7e21224c69
commit
c0dfd7a7e3
2
rpio.go
2
rpio.go
|
@ -311,7 +311,7 @@ func SetFreq(pin Pin, freq int) {
|
||||||
const maxUint12 = 4095
|
const maxUint12 = 4095
|
||||||
|
|
||||||
divi := uint32(sourceFreq / freq)
|
divi := uint32(sourceFreq / freq)
|
||||||
divf := uint32(((sourceFreq % freq) << 12) / sourceFreq)
|
divf := uint32(((sourceFreq % freq) << 12) / freq)
|
||||||
|
|
||||||
divi &= maxUint12
|
divi &= maxUint12
|
||||||
divf &= maxUint12
|
divf &= maxUint12
|
||||||
|
|
Loading…
Reference in New Issue
Block a user