random: timer: Use build constant for seed
Use Kconfig symbol for initial seed. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
991ff6f48b
commit
5fcae0c021
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue