Do not change mash while busy

This commit is contained in:
Drahoslav 2017-11-16 01:47:08 +01:00
parent ec703e92e8
commit 7e21224c69

View File

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