Commit graph

6 commits

Author SHA1 Message Date
iosen
b1f7a0493f sntp: calibrate to the ntp times rather than the system function.
The system sdk_system_rtc_clock_cali_proc() is rather noisy, so
this patch calibrates the RTC count to the NTP time responses.

An average of many calls to sdk_system_rtc_clock_cali_proc() is used
for initialization.

The system calibration value is used to limit the calibration value
computed via the ntp times, to 1/16 either way.

A 64 bit RTC counter is implemented, and used in the calculations, but
might be of some use on its own.

The ratio of the ntp time differences and the RTC count differences is
filtered a little to keep the changes relatively stable and to filter
the jitter.
2016-07-02 01:38:51 +10:00
doragasu
11c9031d9b Removed my _time() implementation to use newlib provided one. 2016-03-31 16:05:15 +02:00
doragasu
9651692ca2 Cleanup and some changes to make implementation a bit more conforming to the standard. 2016-03-13 18:29:30 +01:00
doragasu
f14025b1c7 Removed non working clock_* calls from example. Using vars for tz and dst. 2016-03-13 17:04:03 +01:00
doragasu
0482aebf7d Added quick and dirty _gettimeofday_r() test implementation. 2016-03-11 13:11:15 +01:00
doragasu
16c831fffa Added sntp support and example 2016-03-09 17:18:51 +01:00