fix usb_osal_sem_take return val in rt-thread port

This commit is contained in:
sakumisu 2022-11-11 17:41:01 +08:00
parent 66db88b7cd
commit 582eb2a7ac

View File

@ -32,9 +32,9 @@ int usb_osal_sem_take(usb_osal_sem_t sem, uint32_t timeout)
rt_err_t result = RT_EOK;
result = rt_sem_take((rt_sem_t)sem, rt_tick_from_millisecond(timeout));
if (result == RT_ETIMEOUT) {
if (result == -RT_ETIMEOUT) {
ret = -ETIMEDOUT;
} else if (result == RT_ERROR) {
} else if (result == -RT_ERROR) {
ret = -EINVAL;
} else {
ret = 0;