fix(usb_host): Dont abort on unsupported client events

- suspend and resume client events
This commit is contained in:
peter.marcisovsky
2025-12-04 16:32:01 +01:00
parent 22316a3570
commit 99aa407cf1
5 changed files with 10 additions and 8 deletions

View File

@@ -67,9 +67,8 @@ static void handle_event(const cdc_acm_host_dev_event_data_t *event, void *user_
case CDC_ACM_HOST_SERIAL_STATE:
ESP_LOGI(TAG, "Serial state notif 0x%04X", event->data.serial_state.val);
break;
case CDC_ACM_HOST_NETWORK_CONNECTION:
default:
ESP_LOGW(TAG, "Unsupported CDC event: %i", event->type);
ESP_LOGW(TAG, "Unsupported CDC event: %d (possibly suspend/resume)", event->type);
break;
}
}

View File

@@ -502,8 +502,9 @@ void hid_host_interface_callback(hid_host_device_handle_t hid_device_handle,
hid_proto_name_str[dev_params.proto]);
break;
default:
ESP_LOGE(TAG, "HID Device, protocol '%s' Unhandled event",
hid_proto_name_str[dev_params.proto]);
ESP_LOGW(TAG, "HID Device, protocol '%s' Unhandled event: %d (possibly suspend/resume)",
hid_proto_name_str[dev_params.proto],
event);
break;
}
}

View File

@@ -264,6 +264,8 @@ static void msc_event_cb(const msc_host_event_t *event, void *arg)
.data.device_handle = event->device.handle,
};
xQueueSend(app_queue, &message, portMAX_DELAY);
} else {
ESP_LOGW(TAG, "Unsupported MSC event: %d (possibly suspend/resume)", event->event);
}
}

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -80,8 +80,8 @@ static void client_event_cb(const usb_host_client_event_msg_t *event_msg, void *
xSemaphoreGive(driver_obj->constant.mux_lock);
break;
default:
// Should never occur
abort();
ESP_LOGW(TAG, "Unsupported client event: %d (possibly suspend/resume)", event_msg->event);
break;
}
}

View File

@@ -114,7 +114,7 @@ static void stream_callback(const uvc_host_stream_event_data_t *event, void *use
ESP_LOGW(TAG, "Frame buffer underflow");
break;
default:
abort();
ESP_LOGW(TAG, "Unsupported UVC event: %d (possibly suspend/resume)", event->type);
break;
}
}