mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-22 12:51:39 +03:00
8af2198684
* Move structs to header * roll mbedtls into loclass * Picopass with scene for reading card * Picopass: fix memory leak * Lib: return mbedtls back * Picopass: rename symbols to match naming guide Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
34 lines
957 B
C
34 lines
957 B
C
#include "picopass_device.h"
|
|
|
|
#include <toolbox/path.h>
|
|
#include <flipper_format/flipper_format.h>
|
|
|
|
#define TAG "PicopassDevice"
|
|
|
|
PicopassDevice* picopass_device_alloc() {
|
|
PicopassDevice* picopass_dev = malloc(sizeof(PicopassDevice));
|
|
picopass_dev->storage = furi_record_open("storage");
|
|
picopass_dev->dialogs = furi_record_open("dialogs");
|
|
return picopass_dev;
|
|
}
|
|
|
|
void picopass_device_clear(PicopassDevice* dev) {
|
|
furi_assert(dev);
|
|
|
|
picopass_device_data_clear(&dev->dev_data);
|
|
memset(&dev->dev_data, 0, sizeof(dev->dev_data));
|
|
}
|
|
|
|
void picopass_device_free(PicopassDevice* picopass_dev) {
|
|
furi_assert(picopass_dev);
|
|
picopass_device_clear(picopass_dev);
|
|
furi_record_close("storage");
|
|
furi_record_close("dialogs");
|
|
free(picopass_dev);
|
|
}
|
|
|
|
void picopass_device_data_clear(PicopassDeviceData* dev_data) {
|
|
FURI_LOG_D(TAG, "picopass_device_data_clear");
|
|
memset(&dev_data->AA1, 0, sizeof(ApplicationArea));
|
|
}
|