Furi: getter for current thread stdout write callback (#2344)

This commit is contained in:
Milk-Cool 2023-01-30 10:54:15 +03:00 committed by GitHub
parent a8e5f22500
commit b1496ee9bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,5 @@
entry,status,name,type,params entry,status,name,type,params
Version,+,11.8,, Version,+,11.9,,
Header,+,applications/services/bt/bt_service/bt.h,, Header,+,applications/services/bt/bt_service/bt.h,,
Header,+,applications/services/cli/cli.h,, Header,+,applications/services/cli/cli.h,,
Header,+,applications/services/cli/cli_vcp.h,, Header,+,applications/services/cli/cli_vcp.h,,
@ -1389,8 +1389,8 @@ Function,+,furi_hal_version_uid_size,size_t,
Function,-,furi_hal_vibro_init,void, Function,-,furi_hal_vibro_init,void,
Function,+,furi_hal_vibro_on,void,_Bool Function,+,furi_hal_vibro_on,void,_Bool
Function,-,furi_init,void, Function,-,furi_init,void,
Function,+,furi_kernel_is_irq_or_masked,_Bool,
Function,+,furi_kernel_get_tick_frequency,uint32_t, Function,+,furi_kernel_get_tick_frequency,uint32_t,
Function,+,furi_kernel_is_irq_or_masked,_Bool,
Function,+,furi_kernel_lock,int32_t, Function,+,furi_kernel_lock,int32_t,
Function,+,furi_kernel_restore_lock,int32_t,int32_t Function,+,furi_kernel_restore_lock,int32_t,int32_t
Function,+,furi_kernel_unlock,int32_t, Function,+,furi_kernel_unlock,int32_t,
@ -1515,6 +1515,7 @@ Function,+,furi_thread_get_name,const char*,FuriThreadId
Function,+,furi_thread_get_return_code,int32_t,FuriThread* Function,+,furi_thread_get_return_code,int32_t,FuriThread*
Function,+,furi_thread_get_stack_space,uint32_t,FuriThreadId Function,+,furi_thread_get_stack_space,uint32_t,FuriThreadId
Function,+,furi_thread_get_state,FuriThreadState,FuriThread* Function,+,furi_thread_get_state,FuriThreadState,FuriThread*
Function,+,furi_thread_get_stdout_callback,FuriThreadStdoutWriteCallback,
Function,+,furi_thread_is_suspended,_Bool,FuriThreadId Function,+,furi_thread_is_suspended,_Bool,FuriThreadId
Function,+,furi_thread_join,_Bool,FuriThread* Function,+,furi_thread_join,_Bool,FuriThread*
Function,+,furi_thread_mark_as_service,void,FuriThread* Function,+,furi_thread_mark_as_service,void,FuriThread*

1 entry status name type params
2 Version + 11.8 11.9
3 Header + applications/services/bt/bt_service/bt.h
4 Header + applications/services/cli/cli.h
5 Header + applications/services/cli/cli_vcp.h
1389 Function - furi_hal_vibro_init void
1390 Function + furi_hal_vibro_on void _Bool
1391 Function - furi_init void
Function + furi_kernel_is_irq_or_masked _Bool
1392 Function + furi_kernel_get_tick_frequency uint32_t
1393 Function + furi_kernel_is_irq_or_masked _Bool
1394 Function + furi_kernel_lock int32_t
1395 Function + furi_kernel_restore_lock int32_t int32_t
1396 Function + furi_kernel_unlock int32_t
1515 Function + furi_thread_get_return_code int32_t FuriThread*
1516 Function + furi_thread_get_stack_space uint32_t FuriThreadId
1517 Function + furi_thread_get_state FuriThreadState FuriThread*
1518 Function + furi_thread_get_stdout_callback FuriThreadStdoutWriteCallback
1519 Function + furi_thread_is_suspended _Bool FuriThreadId
1520 Function + furi_thread_join _Bool FuriThread*
1521 Function + furi_thread_mark_as_service void FuriThread*

View File

@ -530,6 +530,12 @@ bool furi_thread_set_stdout_callback(FuriThreadStdoutWriteCallback callback) {
return true; return true;
} }
FuriThreadStdoutWriteCallback furi_thread_get_stdout_callback() {
FuriThread* thread = furi_thread_get_current();
return thread->output.write_callback;
}
size_t furi_thread_stdout_write(const char* data, size_t size) { size_t furi_thread_stdout_write(const char* data, size_t size) {
FuriThread* thread = furi_thread_get_current(); FuriThread* thread = furi_thread_get_current();

View File

@ -227,6 +227,12 @@ const char* furi_thread_get_name(FuriThreadId thread_id);
uint32_t furi_thread_get_stack_space(FuriThreadId thread_id); uint32_t furi_thread_get_stack_space(FuriThreadId thread_id);
/** Get STDOUT callback for thead
*
* @return STDOUT callback
*/
FuriThreadStdoutWriteCallback furi_thread_get_stdout_callback();
/** Set STDOUT callback for thread /** Set STDOUT callback for thread
* *
* @param callback callback or NULL to clear * @param callback callback or NULL to clear