X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Fps2_mouse.c;h=4702f12c4042c20f5176a41521d0f422ff3b67d8;hb=54a06c2520f6de4b33558b2203d6706a988d291c;hp=ff730196c6b0f480315b61653cde969a650bbbc2;hpb=d7f663a1ea4487a6dc5be76085eff7b00bec9704;p=max%2Ftmk_keyboard.git diff --git a/protocol/ps2_mouse.c b/protocol/ps2_mouse.c index ff730196..4702f12c 100644 --- a/protocol/ps2_mouse.c +++ b/protocol/ps2_mouse.c @@ -22,23 +22,15 @@ along with this program. If not, see . #include "ps2_mouse.h" #include "report.h" #include "host.h" - -#define PS2_MOUSE_DEBUG -#ifdef PS2_MOUSE_DEBUG -# include "print.h" -# include "debug.h" -#else -# define print(s) -# define phex(h) -# define phex16(h) -#endif +#include "timer.h" +#include "print.h" +#include "debug.h" static report_mouse_t mouse_report = {}; -static void ps2_mouse_print_raw_data(void); -static void ps2_mouse_print_usb_data(void); +static void print_usb_data(void); /* supports only 3 button mouse at this time */ @@ -55,20 +47,15 @@ uint8_t ps2_mouse_init(void) { phex(rcv); phex(ps2_error); print("\n"); // read completion code of BAT - rcv = ps2_host_recv(); + rcv = ps2_host_recv_response(); print("ps2_mouse_init: read BAT: "); phex(rcv); phex(ps2_error); print("\n"); // read Device ID - rcv = ps2_host_recv(); + rcv = ps2_host_recv_response(); print("ps2_mouse_init: read DevID: "); phex(rcv); phex(ps2_error); print("\n"); - // send Enable Data Reporting - rcv = ps2_host_send(0xF4); - print("ps2_mouse_init: send 0xF4: "); - phex(rcv); phex(ps2_error); print("\n"); - // send Set Remote mode rcv = ps2_host_send(0xF0); print("ps2_mouse_init: send 0xF0: "); @@ -77,10 +64,6 @@ uint8_t ps2_mouse_init(void) { return 0; } -/* scroll support - * TODO: should be build option - */ -#define PS2_MOUSE_SCROLL_BUTTON 0x04 #define X_IS_NEG (mouse_report.buttons & (1<