kernel: timeout: fix issue with z_timeout_expires
- issue found with Ztest case of test_thread_timeout_remaining_expires on Intel ISH platform when adjust CONFIG_SYS_CLOCK_TICKS_PER_SEC to 10k. - timeout_rem() return exact remaining ticks which is calibrated by decrease elapsed(), while z_timeout_expires try to get expire ticks to be timeout using current tick as base, so need get exact current ticks by plus elasped(). Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
This commit is contained in:
parent
de1bfd6a6e
commit
3d29c9fe54
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ k_ticks_t z_timeout_expires(const struct _timeout *timeout)
|
||||||
k_ticks_t ticks = 0;
|
k_ticks_t ticks = 0;
|
||||||
|
|
||||||
K_SPINLOCK(&timeout_lock) {
|
K_SPINLOCK(&timeout_lock) {
|
||||||
ticks = curr_tick + timeout_rem(timeout);
|
ticks = curr_tick + timeout_rem(timeout) + elapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ticks;
|
return ticks;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue