timesync code refactored

This commit is contained in:
Klaus K Wilting committed 2020-03-07 23:18:36 +01:00
1 parent 85c342e3d7
commit f5399d8108
3 files changed
+37 -58

No files matched your search

+4 -5
View File
@@ -5,12 +5,11 @@
#include "irqhandler.h"
#include "timekeeper.h"
#define TIME_SYNC_FRAME_LENGTH 0x07 // timeserver answer frame length [bytes]
#define TIME_SYNC_FRAME_LENGTH 6 // timeserver answer frame length [bytes]
#define TIME_SYNC_FIXUP 16 // compensation for processing time [milliseconds]
#define TIMEREQUEST_MAX_SEQNO 0xfe // threshold for wrap around seqno
#define TIMEREQUEST_END \
(TIMEREQUEST_MAX_SEQNO + 1) // marker for end of timesync handshake
#define GPS_UTC_DIFF 315964800
#define TIMEREQUEST_MAX_SEQNO 0xfe // threshold for wrap around seqNo
#define TIMEREQUEST_END (TIMEREQUEST_MAX_SEQNO + 1) // end of handshake marker
#define GPS_UTC_DIFF 315964800 // seconds diff between gps and utc epoch
enum timesync_t {
timesync_tx,