From fbd05598adbb185472696d2a46551927d3af5517 Mon Sep 17 00:00:00 2001 From: Skorpionm <85568270+Skorpionm@users.noreply.github.com> Date: Thu, 2 Dec 2021 15:19:47 +0400 Subject: [PATCH] [FL-2086] SubGhz: Fix Errors (#861) * CLI: fix main GUI freeze while subghz chat is running * CLI: fix processing backspace in the web console * [FL-2086] SubGhz: fix can't save signals in sub'e to internal memory * Cli: remove warning message in i2c command Co-authored-by: Aleksandr Kutuzov --- applications/cli/cli_commands.c | 2 +- applications/subghz/subghz_cli.c | 11 ++++------- applications/subghz/subghz_i.c | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index e8837108..1834282f 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -466,7 +466,7 @@ void cli_command_i2c(Cli* cli, string_t args, void* context) { uint8_t test = 0; printf("Scanning external i2c on PC0(SCL)/PC1(SDA)\r\n" "Clock: 100khz, 7bit address\r\n" - "!!! Invasive mode (tx to device) !!!\r\n\r\n"); + "\r\n"); printf(" | 0 1 2 3 4 5 6 7 8 9 A B C D E F\r\n"); printf("--+--------------------------------\r\n"); for(uint8_t row = 0; row < 0x8; row++) { diff --git a/applications/subghz/subghz_cli.c b/applications/subghz/subghz_cli.c index 9b67614b..5246e478 100644 --- a/applications/subghz/subghz_cli.c +++ b/applications/subghz/subghz_cli.c @@ -406,16 +406,12 @@ static void subghz_cli_command_chat(Cli* cli, string_t args) { putc(c, stdout); fflush(stdout); string_push_back(input, c); - } else if(c == CliSymbolAsciiBackspace) { + } else if((c == CliSymbolAsciiBackspace) || (c == CliSymbolAsciiDel)) { size_t len = string_size(input); if(len > string_size(name)) { - string_set_strn(input, string_get_cstr(input), len - 1); - printf("\r"); - for(uint8_t i = 0; i < len; i++) { - printf(" "); - } - printf("\r%s", string_get_cstr(input)); + printf("%s", "\e[D\e[1P"); fflush(stdout); + string_set_strn(input, string_get_cstr(input), len - 1); } } else if(c == CliSymbolAsciiCR) { printf("\r\n"); @@ -440,6 +436,7 @@ static void subghz_cli_command_chat(Cli* cli, string_t args) { printf("%s", string_get_cstr(input)); fflush(stdout); } + osDelay(1); } printf("\r\nExit chat\r\n"); diff --git a/applications/subghz/subghz_i.c b/applications/subghz/subghz_i.c index ff1596e8..c04cdb34 100644 --- a/applications/subghz/subghz_i.c +++ b/applications/subghz/subghz_i.c @@ -320,7 +320,7 @@ bool subghz_save_protocol_to_file(SubGhz* subghz, const char* dev_name) { break; } // Create saved directory if necessary - if(!storage_simply_mkdir(storage, SUBGHZ_APP_FOLDER)) { + if(!storage_simply_mkdir(storage, SUBGHZ_APP_PATH_FOLDER)) { dialog_message_show_storage_error(subghz->dialogs, "Cannot create\nfolder"); break; }