samples: use appropriate sys_randX_get()

use the appropriate sys_randX_get() instead
of always sys_rand32_get().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
Fin Maaß 2024-04-03 15:49:16 +02:00 committed by Mahesh Mahadevan
commit a9afee1d12
6 changed files with 12 additions and 14 deletions

View file

@ -304,18 +304,18 @@ static uint16_t lcet; /* Last Crank Event Time */
static void csc_simulation(void)
{
static uint8_t i;
uint32_t rand = sys_rand32_get();
uint8_t rnd = sys_rand8_get();
bool nfy_crank = false, nfy_wheel = false;
/* Measurements don't have to be updated every second */
if (!(i % 2)) {
lwet += 1050 + rand % 50;
lwet += 1050 + rnd % 50;
c_wheel_revs += 2U;
nfy_wheel = true;
}
if (!(i % 3)) {
lcet += 1000 + rand % 50;
lcet += 1000 + rnd % 50;
ccr += 1U;
nfy_crank = true;
}