Skip to content

Commit

Permalink
[Keyboard] Preserve signedness from opt_encoder_handler for scroll da…
Browse files Browse the repository at this point in the history
…ta on ploopy devices (qmk#12223)
  • Loading branch information
sbuller authored and mrtnee committed Nov 20, 2021
1 parent c47cdf9 commit b69c1e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion keyboards/ploopyco/mouse/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ __attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
uint16_t p2 = adc_read(OPT_ENC2_MUX);
if (debug_encoder) dprintf("OPT1: %d, OPT2: %d\n", p1, p2);

uint8_t dir = opt_encoder_handler(p1, p2);
int dir = opt_encoder_handler(p1, p2);

if (dir == 0) return;
process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE)));
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ploopyco/trackball/trackball.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ __attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
uint16_t p2 = adc_read(OPT_ENC2_MUX);
if (debug_encoder) dprintf("OPT1: %d, OPT2: %d\n", p1, p2);

uint8_t dir = opt_encoder_handler(p1, p2);
int dir = opt_encoder_handler(p1, p2);

if (dir == 0) return;
process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE)));
Expand Down

0 comments on commit b69c1e4

Please sign in to comment.