You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
430 B

#include <stdint.h>
#include "rand.h"
* @brief Get e random integer in a specific range.
* @param min minimum value
* @param max maximum value
* @return The random number, which is greater or equal to min and
* less than max.
uint16_t cw_randint(int min,int max)
uint16_t randval;
uint32_t diff;
diff = max-min;
return min+diff * randval / 0xffff;