diff --git a/cpu/stm32w108/rand.c b/cpu/stm32w108/rand.c index 1e9ab12de..d951681e0 100644 --- a/cpu/stm32w108/rand.c +++ b/cpu/stm32w108/rand.c @@ -29,19 +29,23 @@ * * This file is part of the Contiki OS * - * $Id: rand.c,v 1.1 2010/10/25 09:03:38 salvopitru Exp $ + * $Id: rand.c,v 1.2 2010/10/26 10:47:23 salvopitru Exp $ */ /*---------------------------------------------------------------------------*/ /** * \file -* Clock. +* Random number functions for STM32W. * \author * Salvatore Pitrulli */ /*---------------------------------------------------------------------------*/ -#include "lib/rand.h" #include "dev/stm32w-radio.h" +#include "lib/random.h" + +#if (RANDOM_MAX != 0xffff) +#warning "RANDOM_MAX is not defined as 65535." +#endif int rand(void) { @@ -49,8 +53,6 @@ int rand(void) ST_RadioGetRandomNumbers(&rand_num, 1); - rand_num &= RAND_MAX; - return (int)rand_num; }