diff --git a/drivers/periph_common/init.c b/drivers/periph_common/init.c index 726f92bb133f5444015ace602f1bfd8136bebdaf..318f4194c1f1596641d2fb12f943f1db02bec2eb 100644 --- a/drivers/periph_common/init.c +++ b/drivers/periph_common/init.c @@ -26,6 +26,9 @@ #ifdef MODULE_PERIPH_RTC #include "periph/rtc.h" #endif +#ifdef MODULE_PERIPH_HWRNG +#include "periph/hwrng.h" +#endif void periph_init(void) { @@ -40,4 +43,8 @@ void periph_init(void) #ifdef MODULE_PERIPH_RTC rtc_init(); #endif + +#ifdef MODULE_PERIPH_HWRNG + hwrng_init(); +#endif } diff --git a/tests/periph_hwrng/main.c b/tests/periph_hwrng/main.c index 3b67b4e148da4a2fcfc23f998e363b9db03daaee..df5967006dc1d22cf6475c539c6dd0902cd80d60 100644 --- a/tests/periph_hwrng/main.c +++ b/tests/periph_hwrng/main.c @@ -34,9 +34,6 @@ int main(void) printf("This test will print from 1 to %u random bytes about every " "second\n\n", LIMIT); - puts("Initializing the HWRNG driver.\n"); - hwrng_init(); - while (1) { /* zero out buffer */ memset(buf, 0, sizeof(buf)); diff --git a/tests/pkg_micro-ecc-with-hwrng/main.c b/tests/pkg_micro-ecc-with-hwrng/main.c index 325c9fcba1507e371b03fe3523a150620dab70f9..2299b6fdbeeacc355197aea38f71d62da82f7406 100644 --- a/tests/pkg_micro-ecc-with-hwrng/main.c +++ b/tests/pkg_micro-ecc-with-hwrng/main.c @@ -61,9 +61,6 @@ int main(void) printf("Testing %d random private key pairs and signature using HWRNG\n", TESTROUNDS); - /* initialize hardware random number generator */ - hwrng_init(); - uint8_t l_private1[curve_size]; uint8_t l_private2[curve_size];