1
0
Fork 0

[Keyboard] Preserve signedness from opt_encoder_handler for scroll data on ploopy devices (#12223)

This commit is contained in:
sbuller 2021-03-24 20:33:06 -05:00 committed by GitHub
parent 653ecf91c2
commit 97a73637e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -96,7 +96,7 @@ __attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
uint16_t p2 = adc_read(OPT_ENC2_MUX); uint16_t p2 = adc_read(OPT_ENC2_MUX);
if (debug_encoder) dprintf("OPT1: %d, OPT2: %d\n", p1, p2); 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; if (dir == 0) return;
process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE))); process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE)));

View file

@ -96,7 +96,7 @@ __attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
uint16_t p2 = adc_read(OPT_ENC2_MUX); uint16_t p2 = adc_read(OPT_ENC2_MUX);
if (debug_encoder) dprintf("OPT1: %d, OPT2: %d\n", p1, p2); 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; if (dir == 0) return;
process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE))); process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE)));