diff --git a/src/osal/osal.h b/src/osal/osal.h index 6846b5757..55e3e077c 100644 --- a/src/osal/osal.h +++ b/src/osal/osal.h @@ -83,7 +83,7 @@ typedef void (*osal_task_func_t)( void * ); * osal_semaphore_def_t, osal_semaphore_t * osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semdef) * bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr) - * void osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec, uint32_t *p_error) + * bool osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec) * void osal_semaphore_reset(osal_semaphore_t const sem_hdl) * * Mutex diff --git a/src/osal/osal_freertos.h b/src/osal/osal_freertos.h index 458e54b5c..acec4a95d 100644 --- a/src/osal/osal_freertos.h +++ b/src/osal/osal_freertos.h @@ -107,10 +107,10 @@ static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr) return in_isr ? xSemaphoreGiveFromISR(sem_hdl, NULL) : xSemaphoreGive(sem_hdl); } -static inline tusb_error_t osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec) +static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec) { uint32_t const ticks = (msec == OSAL_TIMEOUT_WAIT_FOREVER) ? portMAX_DELAY : pdMS_TO_TICKS(msec); - return (xSemaphoreTake(sem_hdl, ticks) ? TUSB_ERROR_NONE : TUSB_ERROR_OSAL_TIMEOUT); + return xSemaphoreTake(sem_hdl, ticks); } static inline void osal_semaphore_reset(osal_semaphore_t const sem_hdl) diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h index 61ed0d45e..4da5cffc8 100644 --- a/src/osal/osal_none.h +++ b/src/osal/osal_none.h @@ -96,15 +96,15 @@ static inline void osal_semaphore_reset(osal_semaphore_t sem_hdl) sem_hdl->count = 0; } -static inline tusb_error_t osal_semaphore_wait(osal_semaphore_t sem_hdl, uint32_t msec) +// TODO blocking for now +static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec) { (void) msec; - // TODO blocking for now while (sem_hdl->count == 0) { } sem_hdl->count--; - return TUSB_ERROR_NONE; + return true; } //--------------------------------------------------------------------+