mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-13 08:40:26 +01:00
Merge pull request #19837 from HendrikVE/stdio_uart_add_flush_rx
sys/stdio_uart: add stdio_clear_stdin
This commit is contained in:
commit
67a22dba5e
@ -102,6 +102,15 @@ void stdio_init(void);
|
|||||||
int stdio_available(void);
|
int stdio_available(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the input buffer
|
||||||
|
*
|
||||||
|
* @note Requires 'USEMODULE += stdin'
|
||||||
|
*
|
||||||
|
* @warning This function does only work if the stdio implementation supports it.
|
||||||
|
*/
|
||||||
|
void stdio_clear_stdin(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief read @p len bytes from stdio uart into @p buffer
|
* @brief read @p len bytes from stdio uart into @p buffer
|
||||||
*
|
*
|
||||||
|
@ -81,3 +81,10 @@ int stdio_available(void)
|
|||||||
return tsrb_avail(&stdin_isrpipe.tsrb);
|
return tsrb_avail(&stdin_isrpipe.tsrb);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void stdio_clear_stdin(void)
|
||||||
|
{
|
||||||
|
if (IS_USED(MODULE_STDIN)) {
|
||||||
|
tsrb_clear(&stdin_isrpipe.tsrb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user