I created a loop like that for the Trimble driver. The algorithm is pretty simple so I'm probably missing something; please check out the merge request I made a few days ago. I still need to test the changes with my simulator and with ntpd started with date offsets.
>Hal Murray hmurray at megapathdsl.net >Wed Apr 26 00:16:58 UTC 2017 > >>> You could use it as an example of how to do it right. >> Er, *what*? > >Fix the code. Do it right and cleanly. Add a comment pointing to the page >with a full description of the whole mess. Have that page point back there >as an example of how to fix the GPS week roll over problem. > >It's not as simple as > if (week < xx) week += 1024 >That only works for 20 years. You need something like: > while (week < xx) week += 1024 _______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel