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. |
||
|---|---|---|
| .. | ||
| component.mk | ||
| sntp.c | ||
| sntp.h | ||
| sntp_fun.c | ||