From a46554db1ef7de5969d50c9d03428d1995ebfb13 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 Jul 2024 16:08:36 +0200 Subject: [PATCH] rcinput: Fix build issues with _TIME_BITS=64 - Updated rcinput.cpp to use input_event_sec and input_event_usec macros for accessing time members of input_event structure. - Included necessary headers for time functions and structures. - Ensured compatibility with various definitions of input_event structure as per input.h. This should resolves compilation errors related to accessing time members of input_event structure when _TIME_BITS=64 is defined. --- src/driver/rcinput.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 956a96216..365977198 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #ifdef KEYBOARD_INSTEAD_OF_REMOTE_CONTROL @@ -1338,7 +1339,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 * Everything would be much easier if we could use the post-kernel 3.4 * EVIOCSCLOCKID ioctl :-) */ struct timespec t1; - now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; + now_pressed = ev.input_event_sec * 1000000ULL + ev.input_event_usec; if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { struct timeval t2; gettimeofday(&t2, NULL);