[FL-1214] NFC application (#448)

* platform: include only used api-hal files
* api-hal-nfc: introduce nfc hal
* nfc_worker: rework nfc worker
* nfc: move nfc from services to applications, add startup hook
* api-hal-nfc: init nfc worker in api_hal_detect
* nfc: rework nfc application
* nfc: fix app exit
* api-hal-nfc: init nfc worker only once
This commit is contained in:
gornekich
2021-05-06 22:51:20 +03:00
committed by GitHub
parent ffd4948ae2
commit fb73d3bd52
16 changed files with 386 additions and 332 deletions

View File

@@ -1,5 +1,6 @@
#include "applications.h"
// Services and apps decalartion
int32_t flipper_test_app(void* p);
int32_t application_blink(void* p);
int32_t application_uart_write(void* p);
@@ -34,6 +35,9 @@ int32_t scene_app(void* p);
int32_t passport(void* p);
int32_t app_accessor(void* p);
// On system start hooks declaration
void nfc_cli_init();
const FlipperApplication FLIPPER_SERVICES[] = {
#ifdef SRV_CLI
{.app = cli_task, .name = "cli_task", .stack_size = 2048, .icon = A_Plugins_14},
@@ -89,10 +93,6 @@ const FlipperApplication FLIPPER_SERVICES[] = {
{.app = irda, .name = "irda", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_NFC
{.app = nfc_task, .name = "nfc_task", .stack_size = 1024, .icon = A_Plugins_14},
#endif
#ifdef SRV_EXAMPLE_QRCODE
{.app = u8g2_qrcode, .name = "u8g2_qrcode", .stack_size = 1024, .icon = A_Plugins_14},
#endif
@@ -158,6 +158,10 @@ const FlipperApplication FLIPPER_APPS[] = {
{.app = app_lfrfid, .name = "125 kHz RFID", .stack_size = 1024, .icon = A_125khz_14},
#endif
#ifdef APP_NFC
{.app = nfc_task, .name = "NFC", .stack_size = 1024, .icon = A_NFC_14},
#endif
#ifdef APP_IRDA
{.app = irda, .name = "Infrared", .stack_size = 1024, .icon = A_Infrared_14},
#endif
@@ -173,6 +177,16 @@ const FlipperApplication FLIPPER_APPS[] = {
const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplication);
// On system start hooks
const FlipperOnStartHook FLIPPER_ON_SYSTEM_START[] = {
#ifdef APP_NFC
nfc_cli_init,
#endif
};
const size_t FLIPPER_ON_SYSTEM_START_COUNT =
sizeof(FLIPPER_ON_SYSTEM_START_COUNT) / sizeof(FlipperOnStartHook);
// Plugin menu
const FlipperApplication FLIPPER_PLUGINS[] = {