1
0
Fork 0

Extended wheel reports (#24422)

extended wheel reports
This commit is contained in:
eynsai 2024-10-06 05:26:55 -04:00 committed by GitHub
parent bf6de46d7f
commit 2cb35373c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 82 additions and 37 deletions

View file

@ -391,7 +391,7 @@ const pointing_device_driver_t pointing_device_driver = {
};
#elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball)
mouse_xy_report_t pimoroni_trackball_adapt_values(clamp_range_t* offset) {
mouse_xy_report_t pimoroni_trackball_adapt_values(xy_clamp_range_t* offset) {
if (*offset > XY_REPORT_MAX) {
*offset -= XY_REPORT_MAX;
return (mouse_xy_report_t)XY_REPORT_MAX;
@ -406,10 +406,10 @@ mouse_xy_report_t pimoroni_trackball_adapt_values(clamp_range_t* offset) {
}
report_mouse_t pimoroni_trackball_get_report(report_mouse_t mouse_report) {
static uint16_t debounce = 0;
static uint8_t error_count = 0;
pimoroni_data_t pimoroni_data = {0};
static clamp_range_t x_offset = 0, y_offset = 0;
static uint16_t debounce = 0;
static uint8_t error_count = 0;
pimoroni_data_t pimoroni_data = {0};
static xy_clamp_range_t x_offset = 0, y_offset = 0;
if (error_count < PIMORONI_TRACKBALL_ERROR_COUNT) {
i2c_status_t status = read_pimoroni_trackball(&pimoroni_data);