Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorあく <alleteam@gmail.com>2021-07-28 11:45:42 +0300
committerGitHub <noreply@github.com>2021-07-28 11:45:42 +0300
commit1c58de24f52833e2725f2c5b9b81dfdacfd46936 (patch)
tree64cba5475557cdd80314d7d3e0be94e0fa715de6 /applications/nfc
parent4c1ac2a13d5b0e39435ba850b89c2aefe4df1ae3 (diff)
Nfc: switch to HAL ticks. ApiHal: small cleanup and refactoring. (#609)
Diffstat (limited to 'applications/nfc')
-rwxr-xr-xapplications/nfc/nfc_cli.c2
-rwxr-xr-xapplications/nfc/nfc_worker.c8
-rwxr-xr-xapplications/nfc/nfc_worker.h2
-rwxr-xr-xapplications/nfc/nfc_worker_i.h1
4 files changed, 1 insertions, 12 deletions
diff --git a/applications/nfc/nfc_cli.c b/applications/nfc/nfc_cli.c
index 7656bd31..6349cde4 100755
--- a/applications/nfc/nfc_cli.c
+++ b/applications/nfc/nfc_cli.c
@@ -19,7 +19,6 @@ void nfc_cli_detect(Cli* cli, string_t args, void* context) {
rfalNfcDevice* dev_list;
uint8_t dev_cnt = 0;
bool cmd_exit = false;
- api_hal_nfc_init();
api_hal_nfc_exit_sleep();
printf("Detecting nfc...\r\nPress Ctrl+C to abort\r\n");
while(!cmd_exit) {
@@ -51,7 +50,6 @@ void nfc_cli_emulate(Cli* cli, string_t args, void* context) {
return;
}
- api_hal_nfc_init();
api_hal_nfc_exit_sleep();
printf("Emulating NFC-A Type: T2T UID: CF72D440 SAK: 20 ATQA: 00/04\r\n");
printf("Press Ctrl+C to abort\r\n");
diff --git a/applications/nfc/nfc_worker.c b/applications/nfc/nfc_worker.c
index 0e0003d6..e536620e 100755
--- a/applications/nfc/nfc_worker.c
+++ b/applications/nfc/nfc_worker.c
@@ -15,9 +15,7 @@ NfcWorker* nfc_worker_alloc() {
nfc_worker->callback = NULL;
nfc_worker->context = NULL;
// Initialize rfal
- nfc_worker->error = api_hal_nfc_init();
- if(nfc_worker->error == ERR_NONE) {
- api_hal_nfc_start_sleep();
+ if(!api_hal_nfc_is_busy()) {
nfc_worker_change_state(nfc_worker, NfcWorkerStateReady);
} else {
nfc_worker_change_state(nfc_worker, NfcWorkerStateBroken);
@@ -35,10 +33,6 @@ NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker) {
return nfc_worker->state;
}
-ReturnCode nfc_worker_get_error(NfcWorker* nfc_worker) {
- return nfc_worker->error;
-}
-
void nfc_worker_start(
NfcWorker* nfc_worker,
NfcWorkerState state,
diff --git a/applications/nfc/nfc_worker.h b/applications/nfc/nfc_worker.h
index 7109e5f8..4719cb21 100755
--- a/applications/nfc/nfc_worker.h
+++ b/applications/nfc/nfc_worker.h
@@ -28,8 +28,6 @@ NfcWorker* nfc_worker_alloc();
NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker);
-ReturnCode nfc_worker_get_error(NfcWorker* nfc_worker);
-
void nfc_worker_free(NfcWorker* nfc_worker);
void nfc_worker_start(
diff --git a/applications/nfc/nfc_worker_i.h b/applications/nfc/nfc_worker_i.h
index 00d5e454..9df5707d 100755
--- a/applications/nfc/nfc_worker_i.h
+++ b/applications/nfc/nfc_worker_i.h
@@ -26,7 +26,6 @@ struct NfcWorker {
void* context;
NfcWorkerState state;
- ReturnCode error;
};
void nfc_worker_change_state(NfcWorker* nfc_worker, NfcWorkerState state);