Skip to content

Commit

Permalink
Merge branch 'dev' into portasynthinca3/3928-cli-threads
Browse files Browse the repository at this point in the history
  • Loading branch information
portasynthinca3 authored Dec 24, 2024
2 parents 824b644 + 5fb9558 commit c8e0a55
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion applications/debug/unit_tests/tests/furi/furi_stdio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ void test_stdin(void) {
static FuriString* mock_out;
static FuriThreadStdoutWriteCallback original_out_cb;
static void* original_out_ctx;

static void mock_out_cb(const char* data, size_t size, void* context) {
furi_check(context == CONTEXT_MAGIC);
// there's no furi_string_cat_strn :(
Expand Down
3 changes: 1 addition & 2 deletions applications/services/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ void cli_delete_command(Cli* cli, const char* name) {
bool cli_get_command(Cli* cli, FuriString* command, CliCommand* result) {
furi_assert(cli);
furi_check(furi_mutex_acquire(cli->mutex, FuriWaitForever) == FuriStatusOk);

CliCommand* data = CliCommandTree_get(cli->commands, command);
if(data) *result = *data;

furi_check(furi_mutex_release(cli->mutex) == FuriStatusOk);

return !!data;
Expand Down
7 changes: 7 additions & 0 deletions furi/core/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,13 @@ void furi_thread_get_stdout_callback(FuriThreadStdoutWriteCallback* callback, vo
*/
void furi_thread_get_stdin_callback(FuriThreadStdinReadCallback* callback, void** context);

/**
* @brief Get the standard input callback for the current thead.
*
* @return pointer to the standard in callback function
*/
FuriThreadStdinReadCallback furi_thread_get_stdin_callback(void);

/** Set standard output callback for the current thread.
*
* @param[in] callback pointer to the callback function or NULL to clear
Expand Down

0 comments on commit c8e0a55

Please sign in to comment.