diff options
| author | Ha Thach <[email protected]> | 2022-12-16 17:05:25 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-16 17:05:25 +0700 |
| commit | 159aa599be42534cd9a37ae03c71c228c3e72e90 (patch) | |
| tree | 8848b3c218644e1bbf5419975efef52c52a27971 /src/class/cdc | |
| parent | ab18b8794fa9834d5c9585f83addb24850601ec9 (diff) | |
| parent | 1e99480ad28808a29938673d5b05d9461da5d1c1 (diff) | |
Merge pull request #1799 from hathach/update-osal-mutex
Update osal mutex
Diffstat (limited to 'src/class/cdc')
| -rw-r--r-- | src/class/cdc/cdc_device.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c index 7b1e08d5d..0bbbaaa83 100644 --- a/src/class/cdc/cdc_device.c +++ b/src/class/cdc/cdc_device.c @@ -62,10 +62,8 @@ typedef struct uint8_t rx_ff_buf[CFG_TUD_CDC_RX_BUFSIZE]; uint8_t tx_ff_buf[CFG_TUD_CDC_TX_BUFSIZE]; -#if CFG_FIFO_MUTEX - osal_mutex_def_t rx_ff_mutex; - osal_mutex_def_t tx_ff_mutex; -#endif + OSAL_MUTEX_DEF(rx_ff_mutex); + OSAL_MUTEX_DEF(tx_ff_mutex); // Endpoint Transfer buffer CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_CDC_EP_BUFSIZE]; @@ -248,10 +246,8 @@ void cdcd_init(void) // In this way, the most current data is prioritized. tu_fifo_config(&p_cdc->tx_ff, p_cdc->tx_ff_buf, TU_ARRAY_SIZE(p_cdc->tx_ff_buf), 1, true); -#if CFG_FIFO_MUTEX tu_fifo_config_mutex(&p_cdc->rx_ff, NULL, osal_mutex_create(&p_cdc->rx_ff_mutex)); tu_fifo_config_mutex(&p_cdc->tx_ff, osal_mutex_create(&p_cdc->tx_ff_mutex), NULL); -#endif } } |
