2021-09-28 12:40:39 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
2021-11-03 20:22:49 +03:00
|
|
|
#include <toolbox/saved_struct.h>
|
2021-09-28 12:40:39 +03:00
|
|
|
|
2021-10-26 21:34:31 +03:00
|
|
|
#define DESKTOP_SETTINGS_VER (1)
|
2021-11-03 20:22:49 +03:00
|
|
|
#define DESKTOP_SETTINGS_PATH "/int/desktop.settings"
|
|
|
|
#define DESKTOP_SETTINGS_MAGIC (0x17)
|
2021-10-26 21:34:31 +03:00
|
|
|
#define PIN_MAX_LENGTH 12
|
|
|
|
|
2021-11-03 20:22:49 +03:00
|
|
|
#define SAVE_DESKTOP_SETTINGS(x) \
|
|
|
|
saved_struct_save( \
|
|
|
|
DESKTOP_SETTINGS_PATH, \
|
|
|
|
(x), \
|
|
|
|
sizeof(DesktopSettings), \
|
|
|
|
DESKTOP_SETTINGS_MAGIC, \
|
|
|
|
DESKTOP_SETTINGS_VER)
|
|
|
|
|
|
|
|
#define LOAD_DESKTOP_SETTINGS(x) \
|
|
|
|
saved_struct_load( \
|
|
|
|
DESKTOP_SETTINGS_PATH, \
|
|
|
|
(x), \
|
|
|
|
sizeof(DesktopSettings), \
|
|
|
|
DESKTOP_SETTINGS_MAGIC, \
|
|
|
|
DESKTOP_SETTINGS_VER)
|
|
|
|
|
2021-10-26 21:34:31 +03:00
|
|
|
typedef struct {
|
|
|
|
uint8_t length;
|
|
|
|
uint8_t data[PIN_MAX_LENGTH];
|
|
|
|
} PinCode;
|
2021-09-28 12:40:39 +03:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint16_t favorite;
|
2021-10-26 21:34:31 +03:00
|
|
|
PinCode pincode;
|
2021-09-28 12:40:39 +03:00
|
|
|
} DesktopSettings;
|