Skip to content

Commit

Permalink
[ADAPTER] Fix sign of 8 bits logical min & max in HID parser
Browse files Browse the repository at this point in the history
  • Loading branch information
darthcloud committed Feb 5, 2024
1 parent 0769da5 commit 789cca8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main/adapter/hid_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void hid_parser(struct bt_data *bt_data, uint8_t *data, uint32_t len) {
desc++;
break;
case HID_GI_LOGICAL_MIN(1): /* 0x15 */
hid_stack[hid_stack_idx].logical_min = *desc++;
hid_stack[hid_stack_idx].logical_min = *(int8_t *)desc++;
break;
case HID_GI_LOGICAL_MIN(2): /* 0x16 */
hid_stack[hid_stack_idx].logical_min = *(int16_t *)desc;
Expand All @@ -310,7 +310,7 @@ void hid_parser(struct bt_data *bt_data, uint8_t *data, uint32_t len) {
desc += 4;
break;
case HID_GI_LOGICAL_MAX(1): /* 0x25 */
hid_stack[hid_stack_idx].logical_max = *desc++;
hid_stack[hid_stack_idx].logical_max = *(int8_t *)desc++;
break;
case HID_GI_LOGICAL_MAX(2): /* 0x26 */
hid_stack[hid_stack_idx].logical_max = *(int16_t *)desc;
Expand Down

0 comments on commit 789cca8

Please sign in to comment.