mirror of
https://github.com/flipperdevices/flipperzero-firmware.git
synced 2025-12-12 20:59:50 +04:00
vcp, cli: Handle Tx/Rx events before Connect/Disconnect + extra fixes (#4181)
* cli_vcp: handle tx/rx before connext/disconnect * cli_vcp: disable trace * cli_perf: advanced error reporting * cli_vcp: reset tx flag directly in event handler * fix formatting * cli_vcp: make tx flag volatile * storage_settings: fix scene ids * cli_shell: add safety check to set_prompt * cli_registry: move from bptree to dict, fix memory leak * cli_vcp: go back to message queue for event signaling * loader: move BeforeLoad event even earlier * fix formatting
This commit is contained in:
@@ -103,15 +103,15 @@ void cli_command_help(PipeSide* pipe, FuriString* args, void* context) {
|
||||
|
||||
printf("Available commands:\r\n" ANSI_FG_GREEN);
|
||||
cli_registry_lock(registry);
|
||||
CliCommandTree_t* commands = cli_registry_get_commands(registry);
|
||||
size_t commands_count = CliCommandTree_size(*commands);
|
||||
CliCommandDict_t* commands = cli_registry_get_commands(registry);
|
||||
size_t commands_count = CliCommandDict_size(*commands);
|
||||
|
||||
CliCommandTree_it_t iterator;
|
||||
CliCommandTree_it(iterator, *commands);
|
||||
CliCommandDict_it_t iterator;
|
||||
CliCommandDict_it(iterator, *commands);
|
||||
for(size_t i = 0; i < commands_count; i++) {
|
||||
const CliCommandTree_itref_t* item = CliCommandTree_cref(iterator);
|
||||
printf("%-30s", furi_string_get_cstr(*item->key_ptr));
|
||||
CliCommandTree_next(iterator);
|
||||
const CliCommandDict_itref_t* item = CliCommandDict_cref(iterator);
|
||||
printf("%-30s", furi_string_get_cstr(item->key));
|
||||
CliCommandDict_next(iterator);
|
||||
|
||||
if(i % columns == columns - 1) printf("\r\n");
|
||||
}
|
||||
@@ -474,5 +474,6 @@ void cli_shell_join(CliShell* shell) {
|
||||
|
||||
void cli_shell_set_prompt(CliShell* shell, const char* prompt) {
|
||||
furi_check(shell);
|
||||
furi_check(furi_thread_get_state(shell->thread) == FuriThreadStateStopped);
|
||||
shell->prompt = prompt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user