diff options
| author | hathach <[email protected]> | 2013-02-01 12:00:34 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-01 12:25:02 +0700 |
| commit | aab92b40d2e904e8ad85386e4a4f3b59e84eb844 (patch) | |
| tree | f8099f4075a1e7612b6522d1c8902d56aa13b3f7 /tinyusb/osal/osal_common.h | |
| parent | 9e3785e7e1bd5bac3c8e24477edbde12cc09dd4b (diff) | |
change osal_timeout_t to uint32_t
implement osal_tick_get & osal_tick_tock for osal_none
implement timeout for osal_semaphore_wait
Diffstat (limited to 'tinyusb/osal/osal_common.h')
| -rw-r--r-- | tinyusb/osal/osal_common.h | 10 |
1 files changed, 8 insertions, 2 deletions
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 |
