From ddfdbc05303159212a4bdbffd33dec1450182805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Sun, 18 Jul 2021 21:52:04 +0300 Subject: [PATCH] =?UTF-8?q?[FL-1530]=20Cli:=20better=20=D0=A1trl-=D0=A1=20?= =?UTF-8?q?polling=20(#586)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/cli/cli.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/cli/cli.c b/applications/cli/cli.c index 4929b528..87ed8d10 100644 --- a/applications/cli/cli.c +++ b/applications/cli/cli.c @@ -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); - return c == CliSymbolAsciiETX; + 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) {