Browse Source

core: Fix ps2_mouse.c debug print

tags/v2.9
tmk 8 years ago
parent
commit
6360eb308c
1 changed files with 8 additions and 8 deletions
  1. 8
    8
      tmk_core/protocol/ps2_mouse.c

+ 8
- 8
tmk_core/protocol/ps2_mouse.c View File

if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n"); if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");
return; 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 moves or buttons state changes */
if (mouse_report.x || mouse_report.y || if (mouse_report.x || mouse_report.y ||
((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) { ((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; 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.

Loading…
Cancel
Save