From 5fcae0c0216ab82f200880e3c979cca2fb585fef Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Tue, 10 Oct 2023 10:34:23 -0700 Subject: [PATCH] random: timer: Use build constant for seed Use Kconfig symbol for initial seed. Signed-off-by: Flavio Ceolin --- subsys/random/rand32_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/random/rand32_timer.c b/subsys/random/rand32_timer.c index b5e2769b1ce..4232dccfbc8 100644 --- a/subsys/random/rand32_timer.c +++ b/subsys/random/rand32_timer.c @@ -35,7 +35,8 @@ static struct k_spinlock rand32_lock; */ uint32_t z_impl_sys_rand32_get(void) { - static uint64_t state = 123456789UL; /* initial seed value */ + /* initial seed value */ + static uint64_t state = (uint64_t)CONFIG_TIMER_RANDOM_INITIAL_STATE; k_spinlock_key_t key = k_spin_lock(&rand32_lock); state = state + k_cycle_get_32();