more with mynewt

This commit is contained in:
hathach
2019-03-21 00:54:42 +07:00
parent a37bc90ecc
commit 3574688d26
2 changed files with 24 additions and 37 deletions

View File

@@ -164,6 +164,16 @@ static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef)
return (osal_queue_t) qdef;
}
// non blocking
static inline bool osal_queue_receive(osal_queue_t const qhdl, void* data)
{
_osal_q_lock(qhdl);
bool success = tu_fifo_read(&qhdl->ff, data);
_osal_q_unlock(qhdl);
return success;
}
static inline bool osal_queue_send(osal_queue_t const qhdl, void const * data, bool in_isr)
{
if (!in_isr) {
@@ -186,16 +196,6 @@ static inline void osal_queue_reset(osal_queue_t const qhdl)
// tusb_hal_int_enable_all();
}
// non blocking
static inline bool osal_queue_receive(osal_queue_t const qhdl, void* data)
{
_osal_q_lock(qhdl);
bool success = tu_fifo_read(&qhdl->ff, data);
_osal_q_unlock(qhdl);
return success;
}
#ifdef __cplusplus
}
#endif