]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Removed duplicate debug message code and surrounded it with IFDEF as needed
authorobones <obones@free.fr>
Wed, 10 Feb 2016 10:18:50 +0000 (11:18 +0100)
committertmk <hasu@tmk-kbd.com>
Tue, 16 Feb 2016 23:18:46 +0000 (08:18 +0900)
tmk_core/protocol/ps2_mouse.c

index c3e8b3c1c3354753cc3ce12d902c6978caf8af16..7d23cbede330d3d0e7d1d821c65b1e01b5d243fe 100644 (file)
@@ -85,23 +85,19 @@ void ps2_mouse_task(void)
         if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");
         return;
     }
-        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");
+    
+#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
-        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.