[chore]: move and rename mouse/scroll min/max defines (#25141)

* protocol: move {XY/HV}_REPORT_{MIN,MAX} into report.h

..to allow easier re-use in other code implementations.

* protocol: rename {XY/HV}_REPORT_{MIN/MAX} to MOUSE_REPORT_{XY/HV}_{MIN/MAX}

..to avoid naming collisions.
This commit is contained in:
Stefan Kerkmann 2025-04-13 18:36:13 +02:00 committed by GitHub
parent d0611b0468
commit a7bf8e64a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 23 deletions

View file

@ -101,12 +101,12 @@ int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_di
}
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;
} else if (*offset < XY_REPORT_MIN) {
*offset += XY_REPORT_MAX;
return (mouse_xy_report_t)XY_REPORT_MIN;
if (*offset > MOUSE_REPORT_XY_MAX) {
*offset -= MOUSE_REPORT_XY_MAX;
return (mouse_xy_report_t)MOUSE_REPORT_XY_MAX;
} else if (*offset < MOUSE_REPORT_XY_MIN) {
*offset += MOUSE_REPORT_XY_MAX;
return (mouse_xy_report_t)MOUSE_REPORT_XY_MIN;
} else {
mouse_xy_report_t temp_return = *offset;
*offset = 0;