Skip to content

Commit

Permalink
Explain RNG differences, add FURI_HAL_RANDOM_MAX (flipperdevices#3565)
Browse files Browse the repository at this point in the history
* Explain RNG differences, add FURI_HAL_RANDOM_MAX
* Mark FURI_HAL_RANDOM_MAX unsigned

Co-authored-by: あく <alleteam@gmail.com>
  • Loading branch information
Willy-JL and skotopes authored Apr 7, 2024
1 parent 6b120a3 commit 16b34c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion targets/furi_hal_include/furi_hal_random.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
extern "C" {
#endif

#define FURI_HAL_RANDOM_MAX 0xFFFFFFFFU

/** Initialize random subsystem */
void furi_hal_random_init(void);

/** 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);

Expand Down

0 comments on commit 16b34c6

Please sign in to comment.