[FL-2970] Untangle NFC_APP_FOLDER from nfc_device (#2124)

* Untangle NFC_APP_FOLDER from nfc_device
* Make the folder an internal part of the nfc device struct
* Move the NFC folder definition to the nfc allocator
* Move the NFC folder definition to the allocator in the nfc magic FAP
* Replace furi_string_printf with furi_string_set for folder allocation and handle the cases when folder has no slashes
* Build and allocation fixes

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Astra
2022-12-19 21:57:48 +02:00
committed by GitHub
parent a81a5ca57c
commit fa87216a1e
6 changed files with 53 additions and 12 deletions

View File

@@ -49,6 +49,7 @@ NfcMagic* nfc_magic_alloc() {
// Nfc device
nfc_magic->nfc_dev = nfc_device_alloc();
furi_string_set(nfc_magic->nfc_dev->folder, NFC_APP_FOLDER);
// Open GUI record
nfc_magic->gui = furi_record_open(RECORD_GUI);

View File

@@ -27,6 +27,8 @@
#include <lib/nfc/nfc_device.h>
#include "nfc_magic_icons.h"
#define NFC_APP_FOLDER ANY_PATH("nfc")
enum NfcMagicCustomEvent {
// Reserve first 100 events for button types and indexes, starting from 0
NfcMagicCustomEventReserved = 100,