Wixel SDK
Functions
random_from_adc.c File Reference
#include <cc2511_types.h>
#include <cc2511_map.h>
#include <random.h>

Go to the source code of this file.

Functions

void randomSeedFromAdc (void)
 

Detailed Description

See random.h for more information.

Definition in file random_from_adc.c.

Function Documentation

void randomSeedFromAdc ( void  )

Uses two noisy ADC readings (of the internal temperature sensor) to initialize the state of the random number generator. This function throws away all of the previous state of the random number generator. You will generally want to call this function once at the beginning of your program.

Side effects: This function changes ADCL, ADCH, ADCCON3, and ADCIF in order to use the extra conversion feature of the ADC. This may make it incompatible with other code that uses the ADC.

Definition at line 17 of file random_from_adc.c.