[FL-1530] Cli: better Сtrl-С polling (#586)
This commit is contained in:
parent
421a0f6b97
commit
ddfdbc0530
@ -57,8 +57,11 @@ size_t cli_read(Cli* cli, uint8_t* buffer, size_t size) {
|
||||
|
||||
bool cli_cmd_interrupt_received(Cli* cli) {
|
||||
char c = '\0';
|
||||
api_hal_vcp_rx_with_timeout((uint8_t*)&c, 1, 1);
|
||||
if(api_hal_vcp_rx_with_timeout((uint8_t*)&c, 1, 0) == 1) {
|
||||
return c == CliSymbolAsciiETX;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void cli_print_usage(const char* cmd, const char* usage, const char* arg) {
|
||||
|
Loading…
Reference in New Issue
Block a user