From c0dfd7a7e3b61c05bb392ab9b126e9663f96e6fc Mon Sep 17 00:00:00 2001 From: Drahoslav Date: Thu, 16 Nov 2017 13:52:24 +0100 Subject: [PATCH] fixup! Use mash filter if it makes sense --- rpio.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpio.go b/rpio.go index c6778ce..4ebea04 100644 --- a/rpio.go +++ b/rpio.go @@ -311,7 +311,7 @@ func SetFreq(pin Pin, freq int) { const maxUint12 = 4095 divi := uint32(sourceFreq / freq) - divf := uint32(((sourceFreq % freq) << 12) / sourceFreq) + divf := uint32(((sourceFreq % freq) << 12) / freq) divi &= maxUint12 divf &= maxUint12