1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <stdint.h>
- #include "report.h"
- #include "host.h"
- #include "timer.h"
- #include "print.h"
- #include "debug.h"
- #include "pointing_device.h"
- static report_mouse_t mouseReport = {};
- __attribute__((weak)) bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old) { return (new.buttons != old.buttons) || (new.x&& new.x != old.x) || (new.y&& new.y != old.y) || (new.h&& new.h != old.h) || (new.v&& new.v != old.v); }
- __attribute__((weak)) void pointing_device_init(void) {
-
- }
- __attribute__((weak)) void pointing_device_send(void) {
- static report_mouse_t old_report = {};
-
- if (has_mouse_report_changed(mouseReport, old_report)) {
- host_mouse_send(&mouseReport);
- }
-
- mouseReport.x = 0;
- mouseReport.y = 0;
- mouseReport.v = 0;
- mouseReport.h = 0;
- old_report = mouseReport;
- }
- __attribute__((weak)) void pointing_device_task(void) {
-
-
-
-
-
-
-
- pointing_device_send();
- }
- report_mouse_t pointing_device_get_report(void) { return mouseReport; }
- void pointing_device_set_report(report_mouse_t newMouseReport) { mouseReport = newMouseReport; }
|