diff options
| author | hathach <[email protected]> | 2018-11-14 17:40:29 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-11-14 17:40:29 +0700 |
| commit | 5757918df4a3cc4561775db61d9f720df8b23c31 (patch) | |
| tree | d019f460efbe439095ff7b1158f522ae16a0289c /src/osal | |
| parent | ff26c5c6b13b1ae1dc306ed8baeabb18c2b95ac7 (diff) | |
usbd clean up
Diffstat (limited to 'src/osal')
| -rw-r--r-- | src/osal/osal_none.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h index 02483055c..46930aeda 100644 --- a/src/osal/osal_none.h +++ b/src/osal/osal_none.h @@ -136,21 +136,33 @@ static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef) static inline bool osal_queue_send(osal_queue_t const queue_hdl, void const * data, bool in_isr)
{
(void) in_isr;
- return tu_fifo_write( (tu_fifo_t*) queue_hdl, data);
+// if (!in_isr) tusb_hal_int_disable_all();
+
+ bool rc = tu_fifo_write( (tu_fifo_t*) queue_hdl, data);
+
+// if (!in_isr) tusb_hal_int_enable_all();
+
+ return rc;
}
static inline void osal_queue_reset(osal_queue_t const queue_hdl)
{
- queue_hdl->count = queue_hdl->rd_idx = queue_hdl->wr_idx = 0;
+ // tusb_hal_int_disable_all();
+ tu_fifo_clear( (tu_fifo_t*) queue_hdl);
+ // tusb_hal_int_enable_all();
}
static inline bool osal_queue_receive(osal_queue_t const queue_hdl, void* data)
{
// osal none return immediately without blocking
- return tu_fifo_read(queue_hdl, data);
-}
+ // tusb_hal_int_disable_all();
+ bool rc = tu_fifo_read(queue_hdl, data);
+ // tusb_hal_int_enable_all();
+
+ return rc;
+}
#ifdef __cplusplus
}
|
