From 33ccbbb509285bd544f93b74ae124ad78f58cf41 Mon Sep 17 00:00:00 2001 From: salvopitru Date: Tue, 26 Oct 2010 10:47:23 +0000 Subject: [PATCH] Fixed compile error raised after rand.c removal. --- cpu/stm32w108/rand.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; }