Core: thread allocation shortcut (#2007)
* Core: thread alloc+set shortcut * Apps: use thread allocation shortcut * Mark some service threads as services * Init BT as soon as possible Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -135,6 +135,19 @@ FuriThread* furi_thread_alloc() {
|
||||
return thread;
|
||||
}
|
||||
|
||||
FuriThread* furi_thread_alloc_ex(
|
||||
const char* name,
|
||||
uint32_t stack_size,
|
||||
FuriThreadCallback callback,
|
||||
void* context) {
|
||||
FuriThread* thread = furi_thread_alloc();
|
||||
furi_thread_set_name(thread, name);
|
||||
furi_thread_set_stack_size(thread, stack_size);
|
||||
furi_thread_set_callback(thread, callback);
|
||||
furi_thread_set_context(thread, context);
|
||||
return thread;
|
||||
}
|
||||
|
||||
void furi_thread_free(FuriThread* thread) {
|
||||
furi_assert(thread);
|
||||
furi_assert(thread->state == FuriThreadStateStopped);
|
||||
|
@@ -60,6 +60,20 @@ typedef void (*FuriThreadStateCallback)(FuriThreadState state, void* context);
|
||||
*/
|
||||
FuriThread* furi_thread_alloc();
|
||||
|
||||
/** Allocate FuriThread, shortcut version
|
||||
*
|
||||
* @param name
|
||||
* @param stack_size
|
||||
* @param callback
|
||||
* @param context
|
||||
* @return FuriThread*
|
||||
*/
|
||||
FuriThread* furi_thread_alloc_ex(
|
||||
const char* name,
|
||||
uint32_t stack_size,
|
||||
FuriThreadCallback callback,
|
||||
void* context);
|
||||
|
||||
/** Release FuriThread
|
||||
*
|
||||
* @param thread FuriThread instance
|
||||
|
Reference in New Issue
Block a user