nrf52_bsim: Minor fix in time coversion
(This could not be triggered in the nrf52_bsim yet, so just so it is fixed for the future) Properly handle converting back and forth from absolute to HW time when either of those is set to TIME_NEVER Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
parent
13823b6bcf
commit
b7ee23bcc9
1 changed files with 6 additions and 0 deletions
|
@ -195,11 +195,17 @@ bs_time_t tm_get_next_timer_abstime(void)
|
||||||
|
|
||||||
bs_time_t tm_hw_time_to_abs_time(bs_time_t hwtime)
|
bs_time_t tm_hw_time_to_abs_time(bs_time_t hwtime)
|
||||||
{
|
{
|
||||||
|
if (hwtime == TIME_NEVER) {
|
||||||
|
return TIME_NEVER;
|
||||||
|
}
|
||||||
return hwtime + hw_time_delta;
|
return hwtime + hw_time_delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
bs_time_t tm_abs_time_to_hw_time(bs_time_t abstime)
|
bs_time_t tm_abs_time_to_hw_time(bs_time_t abstime)
|
||||||
{
|
{
|
||||||
|
if (abstime == TIME_NEVER) {
|
||||||
|
return TIME_NEVER;
|
||||||
|
}
|
||||||
return abstime - hw_time_delta;
|
return abstime - hw_time_delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue