From 6360eb308c4b81d5effde77e9b0f357dd9673696 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 17 Feb 2016 08:23:47 +0900 Subject: [PATCH] core: Fix ps2_mouse.c debug print --- tmk_core/protocol/ps2_mouse.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tmk_core/protocol/ps2_mouse.c b/tmk_core/protocol/ps2_mouse.c index 7d23cbed..b0f77a83 100644 --- a/tmk_core/protocol/ps2_mouse.c +++ b/tmk_core/protocol/ps2_mouse.c @@ -85,19 +85,19 @@ void ps2_mouse_task(void) if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n"); return; } - -#ifdef PS2_MOUSE_DEBUG - xprintf("%ud ", timer_read()); - print("ps2_mouse raw: ["); - phex(mouse_report.buttons); print("|"); - print_hex8((uint8_t)mouse_report.x); print(" "); - print_hex8((uint8_t)mouse_report.y); print("]\n"); -#endif /* if mouse moves or buttons state changes */ if (mouse_report.x || mouse_report.y || ((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) { +#ifdef PS2_MOUSE_DEBUG + xprintf("%ud ", timer_read()); + print("ps2_mouse raw: ["); + phex(mouse_report.buttons); print("|"); + print_hex8((uint8_t)mouse_report.x); print(" "); + print_hex8((uint8_t)mouse_report.y); print("]\n"); +#endif + buttons_prev = mouse_report.buttons; // PS/2 mouse data is '9-bit integer'(-256 to 255) which is comprised of sign-bit and 8-bit value. -- 2.46.2