mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:52:44 +01:00
sys: random: make fallback seed configurable at compile time
This commit is contained in:
parent
ccf704bab8
commit
c52fde668b
@ -32,6 +32,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef RANDOM_DEFAULT_SEED
|
||||
/**
|
||||
* @brief Seed selected when all tries to collect seeds from a random source
|
||||
* failed
|
||||
*/
|
||||
#define RANDOM_DEFAULT_SEED (1)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables support for floating point random number generation
|
||||
*/
|
||||
|
@ -34,7 +34,7 @@ void auto_init_random(void)
|
||||
luid_get(&seed, 4);
|
||||
#else
|
||||
LOG_WARNING("random: NO SEED AVAILABLE!\n");
|
||||
seed = 1;
|
||||
seed = RANDOM_SEED_DEFAULT;
|
||||
#endif
|
||||
DEBUG("random: using seed value %u\n", (unsigned)seed);
|
||||
random_init(seed);
|
||||
|
Loading…
Reference in New Issue
Block a user