46 #define RAND_MULTIPLIER 2147001325u
47 #define RAND_INCREMENT 715136305u
50 #define RAND_STATE_TYPE uint32_t
51 #define RAND_SEED_TYPE unsigned short
52 #define RAND_RETURN_TYPE unsigned short
55 static RAND_STATE_TYPE rand_state;
86 rand_state = rand_state * RAND_MULTIPLIER + RAND_INCREMENT;
93 return (rand_state >> ((
sizeof(RAND_STATE_TYPE) -
sizeof(RAND_RETURN_TYPE)) * 8));
void random_init(unsigned short seed)
Seed the cc2430 random number generator.
unsigned short random_rand(void)
Generate the next state and return the upper part of it.