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:
@@ -59,11 +59,8 @@ SubGhzChatWorker* subghz_chat_worker_alloc(Cli* cli) {
|
||||
|
||||
instance->cli = cli;
|
||||
|
||||
instance->thread = furi_thread_alloc();
|
||||
furi_thread_set_name(instance->thread, "SubGhzChat");
|
||||
furi_thread_set_stack_size(instance->thread, 2048);
|
||||
furi_thread_set_context(instance->thread, instance);
|
||||
furi_thread_set_callback(instance->thread, subghz_chat_worker_thread);
|
||||
instance->thread =
|
||||
furi_thread_alloc_ex("SubGhzChat", 2048, subghz_chat_worker_thread, instance);
|
||||
instance->subghz_txrx = subghz_tx_rx_worker_alloc();
|
||||
instance->event_queue = furi_message_queue_alloc(80, sizeof(SubGhzChatEvent));
|
||||
return instance;
|
||||
|
@@ -265,12 +265,8 @@ SubGhzFrequencyAnalyzerWorker* subghz_frequency_analyzer_worker_alloc(void* cont
|
||||
furi_assert(context);
|
||||
SubGhzFrequencyAnalyzerWorker* instance = malloc(sizeof(SubGhzFrequencyAnalyzerWorker));
|
||||
|
||||
instance->thread = furi_thread_alloc();
|
||||
furi_thread_set_name(instance->thread, "SubGhzFAWorker");
|
||||
furi_thread_set_stack_size(instance->thread, 2048);
|
||||
furi_thread_set_context(instance->thread, instance);
|
||||
furi_thread_set_callback(instance->thread, subghz_frequency_analyzer_worker_thread);
|
||||
|
||||
instance->thread = furi_thread_alloc_ex(
|
||||
"SubGhzFAWorker", 2048, subghz_frequency_analyzer_worker_thread, instance);
|
||||
SubGhz* subghz = context;
|
||||
instance->setting = subghz->setting;
|
||||
return instance;
|
||||
|
Reference in New Issue
Block a user