mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/stdio_uart: implementation of stdio_available
This commit is contained in:
parent
a71dec81a2
commit
0ffad24112
@ -37,6 +37,7 @@ endif
|
||||
ifneq (,$(filter stdio_uart_rx,$(USEMODULE)))
|
||||
USEMODULE += isrpipe
|
||||
USEMODULE += stdio_uart
|
||||
USEMODULE += stdio_available
|
||||
endif
|
||||
|
||||
ifneq (,$(filter stdio_uart,$(USEMODULE)))
|
||||
|
@ -49,6 +49,7 @@ config MODULE_STDIO_UART_RX
|
||||
bool
|
||||
depends on MODULE_STDIO_UART
|
||||
select MODULE_ISRPIPE
|
||||
select MODULE_STDIO_AVAILABLE
|
||||
default y if MODULE_STDIN
|
||||
help
|
||||
Reception when using UART-based STDIO needs to be enabled.
|
||||
|
@ -67,6 +67,13 @@ void stdio_init(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if IS_USED(MODULE_STDIO_AVAILABLE)
|
||||
int stdio_available(void)
|
||||
{
|
||||
return tsrb_avail(&stdio_uart_isrpipe.tsrb);
|
||||
}
|
||||
#endif
|
||||
|
||||
ssize_t stdio_read(void* buffer, size_t count)
|
||||
{
|
||||
#ifdef MODULE_STDIO_UART_RX
|
||||
|
Loading…
Reference in New Issue
Block a user