diff options
| author | hathach <[email protected]> | 2013-10-27 16:48:09 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-10-27 16:48:09 +0700 |
| commit | 0d9e1163dfd4e12b57674cb893b427fce40ba402 (patch) | |
| tree | 46723440e01a6d5370f78b8fa15d980282217075 /tinyusb/osal | |
| parent | eb39d88360a56fefc3d62de93ca4655ab150b174 (diff) | |
fix osal_none timeout, instant return with OSAL_TIMEOUT_NOTIMEOUT
Diffstat (limited to 'tinyusb/osal')
| -rw-r--r-- | tinyusb/osal/osal_none.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 775febc3f..ee7c2fdd2 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -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;\ |
