1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/usb/cdc/acm: implementation of stdio_available

This commit is contained in:
Gunar Schorcht 2021-12-25 13:12:16 +01:00
parent 0ffad24112
commit af621ec91b
3 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@ endif
ifneq (,$(filter stdio_cdc_acm,$(USEMODULE)))
USEMODULE += usbus_cdc_acm
USEMODULE += isrpipe
USEMODULE += stdio_available
endif
ifneq (,$(filter stdio_rtt,$(USEMODULE)))

View File

@ -58,5 +58,6 @@ config MODULE_STDIO_CDC_ACM
bool "CDC ACM"
depends on MODULE_USBUS_CDC_ACM
select MODULE_ISRPIPE
select MODULE_STDIO_AVAILABLE
endchoice

View File

@ -51,6 +51,13 @@ void stdio_init(void)
#endif
}
#if IS_USED(MODULE_STDIO_AVAILABLE)
int stdio_available(void)
{
return tsrb_avail(&_cdc_stdio_isrpipe.tsrb);
}
#endif
ssize_t stdio_read(void* buffer, size_t len)
{
(void)buffer;