From d7f663a1ea4487a6dc5be76085eff7b00bec9704 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 20 Nov 2013 11:19:59 +0900 Subject: Fix to build ps2_mouse with both LUFA and PJRC - change API of ps2_mouse; ps2_mouse_task() - remove mouse_report from host.c --- protocol/ps2_mouse.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'protocol/ps2_mouse.h') diff --git a/protocol/ps2_mouse.h b/protocol/ps2_mouse.h index 4529ce1132..305a9bdbaa 100644 --- a/protocol/ps2_mouse.h +++ b/protocol/ps2_mouse.h @@ -20,6 +20,16 @@ along with this program. If not, see . #include +#define PS2_MOUSE_READ_DATA 0xEB + +/* + * Data format: + * byte|7 6 5 4 3 2 1 0 + * ----+-------------------------------------------------------------- + * 0|Yovflw Xovflw Ysign Xsign 1 Middle Right Left + * 1| X movement(0-255) + * 2| Y movement(0-255) + */ #define PS2_MOUSE_BTN_MASK 0x07 #define PS2_MOUSE_BTN_LEFT 0 #define PS2_MOUSE_BTN_RIGHT 1 @@ -29,16 +39,7 @@ along with this program. If not, see . #define PS2_MOUSE_X_OVFLW 6 #define PS2_MOUSE_Y_OVFLW 7 -bool ps2_mouse_enable; -extern uint8_t ps2_mouse_x; -extern uint8_t ps2_mouse_y; -extern uint8_t ps2_mouse_btn; -extern uint8_t ps2_mouse_error_count; - uint8_t ps2_mouse_init(void); -uint8_t ps2_mouse_read(void); -bool ps2_mouse_changed(void); -void ps2_mouse_usb_send(void); -void ps2_mouse_print(void); +void ps2_mouse_task(void); #endif -- cgit v1.2.3 From c6abcb6d893f6ef843ed98be3d45bd804cfe295a Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 20 Nov 2013 15:28:58 +0900 Subject: Add build options of ps2_mouse --- protocol/ps2_mouse.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'protocol/ps2_mouse.h') diff --git a/protocol/ps2_mouse.h b/protocol/ps2_mouse.h index 305a9bdbaa..27d9790d43 100644 --- a/protocol/ps2_mouse.h +++ b/protocol/ps2_mouse.h @@ -39,6 +39,27 @@ along with this program. If not, see . #define PS2_MOUSE_X_OVFLW 6 #define PS2_MOUSE_Y_OVFLW 7 + +/* + * Scroll by mouse move with pressing button + */ +/* mouse button to start scrolling; set 0 to disable scroll */ +#ifndef PS2_MOUSE_SCROLL_BTN_MASK +#define PS2_MOUSE_SCROLL_BTN_MASK (1<