Explain RNG differences, add FURI_HAL_RANDOM_MAX (#3565)

* Explain RNG differences, add FURI_HAL_RANDOM_MAX
* Mark FURI_HAL_RANDOM_MAX unsigned

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
WillyJL 2024-04-07 15:11:23 +01:00 committed by GitHub
parent 6b120a3b09
commit 16b34c6e4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,12 +6,16 @@
extern "C" { extern "C" {
#endif #endif
#define FURI_HAL_RANDOM_MAX 0xFFFFFFFFU
/** Initialize random subsystem */ /** Initialize random subsystem */
void furi_hal_random_init(void); void furi_hal_random_init(void);
/** Get random value /** Get random value
* furi_hal_random_get() gives up to FURI_HAL_RANDOM_MAX
* rand() and random() give up to RAND_MAX
* *
* @return random value * @return 32 bit random value (up to FURI_HAL_RANDOM_MAX)
*/ */
uint32_t furi_hal_random_get(void); uint32_t furi_hal_random_get(void);