mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 00:13:43 +00:00
stm32wl: Fix incomplete RNG initialisation
This commit is contained in:
committed by
Ron Evans
parent
334a12818d
commit
eec915170d
@@ -15,6 +15,13 @@ func GetRNG() (uint32, error) {
|
||||
rngInitDone = true
|
||||
}
|
||||
|
||||
if stm32.RNG.SR.HasBits(stm32.RNG_SR_CECS) {
|
||||
return 0, ErrClockRNG
|
||||
}
|
||||
if stm32.RNG.SR.HasBits(stm32.RNG_SR_SECS) {
|
||||
return 0, ErrSeedRNG
|
||||
}
|
||||
|
||||
cnt := RNG_MAX_READ_RETRIES
|
||||
for !stm32.RNG.SR.HasBits(stm32.RNG_SR_DRDY) {
|
||||
cnt--
|
||||
|
||||
Reference in New Issue
Block a user