From a785ee52120d2177c43be59bf0f0c8174bd5ea8f Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 23 Nov 2017 18:54:36 +0100 Subject: [PATCH 1/2] emb6: update PNRG access This this build branch doesn't seem to be build, this slipped through back, when the PNRG functions were renamed. --- pkg/emb6/contrib/target.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/emb6/contrib/target.c b/pkg/emb6/contrib/target.c index 03a6a9893d..edde8681fb 100644 --- a/pkg/emb6/contrib/target.c +++ b/pkg/emb6/contrib/target.c @@ -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" @@ -50,7 +53,7 @@ uint8_t hal_getrand(void) 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 From 3c499b2e548fbbcd8f89d52e1a40f30860f04b48 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 24 Nov 2017 10:49:47 +0100 Subject: [PATCH 2/2] emb6: Update periph_hwnrg CPP check --- pkg/emb6/contrib/target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/emb6/contrib/target.c b/pkg/emb6/contrib/target.c index edde8681fb..bbfaa694e3 100644 --- a/pkg/emb6/contrib/target.c +++ b/pkg/emb6/contrib/target.c @@ -48,7 +48,7 @@ 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;