mirror of
https://github.com/stianeikeland/go-rpio.git
synced 2025-01-23 02:31:05 +01:00
Do not change mash while busy
This commit is contained in:
parent
ec703e92e8
commit
7e21224c69
2
rpio.go
2
rpio.go
|
@ -345,7 +345,7 @@ func SetFreq(pin Pin, freq int) {
|
|||
const enab = 1 << 4
|
||||
const src = 1 << 0 // oscilator
|
||||
|
||||
clkMem[clkCtlReg] = PASSWORD | src // stop gpio clock
|
||||
clkMem[clkCtlReg] = PASSWORD | (clkMem[clkCtlReg] &^ enab) // stop gpio clock (without changing src or mash)
|
||||
for clkMem[clkCtlReg]&busy != 0 {
|
||||
time.Sleep(time.Microsecond * 10)
|
||||
} // ... and wait for not busy
|
||||
|
|
Loading…
Reference in New Issue
Block a user