parent
bf6de46d7f
commit
2cb35373c6
7 changed files with 82 additions and 37 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue