add osal_queue_send_isr/osal_semaphore_post_isr for better support freeRTOS

This commit is contained in:
hathach
2018-05-17 13:49:38 +07:00
parent b253291314
commit 013bd621f5
2 changed files with 7 additions and 5 deletions

View File

@@ -146,7 +146,7 @@ static inline osal_queue_t osal_queue_create(uint32_t depth, uint32_t item_size)
}
static inline bool osal_queue_send(osal_queue_t const queue_hdl, void const * data)
static inline bool osal_queue_send_isr(osal_queue_t const queue_hdl, void const * data)
{
return fifo_write( (fifo_t*) queue_hdl, data);
}
@@ -197,6 +197,8 @@ static inline osal_semaphore_t osal_semaphore_create(uint32_t max_count, uint32_
return sem_data;
}
#define osal_semaphore_post_isr osal_semaphore_post
static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl)
{
if (sem_hdl->count < sem_hdl->max_count ) sem_hdl->count++;