fix osal_none timeout, instant return with OSAL_TIMEOUT_NOTIMEOUT

This commit is contained in:
hathach 2013-10-27 16:48:09 +07:00
parent eb39d88360
commit 0d9e1163df
1 changed files with 3 additions and 3 deletions

View File

@ -202,7 +202,7 @@ static inline void osal_semaphore_reset(osal_semaphore_handle_t sem_hdl)
timeout = osal_tick_get();\
state = __LINE__; case __LINE__:\
if( *(sem_hdl) == 0 ) {\
if ( (msec != OSAL_TIMEOUT_WAIT_FOREVER) && (timeout + osal_tick_from_msec(msec) < osal_tick_get()) ) /* time out */ \
if ( (msec != OSAL_TIMEOUT_WAIT_FOREVER) && (timeout + osal_tick_from_msec(msec) <= osal_tick_get()) ) /* time out */ \
*(p_error) = TUSB_ERROR_OSAL_TIMEOUT;\
else\
return TUSB_ERROR_OSAL_WAITING;\
@ -315,8 +315,8 @@ static inline void osal_queue_flush(osal_queue_handle_t const queue_hdl)
do {\
timeout = osal_tick_get();\
state = __LINE__; case __LINE__:\
if( queue_hdl-> count == 0 ) {\
if ( (msec != OSAL_TIMEOUT_WAIT_FOREVER) && ( timeout + osal_tick_from_msec(msec) < osal_tick_get() )) /* time out */ \
if( queue_hdl->count == 0 ) {\
if ( (msec != OSAL_TIMEOUT_WAIT_FOREVER) && ( timeout + osal_tick_from_msec(msec) <= osal_tick_get() )) /* time out */ \
*(p_error) = TUSB_ERROR_OSAL_TIMEOUT;\
else\
return TUSB_ERROR_OSAL_WAITING;\