-
Hi, In SAMR34 port function RtcMs2Tick() is not taking into acount that the RTC clock is in fact 1,024kHz not 1kHz. If we set software timer to 1000ms we loose about 24ms (If I got it right)
I changed it to (we lose some precision anyway):
Now when I measure it with scope it is closer to value set by TimerSetValue(). Could you explain why the time is not converted? The stack must open the RX1 and RX2 windows precisely and the timer will cause about 24 and 48ms offset respectively! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks for reporting this issue. I would propose the following uint32_t RtcMs2Tick( uint32_t milliseconds )
{
return ( uint32_t )( ( ( ( uint64_t )milliseconds ) << 10 ) / 1000 );
} By applying the shift left by ten the result may not fit in a Could you please create a pull request? |
Beta Was this translation helpful? Give feedback.
Thanks for reporting this issue.
I would propose the following
By applying the shift left by ten the result may not fit in a
uint32_t
type.Could you please create a pull request?