Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controller: use OS specific PRNG for RIOT builds #1272

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nimble/controller/src/ble_ll_rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include "trng/trng.h"
#endif

#ifdef RIOT_VERSION
#include "random.h"
#endif

#if BABBLESIM
extern void tm_tick(void);
#endif
Expand Down Expand Up @@ -134,6 +138,7 @@ ble_ll_rand_data_get(uint8_t *buf, uint8_t len)
uint32_t
ble_ll_rand(void)
{
#ifndef RIOT_VERSION
static unsigned short xsubi[3];
static bool init = true;

Expand All @@ -143,6 +148,9 @@ ble_ll_rand(void)
}

return (uint32_t) jrand48(xsubi);
#else
return random_uint32();
#endif
}

/**
Expand Down