1
0

core: Fix ps2_mouse.c debug print

This commit is contained in:
tmk 2016-02-17 08:23:47 +09:00
parent 5a9953b46c
commit 6360eb308c

View File

@ -86,6 +86,10 @@ void ps2_mouse_task(void)
return; return;
} }
/* 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 #ifdef PS2_MOUSE_DEBUG
xprintf("%ud ", timer_read()); xprintf("%ud ", timer_read());
print("ps2_mouse raw: ["); print("ps2_mouse raw: [");
@ -94,10 +98,6 @@ void ps2_mouse_task(void)
print_hex8((uint8_t)mouse_report.y); print("]\n"); print_hex8((uint8_t)mouse_report.y); print("]\n");
#endif #endif
/* if mouse moves or buttons state changes */
if (mouse_report.x || mouse_report.y ||
((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) {
buttons_prev = mouse_report.buttons; 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. // PS/2 mouse data is '9-bit integer'(-256 to 255) which is comprised of sign-bit and 8-bit value.