change osal_timeout_t to uint32_t

implement osal_tick_get & osal_tick_tock for osal_none
implement timeout for osal_semaphore_wait
This commit is contained in:
hathach
2013-02-01 12:00:34 +07:00
parent 9e3785e7e1
commit aab92b40d2
8 changed files with 73 additions and 28 deletions
+8 -2
View File
@@ -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