Skip to content

Commit f505cc2

Browse files
authored
Merge pull request #2443 from mamiral/tud_vendor_mutex
Update vendor_device.c fifo mutex config similar to cdc_device.c.
2 parents 7ea2384 + 82776aa commit f505cc2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/class/vendor/vendor_device.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ typedef struct
4949
uint8_t rx_ff_buf[CFG_TUD_VENDOR_RX_BUFSIZE];
5050
uint8_t tx_ff_buf[CFG_TUD_VENDOR_TX_BUFSIZE];
5151

52-
#if CFG_FIFO_MUTEX
53-
osal_mutex_def_t rx_ff_mutex;
54-
osal_mutex_def_t tx_ff_mutex;
55-
#endif
52+
OSAL_MUTEX_DEF(rx_ff_mutex);
53+
OSAL_MUTEX_DEF(tx_ff_mutex);
5654

5755
// Endpoint Transfer buffer
5856
CFG_TUSB_MEM_ALIGN uint8_t epout_buf[CFG_TUD_VENDOR_EPSIZE];
@@ -183,10 +181,8 @@ void vendord_init(void)
183181
tu_fifo_config(&p_itf->rx_ff, p_itf->rx_ff_buf, CFG_TUD_VENDOR_RX_BUFSIZE, 1, false);
184182
tu_fifo_config(&p_itf->tx_ff, p_itf->tx_ff_buf, CFG_TUD_VENDOR_TX_BUFSIZE, 1, false);
185183

186-
#if CFG_FIFO_MUTEX
187184
tu_fifo_config_mutex(&p_itf->rx_ff, NULL, osal_mutex_create(&p_itf->rx_ff_mutex));
188185
tu_fifo_config_mutex(&p_itf->tx_ff, osal_mutex_create(&p_itf->tx_ff_mutex), NULL);
189-
#endif
190186
}
191187
}
192188

0 commit comments

Comments
 (0)