rename tusb_hal_tick_get to tusb_hal_millis

rename TUSB_CFG_TICKS_HZ to BOARD_TICKS_HZ
This commit is contained in:
hathach
2018-03-29 18:03:04 +07:00
parent 43bf760f81
commit e2f9744369
19 changed files with 49 additions and 52 deletions

View File

@@ -53,7 +53,7 @@
//--------------------------------------------------------------------+
// TICK API
//--------------------------------------------------------------------+
#define osal_tick_get tusb_hal_tick_get
#define osal_millis tusb_hal_millis
//--------------------------------------------------------------------+
// TASK API
@@ -97,9 +97,9 @@ static inline osal_task_t osal_task_create(osal_func_t code, const char* name, u
#define osal_task_delay(msec) \
do {\
_timeout = osal_tick_get();\
_timeout = osal_millis();\
_state = __LINE__; case __LINE__:\
if ( _timeout + osal_tick_from_msec(msec) > osal_tick_get() ) \
if ( _timeout + msec > osal_millis() ) \
return TUSB_ERROR_OSAL_WAITING;\
}while(0)
@@ -164,10 +164,10 @@ static inline void osal_queue_flush(osal_queue_t const queue_hdl)
#define osal_queue_receive(queue_hdl, p_data, msec, p_error) \
do {\
_timeout = osal_tick_get();\
_timeout = osal_millis();\
_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 ( (msec != OSAL_TIMEOUT_WAIT_FOREVER) && ( _timeout + msec <= osal_millis()) ) /* time out */ \
*(p_error) = TUSB_ERROR_OSAL_TIMEOUT;\
else\
return TUSB_ERROR_OSAL_WAITING;\
@@ -218,10 +218,10 @@ static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl)
#define osal_semaphore_wait(sem_hdl, msec, p_error) \
do {\
_timeout = osal_tick_get();\
_timeout = osal_millis();\
_state = __LINE__; case __LINE__:\
if( sem_hdl->count == 0 ) {\
if ( ( ((uint32_t) (msec)) != OSAL_TIMEOUT_WAIT_FOREVER) && (_timeout + osal_tick_from_msec(msec) <= osal_tick_get()) ) /* time out */ \
if ( (msec != OSAL_TIMEOUT_WAIT_FOREVER) && (_timeout + msec <= osal_millis()) ) /* time out */ \
*(p_error) = TUSB_ERROR_OSAL_TIMEOUT;\
else\
return TUSB_ERROR_OSAL_WAITING;\