mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-06 12:26:20 +00:00
The USB infrastructure currently uses the system work queue for offloading transfers, CDC-ACM UART transmission/reception, and device firmware activities. This causes problems when the system work queue is also used to initiate some activities (such as UART) that normally complete without requiring an external thread: in that case the USB infrastructure is prevented from making progress because the system work queue is blocked waiting for the USB infrastructure to provide data. Break the dependency by allowing the USB infrastructure to use a dedicated work queue which doesn't depend on availability of the system work queue. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
30 lines
425 B
C
30 lines
425 B
C
/*
|
|
* Copyright (c) 2020 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef ZEPHYR_USB_WORK_Q_H_
|
|
#define ZEPHYR_USB_WORK_Q_H_
|
|
|
|
#include <kernel.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef CONFIG_USB_WORKQUEUE
|
|
|
|
extern struct k_work_q z_usb_work_q;
|
|
|
|
#define USB_WORK_Q z_usb_work_q
|
|
#else
|
|
#define USB_WORK_Q k_sys_work_q
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ZEPHYR_USB_WORK_Q_H_ */
|