[FL-1530] Cli: better Сtrl-С polling (#586)

This commit is contained in:
あく 2021-07-18 21:52:04 +03:00 committed by GitHub
parent 421a0f6b97
commit ddfdbc0530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {