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:
@@ -104,11 +104,8 @@ ReaderAnalyzer* reader_analyzer_alloc() {
|
||||
instance->stream =
|
||||
furi_stream_buffer_alloc(READER_ANALYZER_MAX_BUFF_SIZE, sizeof(ReaderAnalyzerHeader));
|
||||
|
||||
instance->thread = furi_thread_alloc();
|
||||
furi_thread_set_name(instance->thread, "ReaderAnalyzerWorker");
|
||||
furi_thread_set_stack_size(instance->thread, 2048);
|
||||
furi_thread_set_callback(instance->thread, reader_analyzer_thread);
|
||||
furi_thread_set_context(instance->thread, instance);
|
||||
instance->thread =
|
||||
furi_thread_alloc_ex("ReaderAnalyzerWorker", 2048, reader_analyzer_thread, instance);
|
||||
furi_thread_set_priority(instance->thread, FuriThreadPriorityLow);
|
||||
|
||||
return instance;
|
||||
|
@@ -12,11 +12,7 @@ NfcWorker* nfc_worker_alloc() {
|
||||
NfcWorker* nfc_worker = malloc(sizeof(NfcWorker));
|
||||
|
||||
// Worker thread attributes
|
||||
nfc_worker->thread = furi_thread_alloc();
|
||||
furi_thread_set_name(nfc_worker->thread, "NfcWorker");
|
||||
furi_thread_set_stack_size(nfc_worker->thread, 8192);
|
||||
furi_thread_set_callback(nfc_worker->thread, nfc_worker_task);
|
||||
furi_thread_set_context(nfc_worker->thread, nfc_worker);
|
||||
nfc_worker->thread = furi_thread_alloc_ex("NfcWorker", 8192, nfc_worker_task, nfc_worker);
|
||||
|
||||
nfc_worker->callback = NULL;
|
||||
nfc_worker->context = NULL;
|
||||
|
Reference in New Issue
Block a user