From 00d806df10ed7627e487cb027e83d6ab1d2b162a Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Thu, 16 Mar 2023 13:17:42 +0100 Subject: [PATCH] fw: Rename variable rnd to rnd_sleep to indicate what it's for --- hw/application_fpga/fw/tk1/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/application_fpga/fw/tk1/main.c b/hw/application_fpga/fw/tk1/main.c index ed0439f..d9e9799 100644 --- a/hw/application_fpga/fw/tk1/main.c +++ b/hw/application_fpga/fw/tk1/main.c @@ -94,15 +94,15 @@ static void compute_cdi(const uint8_t digest[32], const uint8_t use_uss, { uint32_t local_cdi[8]; blake2s_ctx secure_ctx; - uint32_t rnd; + uint32_t rnd_sleep; int blake2err; // Prepare to sleep a random number of cycles before reading out UDS *timer_prescaler = 1; - rnd = rnd_word(); + rnd_sleep = rnd_word(); // Up to 65536 cycles - rnd &= 0xffff; - *timer = (rnd == 0 ? 1 : rnd); + rnd_sleep &= 0xffff; + *timer = (rnd_sleep == 0 ? 1 : rnd_sleep); *timer_ctrl = (1 << TK1_MMIO_TIMER_CTRL_START_BIT); while (*timer_status & (1 << TK1_MMIO_TIMER_STATUS_RUNNING_BIT)) { }