Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Commit fb86bf2

Browse files
committed
[ADAPTER] Do not set type to KB on first KB usage found
1 parent d018292 commit fb86bf2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main/adapter/hid_parser.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static uint32_t hid_usage_is_used(uint32_t page, uint32_t usage) {
228228

229229
static int32_t hid_report_fingerprint(struct hid_report *report) {
230230
int32_t type = REPORT_NONE;
231-
for (uint32_t i = 0; i < REPORT_MAX_USAGE; i++) {
231+
for (uint32_t i = 0; i < report->usage_cnt; i++) {
232232
if (report->usages[i].usage_page) {
233233
switch (report->usages[i].usage_page) {
234234
case USAGE_GEN_DESKTOP:
@@ -249,7 +249,8 @@ static int32_t hid_report_fingerprint(struct hid_report *report) {
249249
}
250250
break;
251251
case USAGE_GEN_KEYBOARD:
252-
return KB;
252+
type = KB;
253+
break;
253254
case USAGE_GEN_BUTTON:
254255
type = PAD;
255256
break;

0 commit comments

Comments
 (0)