Skip to content

Commit

Permalink
core: Fix ps2_mouse.c debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
tmk committed Feb 16, 2016
1 parent d79d925 commit de41aa1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions protocol/ps2_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit de41aa1

Please sign in to comment.