diff options
| author | Tom Rini <[email protected]> | 2025-01-22 09:49:14 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-01-22 11:21:58 -0600 |
| commit | 01b1e062bac4d9396b5cf40daf1e82f2ca87a389 (patch) | |
| tree | 0d730542be3c60536a1c356a08c08a00a91309cd | |
| parent | 5fe39e5df4265622a35ad36d0ce13e6b1a4f158e (diff) | |
| parent | fb30f75655cdd1bf838827a8461b3434c07b1a62 (diff) | |
Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog
CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=381&view=results
- cyclic: Fix rollover every 72 min on 32 bits platforms (Patrice)
| -rw-r--r-- | common/cyclic.c | 6 | ||||
| -rw-r--r-- | include/cyclic.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/common/cyclic.c b/common/cyclic.c index 196797fd61e..fad071a39c6 100644 --- a/common/cyclic.c +++ b/common/cyclic.c @@ -36,7 +36,7 @@ void cyclic_register(struct cyclic_info *cyclic, cyclic_func_t func, cyclic->func = func; cyclic->name = name; cyclic->delay_us = delay_us; - cyclic->start_time_us = timer_get_us(); + cyclic->start_time_us = get_timer_us(0); hlist_add_head(&cyclic->list, cyclic_get_list()); } @@ -61,13 +61,13 @@ static void cyclic_run(void) * Check if this cyclic function needs to get called, e.g. * do not call the cyclic func too often */ - now = timer_get_us(); + now = get_timer_us(0); if (time_after_eq64(now, cyclic->next_call)) { /* Call cyclic function and account it's cpu-time */ cyclic->next_call = now + cyclic->delay_us; cyclic->func(cyclic); cyclic->run_cnt++; - cpu_time = timer_get_us() - now; + cpu_time = get_timer_us(0) - now; cyclic->cpu_time_us += cpu_time; /* Check if cpu-time exceeds max allowed time */ diff --git a/include/cyclic.h b/include/cyclic.h index c6c463d68e9..df8b725e3d0 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -20,7 +20,7 @@ * * @func: Function to call periodically * @name: Name of the cyclic function, e.g. shown in the commands - * @delay_ns: Delay is ns after which this function shall get executed + * @delay_us: Delay is us after which this function shall get executed * @start_time_us: Start time in us, when this function started its execution * @cpu_time_us: Total CPU time of this function * @run_cnt: Counter of executions occurances |
