Wixel SDK
random_from_sernum.c
Go to the documentation of this file.
1 
5 #include <cc2511_map.h>
6 #include <random.h>
7 #include <board.h>
8 
10 {
11  // The random number generator only has 16 bits of state, while the
12  // serial number is 32 bits. No matter what we do here, there will be
13  // a 1-in-2^16 chance that two Wixels with different serial numbers
14  // start up with their random number generators in the same state.
15  // So there is no point in reading all 4 bytes of the serial number.
16 
17  randomSeed(serialNumber[0], serialNumber[1]);
18 }
void randomSeedFromSerialNumber(void)
uint8 CODE serialNumber[4]