mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
furi_hal_random: Wait for ready state and no errors before sampling (#3933)
When random output is not ready, but error state flags are not set, sampling of random generator samples zero until next value is ready.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#define TAG "FuriHalRandom"
|
||||
|
||||
static uint32_t furi_hal_random_read_rng(void) {
|
||||
while(LL_RNG_IsActiveFlag_CECS(RNG) && LL_RNG_IsActiveFlag_SECS(RNG) &&
|
||||
while(LL_RNG_IsActiveFlag_CECS(RNG) || LL_RNG_IsActiveFlag_SECS(RNG) ||
|
||||
!LL_RNG_IsActiveFlag_DRDY(RNG)) {
|
||||
/* Error handling as described in RM0434, pg. 582-583 */
|
||||
if(LL_RNG_IsActiveFlag_CECS(RNG)) {
|
||||
|
||||
Reference in New Issue
Block a user