Skip to content

Commit

Permalink
Fix denominator for DelayMs/GetMs in timer handle
Browse files Browse the repository at this point in the history
  • Loading branch information
ndonald2 committed Oct 28, 2024
1 parent bd13385 commit 201235f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/per/tim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ uint32_t TimerHandle::Impl::GetTick()

uint32_t TimerHandle::Impl::GetMs()
{
return GetTick() / (GetFreq() / 100000000);
return GetTick() / (GetFreq() / 1000);
}
uint32_t TimerHandle::Impl::GetUs()
{
Expand All @@ -227,7 +227,7 @@ void TimerHandle::Impl::DelayTick(uint32_t del)

void TimerHandle::Impl::DelayMs(uint32_t del)
{
DelayTick(del * (GetFreq() / 100000000));
DelayTick(del * (GetFreq() / 1000));
}

void TimerHandle::Impl::DelayUs(uint32_t del)
Expand Down

0 comments on commit 201235f

Please sign in to comment.