mynewt-core icon indicating copy to clipboard operation
mynewt-core copied to clipboard

DA1469x: Clock time shifts on reboots

Open apc067 opened this issue 1 year ago • 5 comments

If the LP clock's frequency is not an integer multiple of the specified OS tick frequency, the period of OS ticks will be incorrect due to integer division truncation errors (to the tune of almost 1% for RCX), resulting in OS Time gradually creeping away from the actual time. This PR fixes the issue, by maintaining the fractional OS tick value and advance OS Time accordingly.

This PR also improves on the implementation of the DA1469x clock driver and updates the RTC divider registers after the selected LP clock is calibrated.

apc067 avatar Oct 17 '24 23:10 apc067

Number of functions are moved around that makes it harder to see what is new and what was really modified/added.

I see your concern; I separated the original commit into two, one only rearranges the functions with no changes whatsoever, and the second one adds the missing services to the API.

apc067 avatar Oct 22 '24 03:10 apc067

If your first commit does not change functionality is it really needed?

kasjer avatar Oct 22 '24 06:10 kasjer

Please don't move code around in .c files - this breaks git annotate

Yeah, keeping the git annotate may indeed outweigh the benefits of having the functions in a neat order. To that extent, should I keep the "da1469x/clock: Eliminate magic numbers" commit, or should I leave those lines unchanged as well?

apc067 avatar Oct 22 '24 23:10 apc067

Please don't move code around in .c files - this breaks git annotate

Yeah, keeping the git annotate may indeed outweigh the benefits of having the functions in a neat order. To that extent, should I keep the "da1469x/clock: Eliminate magic numbers" commit, or should I leave those lines unchanged as well?

Keep it, removing magic numbers is fine.

andrzej-kaczmarek avatar Oct 22 '24 23:10 andrzej-kaczmarek

Addressed all current reviewer comments.

apc067 avatar Oct 26 '24 00:10 apc067

yeap, looks ok after this typo and minor coding style is fixed:) Thanks!

sjanc avatar Oct 29 '24 11:10 sjanc