fix prng_scale16() not actually scaling
wrong type. oops.
This commit is contained in:
parent
6ca388b6c3
commit
411d46531d
|
@ -418,8 +418,7 @@ static void pep_6_random(uint8_t tick)
|
||||||
rand_flash_timeout--;
|
rand_flash_timeout--;
|
||||||
|
|
||||||
if (!rand_timeout) {
|
if (!rand_timeout) {
|
||||||
rand_timeout = prng_scale16(20, 150);
|
rand_timeout = prng_scale16(20*128, 150*128);
|
||||||
rand_timeout <<= 7;
|
|
||||||
|
|
||||||
rand_program = 6 * prng_get8();
|
rand_program = 6 * prng_get8();
|
||||||
rand_program >>= 8;
|
rand_program >>= 8;
|
||||||
|
|
|
@ -151,7 +151,7 @@ static uint32_t tinymt32_temper (tinymt32_t* s)
|
||||||
|
|
||||||
uint16_t prng_scale16(uint16_t min, uint16_t max)
|
uint16_t prng_scale16(uint16_t min, uint16_t max)
|
||||||
{
|
{
|
||||||
uint16_t rnd;
|
uint32_t rnd;
|
||||||
|
|
||||||
rnd = prng_get16();
|
rnd = prng_get16();
|
||||||
rnd *= (max - min);
|
rnd *= (max - min);
|
||||||
|
|
Loading…
Reference in New Issue