diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-07-09 12:18:30 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-07-09 12:25:19 -0400 |
commit | e1833e020a078a2cb6e24a4dfbddac3fb6303256 (patch) | |
tree | a54712a34a472969d342f6259d25490221dbe129 | |
parent | 4125e176b7182a57cfece15718bda040daa50fa7 (diff) | |
download | kutter-e1833e020a078a2cb6e24a4dfbddac3fb6303256.tar.gz kutter-e1833e020a078a2cb6e24a4dfbddac3fb6303256.tar.xz kutter-e1833e020a078a2cb6e24a4dfbddac3fb6303256.zip |
chelper: Use CLOCK_MONOTONIC_RAW
Switch the host code from the CLOCK_MONOTONIC clock to the Linux
specific CLOCK_MONOTONIC_RAW clock. It's common for ntp to slew the
CLOCK_MONOTONIC clock to account for drift, and that can break the
host's ability to make accurate predictions of the micro-controller
clock. This could lead to "move queue empty" errors. The
CLOCK_MONOTONIC_RAW clock is not slewed and thus should not have this
problem.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/chelper/pyhelper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/klippy/chelper/pyhelper.c b/klippy/chelper/pyhelper.c index 947e5ee1..a0a42923 100644 --- a/klippy/chelper/pyhelper.c +++ b/klippy/chelper/pyhelper.c @@ -18,7 +18,7 @@ double __visible get_monotonic(void) { struct timespec ts; - int ret = clock_gettime(CLOCK_MONOTONIC, &ts); + int ret = clock_gettime(CLOCK_MONOTONIC_RAW, &ts); if (ret) { report_errno("clock_gettime", ret); return 0.; |