summaryrefslogtreecommitdiff
path: root/src/class/cdc/cdc_host.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-12-24 01:11:13 +0700
committerhathach <[email protected]>2022-12-24 01:11:13 +0700
commit48d4a67ec5468f9fd7c073acd599a1271b9e877f (patch)
tree980413ad1b67e8166ee78deb336cbcd95d5a4663 /src/class/cdc/cdc_host.c
parent48f4d8b7f7eda7ee4046c1c6cd9be2b5c0d81603 (diff)
add tuh_cdc_peek()
Diffstat (limited to 'src/class/cdc/cdc_host.c')
-rw-r--r--src/class/cdc/cdc_host.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c
index 17dc877f8..e9c3d34cb 100644
--- a/src/class/cdc/cdc_host.c
+++ b/src/class/cdc/cdc_host.c
@@ -228,6 +228,14 @@ uint32_t tuh_cdc_read_available(uint8_t idx)
return tu_edpt_stream_read_available(&p_cdc->stream.rx);
}
+bool tuh_cdc_peek(uint8_t idx, uint8_t* ch)
+{
+ cdch_interface_t* p_cdc = get_itf(idx);
+ TU_VERIFY(p_cdc);
+
+ return tu_edpt_stream_peek(&p_cdc->stream.rx, ch);
+}
+
bool tuh_cdc_read_clear (uint8_t idx)
{
cdch_interface_t* p_cdc = get_itf(idx);