PaulStoffregen/Time

[Feature suggestion] Include pulse-per-second support

cyberman54 opened this issue · 0 comments

Include interpretation of a pulse-per-second (pps) signal from an external highly precise time source (e.g. GPS or RTC chip) to keep systTime accurat with precision <100ms.

Suggestion:

  • using a callback function that is triggered by pps hardware interrupt every 1000ms (or configurable period)
  • considering constant phase shift between pps signal and time of day
  • optional considering drift of phase shift over time by some correction algorithm
  • API: setSyncProvider (void * &pps_CB_interrupt, uint32_t phaseshift_microsecs)

Phase shift could be estimated by user function, e.g. getting an accurate timestamp from external time source and comparing it with sysTime.