feat(class): add usb_osal_thread_schedule_other to allow the applications which use the struct usbh_xxx to exit properly before free struct usbh_xxx
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -25,6 +25,18 @@ void usb_osal_thread_delete(usb_osal_thread_t thread)
|
||||
vTaskDelete(thread);
|
||||
}
|
||||
|
||||
void usb_osal_thread_schedule_other(void)
|
||||
{
|
||||
TaskHandle_t xCurrentTask = xTaskGetCurrentTaskHandle();
|
||||
const UBaseType_t old_priority = uxTaskPriorityGet(xCurrentTask);
|
||||
|
||||
vTaskPrioritySet(xCurrentTask, tskIDLE_PRIORITY);
|
||||
|
||||
taskYIELD();
|
||||
|
||||
vTaskPrioritySet(xCurrentTask, old_priority);
|
||||
}
|
||||
|
||||
usb_osal_sem_t usb_osal_sem_create(uint32_t initial_count)
|
||||
{
|
||||
return (usb_osal_sem_t)xSemaphoreCreateCounting(1, initial_count);
|
||||
|
||||
Reference in New Issue
Block a user