mirror of https://github.com/Desuuuu/klipper.git
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>
This commit is contained in:
parent
4125e176b7
commit
e1833e020a
|
@ -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.;
|
||||
|
|
Loading…
Reference in New Issue