diff options
| author | hathach <[email protected]> | 2013-02-01 10:33:43 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-01 10:33:43 +0700 |
| commit | 9e3785e7e1bd5bac3c8e24477edbde12cc09dd4b (patch) | |
| tree | c2233323659aeda002dbbcb6e910b669f1147aac /tinyusb/osal | |
| parent | 1b963f6a7117d754c47e860159ac0aa90d1db6dc (diff) | |
add std=gnu99 for test build
add hcd_init to usbh_init and update test code
add TUSB_CFG_OS_TICK_PER_SECOND define for TUSB_OS_NONE
change osal_semaphore_wait and osal_queue_receive API to have timeout effectively
Diffstat (limited to 'tinyusb/osal')
| -rw-r--r-- | tinyusb/osal/osal.h | 9 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index 0dfb73686..0c99e497f 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -76,6 +76,9 @@ typedef uint32_t osal_timeout_t; +//------------- Tick -------------// +uint32_t osal_tick_get(void); + //------------- Task -------------// typedef uint32_t osal_task_t; #define OSAL_TASK_DEF(name, code, stack_depth, prio) \ @@ -91,7 +94,7 @@ tusb_error_t osal_task_create(osal_task_t *task); typedef uint32_t osal_semaphore_t; typedef void* osal_semaphore_handle_t; osal_semaphore_handle_t osal_semaphore_create(osal_semaphore_t * const sem); -tusb_error_t osal_semaphore_wait(osal_semaphore_handle_t const sem_hdl, osal_timeout_t msec); +void osal_semaphore_wait(osal_semaphore_handle_t const sem_hdl, osal_timeout_t msec, tusb_error_t *p_error); tusb_error_t osal_semaphore_post(osal_semaphore_handle_t const sem_hdl); //------------- Queue -------------// @@ -101,7 +104,9 @@ typedef void* osal_queue_handle_t; #define OSAL_DEF_QUEUE(name, queue_depth, type) \ osal_queue_t name -osal_queue_handle_t osal_queue_create(osal_queue_t *queue); +osal_queue_handle_t osal_queue_create (osal_queue_t *p_queue); +void osal_queue_receive (osal_queue_handle_t const queue_hdl, uint32_t *p_data, osal_timeout_t msec, tusb_error_t *p_error); +tusb_error_t osal_queue_send (osal_queue_handle_t const queue_hdl, uint32_t data); #endif diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 6833ada24..84373b6de 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -106,7 +106,7 @@ static inline tusb_error_t osal_semaphore_post(osal_semaphore_handle_t const se return TUSB_ERROR_NONE; } -#define osal_semaphore_wait(sem_hdl, msec) \ +#define osal_semaphore_wait(sem_hdl, msec, p_error) \ do {\ state = __LINE__; case __LINE__:\ if( (*sem_hdl) == 0 ) \ |
