From 9d6b6ccc164a3328fdc0e0aabcb645f3a7c187fc Mon Sep 17 00:00:00 2001 From: Jacki Date: Wed, 17 Apr 2024 02:03:27 +0200 Subject: [PATCH] Fix draining cpu by usage of blocking Signed-off-by: Jacki --- src/driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver.c b/src/driver.c index 4407073..e33e4bc 100644 --- a/src/driver.c +++ b/src/driver.c @@ -109,7 +109,7 @@ int main(int argc, const char** argv) { device3_clear(&dev3); device3_calibrate(&dev3, 1000, true, true, false); - while (DEVICE3_ERROR_NO_ERROR == device3_read(&dev3, 0)); + while (DEVICE3_ERROR_NO_ERROR == device3_read(&dev3, -1)); device3_close(&dev3); return 0; } else { @@ -122,7 +122,7 @@ int main(int argc, const char** argv) { } device4_clear(&dev4); - while (DEVICE4_ERROR_NO_ERROR == device4_read(&dev4, 0)); + while (DEVICE4_ERROR_NO_ERROR == device4_read(&dev4, -1)); device4_close(&dev4); exit: