rng: check error before checking if data ready.
mostly cosmetic, but ease debugging.
This commit is contained in:
parent
64baacfbbf
commit
5a53f18a78
@ -67,13 +67,13 @@ void rng_interrupt_disable(void)
|
|||||||
*/
|
*/
|
||||||
bool rng_get_random(uint32_t *rand_nr)
|
bool rng_get_random(uint32_t *rand_nr)
|
||||||
{
|
{
|
||||||
/* data ready */
|
/* Check for errors */
|
||||||
if (!(RNG_SR & RNG_SR_DRDY)) {
|
if (RNG_SR & (RNG_SR_CECS | RNG_SR_SECS)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for errors */
|
/* data ready */
|
||||||
if (RNG_SR & (RNG_SR_CECS | RNG_SR_SECS)) {
|
if (!(RNG_SR & RNG_SR_DRDY)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user