[FL-1447] NFC application refactoring (#532)

* nfc: add separate nfc_detect
* nfc_worker: add callback and context
* api-hal-nfc: return busy if rfal worker is running
* nfc: introduce nfc_detect, change nfc_worker API, rework main nfc task
* nfc_emulate: introduce nfc_emulate module
* nfc: introduce nfc_emv module
* nfc: introduce nfc_mifare_ul module
* nfc: remove unused nfc_views
* nfc: separate messages and models
* nfc: remove unused nfc message types
* nfc: remove message_queue from common api
* view_dispatcher: delete internal queue in destructor
* api-hal-nfc: fix rfal worker initialization condition

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-06-24 11:46:37 +03:00
committed by GitHub
parent 4cf000f270
commit 5b8f147882
19 changed files with 902 additions and 664 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include "nfc_types.h"
#include "nfc_i.h"
#include "nfc_worker.h"
#include <furi.h>
@@ -17,10 +17,13 @@
#include <st25r3916_irq.h>
struct NfcWorker {
osMessageQueueId_t message_queue;
osThreadAttr_t thread_attr;
osThreadId_t thread;
osMessageQueueId_t message_queue;
NfcWorkerCallback callback;
void* context;
NfcWorkerState state;
ReturnCode error;
};
@@ -33,7 +36,7 @@ void nfc_worker_read_emv(NfcWorker* nfc_worker);
void nfc_worker_emulate_emv(NfcWorker* nfc_worker);
void nfc_worker_poll(NfcWorker* nfc_worker);
void nfc_worker_detect(NfcWorker* nfc_worker);
void nfc_worker_emulate(NfcWorker* nfc_worker);