#include <avr/interrupt.h>
#include <util/delay.h>
#include "usb_mouse.h"
+#include "print.h"
+#include "debug.h"
+static bool is_sent = false;
+
// which buttons are currently pressed
uint8_t mouse_buttons=0;
UEDATX = x;
UEDATX = y;
UEDATX = wheel;
- //UEDATX = hwheel;
+ UEDATX = hwheel;
+
UEINTX = 0x3A;
SREG = intr_state;
+ is_sent = true;
return 0;
}
+
+void usb_mouse_clear(void) {
+ is_sent = false;
+}
+
+bool usb_mouse_is_sent(void) {
+ return is_sent;
+}
+
+void usb_mouse_print(int8_t mouse_x, int8_t mouse_y, int8_t wheel_v, int8_t wheel_h) {
+ if (!debug_mouse) return;
+ print("mouse btn|x y v h: ");
+ phex(mouse_buttons); print("|");
+ phex(mouse_x); print(" ");
+ phex(mouse_y); print(" ");
+ phex(wheel_v); print(" ");
+ phex(wheel_h); print("\n");
+}