mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-24 22:07:14 +03:00
[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);
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user