mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
usb: Fixed RX buffer min size
Closes https://github.com/espressif/esp-idf/issues/9040
This commit is contained in:
parent
b264d46d20
commit
d1d9b8f8f6
@ -125,6 +125,7 @@ menu "TinyUSB Stack"
|
||||
depends on TINYUSB_MSC_ENABLED
|
||||
int "MSC FIFO size"
|
||||
default 512
|
||||
range 64 10000
|
||||
help
|
||||
MSC FIFO size, in bytes.
|
||||
endmenu # "Massive Storage Class"
|
||||
@ -148,6 +149,7 @@ menu "TinyUSB Stack"
|
||||
depends on TINYUSB_CDC_ENABLED
|
||||
int "CDC FIFO size of RX channel"
|
||||
default 64
|
||||
range 64 10000
|
||||
help
|
||||
CDC FIFO size of RX channel.
|
||||
|
||||
|
@ -79,7 +79,6 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Invoked when CDC interface received data from host */
|
||||
void tud_cdc_rx_cb(uint8_t itf)
|
||||
{
|
||||
@ -157,8 +156,6 @@ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
esp_err_t tinyusb_cdcacm_register_callback(tinyusb_cdcacm_itf_t itf,
|
||||
cdcacm_event_type_t event_type,
|
||||
tusb_cdcacm_callback_t callback)
|
||||
@ -188,7 +185,6 @@ esp_err_t tinyusb_cdcacm_register_callback(tinyusb_cdcacm_itf_t itf,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
esp_err_t tinyusb_cdcacm_unregister_callback(tinyusb_cdcacm_itf_t itf,
|
||||
cdcacm_event_type_t event_type)
|
||||
{
|
||||
@ -273,7 +269,6 @@ esp_err_t tinyusb_cdcacm_read(tinyusb_cdcacm_itf_t itf, uint8_t *out_buf, size_t
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
size_t tinyusb_cdcacm_write_queue_char(tinyusb_cdcacm_itf_t itf, char ch)
|
||||
{
|
||||
if (!get_acm(itf)) { // non-initialized
|
||||
@ -282,13 +277,13 @@ size_t tinyusb_cdcacm_write_queue_char(tinyusb_cdcacm_itf_t itf, char ch)
|
||||
return tud_cdc_n_write_char(itf, ch);
|
||||
}
|
||||
|
||||
|
||||
size_t tinyusb_cdcacm_write_queue(tinyusb_cdcacm_itf_t itf, const uint8_t *in_buf, size_t in_size)
|
||||
{
|
||||
if (!get_acm(itf)) { // non-initialized
|
||||
return 0;
|
||||
}
|
||||
return tud_cdc_n_write(itf, in_buf, in_size);
|
||||
const uint32_t size_available = tud_cdc_n_write_available(itf);
|
||||
return tud_cdc_n_write(itf, in_buf, (in_size < size_available) ? in_size : size_available);
|
||||
}
|
||||
|
||||
static uint32_t tud_cdc_n_write_occupied(tinyusb_cdcacm_itf_t itf)
|
||||
|
@ -179,12 +179,12 @@ uint8_t const descriptor_cfg_kconfig[] = {
|
||||
|
||||
# if CFG_TUD_CDC
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, 0x81, 8, 0x02, 0x82, 64),
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, 0x81, 8, 0x02, 0x82, CFG_TUD_CDC_EP_BUFSIZE),
|
||||
# endif
|
||||
|
||||
# if CFG_TUD_CDC > 1
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC1, 4, 0x83, 8, 0x04, 0x84, 64),
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC1, 4, 0x83, 8, 0x04, 0x84, CFG_TUD_CDC_EP_BUFSIZE),
|
||||
# endif
|
||||
|
||||
# if CFG_TUD_MSC
|
||||
|
Loading…
x
Reference in New Issue
Block a user