From 7e38155d2e69ad326df1935d1da84b7a02c4275a Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 11 Nov 2023 01:56:37 +0100 Subject: [PATCH] Debug output --- input_dev.c | 6 +++--- input_dev.h | 2 ++ output_dev.c | 2 +- output_dev.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/input_dev.c b/input_dev.c index 635f16f..427e281 100644 --- a/input_dev.c +++ b/input_dev.c @@ -176,14 +176,14 @@ static void* input_read_thread_func(void* ptr) { // TODO: perform a memove fprintf(stderr, "MEMMOVE NEEDED\n"); } else { - /* +#if defined(INCLUDE_INPUT_DEBUG) printf( - "Event: %s %s %d\n", + "Input: %s %s %d\n", libevdev_event_type_get_name(read_ev.type), libevdev_event_code_get_name(read_ev.type, read_ev.code), read_ev.value ); - */ +#endif // just copy the input event msg->ev[msg->ev_count] = read_ev; diff --git a/input_dev.h b/input_dev.h index e40cd88..4767c92 100644 --- a/input_dev.h +++ b/input_dev.h @@ -2,6 +2,8 @@ #include "queue.h" +#define INCLUDE_INPUT_DEBUG + #define INPUT_DEV_CTRL_FLAG_EXIT 0x00000001U typedef enum input_dev_type { diff --git a/output_dev.c b/output_dev.c index 77ecd68..05e15be 100644 --- a/output_dev.c +++ b/output_dev.c @@ -377,7 +377,7 @@ void *output_dev_thread_func(void *ptr) { ev.code = BTN_TL2; } -#if defined(INCLUDE_DEBUG) +#if defined(INCLUDE_OUTPUT_DEBUG) printf( "Received event %s (%s): %d\n", libevdev_event_type_get_name(ev.type), diff --git a/output_dev.h b/output_dev.h index dd7e6ea..36429f2 100644 --- a/output_dev.h +++ b/output_dev.h @@ -32,7 +32,7 @@ #define GYRO_DEADZONE 1 // degrees/s to count as zero movement #undef INCLUDE_TIMESTAMP -#define INCLUDE_DEBUG +#define INCLUDE_OUTPUT_DEBUG typedef enum output_dev_type { output_dev_gamepad,