Skip to content

Commit

Permalink
sys/usb/cdc/acm: implementation of stdio_available
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Jan 3, 2022
1 parent 0ffad24 commit af621ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions makefiles/stdio.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
1 change: 1 addition & 0 deletions sys/usb/usbus/cdc/acm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions sys/usb/usbus/cdc/acm/cdc_acm_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af621ec

Please sign in to comment.