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:
Sergey Gavrilov
2022-11-23 22:49:17 +10:00
committed by GitHub
parent b9c483fbf8
commit c511c67e71
38 changed files with 94 additions and 195 deletions

View File

@@ -61,10 +61,7 @@ static int32_t lfrfid_raw_emulate_worker_thread(void* thread_context);
LFRFIDRawWorker* lfrfid_raw_worker_alloc() {
LFRFIDRawWorker* worker = malloc(sizeof(LFRFIDRawWorker));
worker->thread = furi_thread_alloc();
furi_thread_set_name(worker->thread, "lfrfid_raw_worker");
furi_thread_set_context(worker->thread, worker);
furi_thread_set_stack_size(worker->thread, 2048);
worker->thread = furi_thread_alloc_ex("LfrfidRawWorker", 2048, NULL, worker);
worker->events = furi_event_flag_alloc(NULL);

View File

@@ -29,11 +29,7 @@ LFRFIDWorker* lfrfid_worker_alloc(ProtocolDict* dict) {
worker->raw_filename = NULL;
worker->mode_storage = NULL;
worker->thread = furi_thread_alloc();
furi_thread_set_name(worker->thread, "lfrfid_worker");
furi_thread_set_callback(worker->thread, lfrfid_worker_thread);
furi_thread_set_context(worker->thread, worker);
furi_thread_set_stack_size(worker->thread, 2048);
worker->thread = furi_thread_alloc_ex("LfrfidWorker", 2048, lfrfid_worker_thread, worker);
worker->protocols = dict;