Skip to content

Commit

Permalink
fix(esp_hid): Fixed protocol mode mapping bug
Browse files Browse the repository at this point in the history
Closes #14232
  • Loading branch information
boblane1 committed Sep 5, 2024
1 parent 7079d50 commit 6464747
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/esp_hid/src/bt_hidd.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,9 @@ void bt_hidd_cb(esp_hidd_cb_event_t event, esp_hidd_cb_param_t *param)
}
case ESP_HIDD_SET_PROTOCOL_EVT: {
if (param->set_protocol.protocol_mode != ESP_HIDD_UNSUPPORTED_MODE) {
if (s_hidd_param.dev->protocol_mode == param->set_protocol.protocol_mode) {
break;
}
osi_mutex_lock(&s_hidd_param.mutex, OSI_MUTEX_MAX_TIMEOUT);
s_hidd_param.dev->protocol_mode = param->set_protocol.protocol_mode;
s_hidd_param.dev->protocol_mode =
param->set_protocol.protocol_mode ? ESP_HID_PROTOCOL_MODE_BOOT : ESP_HID_PROTOCOL_MODE_REPORT;
osi_mutex_unlock(&s_hidd_param.mutex);
cb_param.protocol_mode.dev = s_hidd_param.dev->dev;
cb_param.protocol_mode.protocol_mode = s_hidd_param.dev->protocol_mode;
Expand Down

0 comments on commit 6464747

Please sign in to comment.