aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-07-09 12:18:30 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-07-09 12:25:19 -0400
commite1833e020a078a2cb6e24a4dfbddac3fb6303256 (patch)
treea54712a34a472969d342f6259d25490221dbe129
parent4125e176b7182a57cfece15718bda040daa50fa7 (diff)
downloadkutter-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.c2
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.;