Skip to content

Commit

Permalink
mtimer
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Aug 22, 2024
1 parent 1ec0004 commit 7a27e95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/risc-v/src/common/riscv_mtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static int riscv_tick_start(struct oneshot_lowerhalf_s *lower,
struct riscv_mtimer_lowerhalf_s *priv =
(struct riscv_mtimer_lowerhalf_s *)lower;
uint64_t mtime = riscv_mtimer_get_mtime(priv);
uint64_t alarm = mtime + ticks * priv->freq / MSEC_PER_SEC;
uint64_t alarm = mtime + ticks * priv->freq / TICK_PER_SEC;

if (alarm < mtime)
{
Expand Down Expand Up @@ -277,7 +277,7 @@ static int riscv_tick_cancel(struct oneshot_lowerhalf_s *lower,
mtime = riscv_mtimer_get_mtime(priv);
if (alarm > mtime)
{
*ticks = (alarm - mtime) * MSEC_PER_SEC / priv->freq;
*ticks = (alarm - mtime) * TICK_PER_SEC / priv->freq;
}
else
{
Expand Down Expand Up @@ -317,7 +317,7 @@ static int riscv_tick_current(struct oneshot_lowerhalf_s *lower,

DEBUGASSERT(ticks != NULL);

*ticks = riscv_mtimer_get_mtime(priv) / (priv->freq / MSEC_PER_SEC);
*ticks = riscv_mtimer_get_mtime(priv) / (priv->freq / TICK_PER_SEC);

return 0;
}
Expand Down

0 comments on commit 7a27e95

Please sign in to comment.