From eb9ec0be3e9626d0a423c0b5a32b18b784652a94 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 27 Jun 2024 09:10:42 +0200 Subject: [PATCH] Revert "libstb-hal: Fix compatibility issues with struct input_event time assignment" This reverts commit 9183928d8509a8c4060d0f1efb16d2ab9c248934. --- libarmbox/hdmi_cec.cpp | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/libarmbox/hdmi_cec.cpp b/libarmbox/hdmi_cec.cpp index cbf2713..8806d53 100644 --- a/libarmbox/hdmi_cec.cpp +++ b/libarmbox/hdmi_cec.cpp @@ -790,42 +790,13 @@ void hdmi_cec::rc_sync(int fd) { struct input_event ev; - struct timeval tv; - gettimeofday(&tv, NULL); - - // Depending on the structure definition in input.h, assign the time values -#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL__) - ev.time.tv_sec = tv.tv_sec; - ev.time.tv_usec = tv.tv_usec; -#else - ev.__sec = tv.tv_sec; - ev.__usec = tv.tv_usec; -#endif - + gettimeofday(&ev.time, NULL); ev.type = EV_SYN; ev.code = SYN_REPORT; ev.value = 0; - - ssize_t bytes_written = write(fd, &ev, sizeof(ev)); - - // Debugging information - if (bytes_written != sizeof(ev)) - { - hal_info(RED "[CEC] Error writing sync event to device\n" NORMAL); - } - else - { - hal_info(GREEN "[CEC] Sync event written successfully\n" NORMAL); - -#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL__) - hal_info(GREEN "[CEC] Event time: %ld.%06ld\n" NORMAL, ev.time.tv_sec, ev.time.tv_usec); -#else - hal_info(GREEN "[CEC] Event time: %ld.%06ld\n" NORMAL, ev.__sec, ev.__usec); -#endif - } + write(fd, &ev, sizeof(ev)); } - void hdmi_cec::send_key(unsigned char key, unsigned char destination) { struct cec_message txmessage;