diff options
| author | hathach <[email protected]> | 2013-03-12 00:10:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-12 00:10:52 +0700 |
| commit | 38ff7123b4f43aa85ce1848a0cb99bb73303cadd (patch) | |
| tree | 7ee7d6d883d6f0b11cefd98b8ff3e10572d581c1 /tinyusb/osal | |
| parent | 8eaad2326b26f542ba66ea305a40dd4c8e49f421 (diff) | |
add semaphore reset & queue flush API for osal
add semaphore reset when opening control pipe
Diffstat (limited to 'tinyusb/osal')
| -rw-r--r-- | tinyusb/osal/osal.h | 2 | ||||
| -rw-r--r-- | tinyusb/osal/osal_none.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h index 09b9560fb..720375321 100644 --- a/tinyusb/osal/osal.h +++ b/tinyusb/osal/osal.h @@ -153,6 +153,7 @@ typedef void* osal_semaphore_handle_t; osal_semaphore_handle_t osal_semaphore_create(osal_semaphore_t * const sem); void osal_semaphore_wait(osal_semaphore_handle_t const sem_hdl, uint32_t msec, tusb_error_t *p_error); tusb_error_t osal_semaphore_post(osal_semaphore_handle_t const sem_hdl); +void osal_semaphore_reset(osal_semaphore_handle_t const sem_hdl); //--------------------------------------------------------------------+ // QUEUE API @@ -166,6 +167,7 @@ typedef void* osal_queue_handle_t; 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, uint32_t msec, tusb_error_t *p_error); tusb_error_t osal_queue_send (osal_queue_handle_t const queue_hdl, uint32_t data); +void osal_queue_flush(osal_queue_handle_t const queue_hdl); //--------------------------------------------------------------------+ // TICK API diff --git a/tinyusb/osal/osal_none.h b/tinyusb/osal/osal_none.h index 82bef38b1..af96213f5 100644 --- a/tinyusb/osal/osal_none.h +++ b/tinyusb/osal/osal_none.h @@ -178,8 +178,8 @@ static inline tusb_error_t osal_semaphore_post(osal_semaphore_handle_t const se return TUSB_ERROR_NONE; } -static inline void osal_sempahore_reset(osal_semaphore_handle_t const sem_hdl) ATTR_ALWAYS_INLINE; -static inline void osal_sempahore_reset(osal_semaphore_handle_t const sem_hdl) +static inline void osal_semaphore_reset(osal_semaphore_handle_t const sem_hdl) ATTR_ALWAYS_INLINE; +static inline void osal_semaphore_reset(osal_semaphore_handle_t const sem_hdl) { (*sem_hdl) = 0; } |
