Skip to content
Snippets Groups Projects
Unverified Commit c932c31f authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #8131 from miri64/pkg/fix/emb6

emb6: API updates in hal_getrand()
parents ba463179 3c499b2e
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,9 @@
#include "mutex.h"
#include "periph/gpio.h"
#include "periph/hwrng.h"
#ifdef MODULE_RANDOM
#include "random.h"
#endif
#include "xtimer.h"
#include "target.h"
......@@ -45,12 +48,12 @@ int8_t hal_init(void)
uint8_t hal_getrand(void)
{
#if RANDOM_NUMOF
#if defined(MODULE_PERIPH_HWRNG)
uint8_t res;
hwnrg_read((char *)&res, sizeof(res));
return res;
#elif defined(MODULE_RANDOM)
return (uint8_t)(genrand_uint32() % UINT8_MAX);
return (uint8_t)(random_uint32() % UINT8_MAX);
#else
return 4; /* keeping the meme alive ;-) */
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment