summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_host.c
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2024-04-01 12:20:20 +0200
committerHiFiPhile <[email protected]>2024-04-01 12:20:20 +0200
commit9570836cece0beb6c61f1cc97e5de25dac136394 (patch)
tree9e00948162fc43e6483f7291b708dcf85a3414dc /src/class/cdc/cdc_host.c
parent5c8b3d97f04443f386270eba6171af9a333855c6 (diff)
parent82dfe95655c7b7564363a2d5cb2f5e32d431b223 (diff)
Merge branch 'master' of https://github.com/hathach/tinyusb into vendor_fifo
Diffstat (limited to 'src/class/cdc/cdc_host.c')
-rw-r--r--src/class/cdc/cdc_host.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c
index 2fb37d835..5bdd41f1f 100644
--- a/src/class/cdc/cdc_host.c
+++ b/src/class/cdc/cdc_host.c
@@ -621,12 +621,11 @@ bool tuh_cdc_set_line_coding(uint8_t idx, cdc_line_coding_t const* line_coding,
// CLASS-USBH API
//--------------------------------------------------------------------+
-void cdch_init(void) {
+bool cdch_init(void) {
+ TU_LOG_DRV("sizeof(cdch_interface_t) = %u\r\n", sizeof(cdch_interface_t));
tu_memclr(cdch_data, sizeof(cdch_data));
-
for (size_t i = 0; i < CFG_TUH_CDC; i++) {
cdch_interface_t* p_cdc = &cdch_data[i];
-
tu_edpt_stream_init(&p_cdc->stream.tx, true, true, false,
p_cdc->stream.tx_ff_buf, CFG_TUH_CDC_TX_BUFSIZE,
p_cdc->stream.tx_ep_buf, CFG_TUH_CDC_TX_EPSIZE);
@@ -635,6 +634,17 @@ void cdch_init(void) {
p_cdc->stream.rx_ff_buf, CFG_TUH_CDC_RX_BUFSIZE,
p_cdc->stream.rx_ep_buf, CFG_TUH_CDC_RX_EPSIZE);
}
+
+ return true;
+}
+
+bool cdch_deinit(void) {
+ for (size_t i = 0; i < CFG_TUH_CDC; i++) {
+ cdch_interface_t* p_cdc = &cdch_data[i];
+ tu_edpt_stream_deinit(&p_cdc->stream.tx);
+ tu_edpt_stream_deinit(&p_cdc->stream.rx);
+ }
+ return true;
}
void cdch_close(uint8_t daddr) {