From aab92b40d2e904e8ad85386e4a4f3b59e84eb844 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 1 Feb 2013 12:00:34 +0700 Subject: change osal_timeout_t to uint32_t implement osal_tick_get & osal_tick_tock for osal_none implement timeout for osal_semaphore_wait --- tinyusb/osal/osal_common.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tinyusb/osal/osal_common.h') diff --git a/tinyusb/osal/osal_common.h b/tinyusb/osal/osal_common.h index 62a21ae74..24428e614 100644 --- a/tinyusb/osal/osal_common.h +++ b/tinyusb/osal/osal_common.h @@ -56,13 +56,13 @@ #endif #include "common/common.h" - //typedef void (*pfTask)( void * ); enum { OSAL_TIMEOUT_NOTIMEOUT = 0, // for use within ISR, return immediately - OSAL_TIMEOUT_WAIT_FOREVER = 1 + OSAL_TIMEOUT_WAIT_FOREVER = 1, + OSAL_TIMEOUT_NORMAL = 10 // default is 10 msec }; typedef enum { @@ -71,6 +71,12 @@ typedef enum { OSAL_PRIO_HIGH }osal_prio_t; +static inline uint32_t osal_tick_from_msec(uint32_t msec) ATTR_CONST ATTR_ALWAYS_INLINE; +static inline uint32_t osal_tick_from_msec(uint32_t msec) +{ + return (msec * TUSB_CFG_OS_TICKS_PER_SECOND)/1000; +} + #ifdef __cplusplus } #endif -- cgit v1.3.1