Flipper Zero Firmware
Loading...
Searching...
No Matches
desktop_settings.h
1#pragma once
2
3#include "desktop_settings_filename.h"
4
5#include <furi_hal.h>
6#include <stdint.h>
7#include <stdbool.h>
9#include <storage/storage.h>
10
11#define DESKTOP_SETTINGS_VER (10)
12
13#define DESKTOP_SETTINGS_PATH INT_PATH(DESKTOP_SETTINGS_FILE_NAME)
14#define DESKTOP_SETTINGS_MAGIC (0x17)
15#define PIN_MAX_LENGTH 12
16
17#define DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG "run_pin_setup"
18
19#define DESKTOP_SETTINGS_SAVE(x) \
20 saved_struct_save( \
21 DESKTOP_SETTINGS_PATH, \
22 (x), \
23 sizeof(DesktopSettings), \
24 DESKTOP_SETTINGS_MAGIC, \
25 DESKTOP_SETTINGS_VER)
26
27#define DESKTOP_SETTINGS_LOAD(x) \
28 saved_struct_load( \
29 DESKTOP_SETTINGS_PATH, \
30 (x), \
31 sizeof(DesktopSettings), \
32 DESKTOP_SETTINGS_MAGIC, \
33 DESKTOP_SETTINGS_VER)
34
35#define MAX_PIN_SIZE 10
36#define MIN_PIN_SIZE 4
37#define MAX_APP_LENGTH 128
38
39typedef enum {
40 FavoriteAppLeftShort = 0,
41 FavoriteAppLeftLong,
42 FavoriteAppRightShort,
43 FavoriteAppRightLong,
44 FavoriteAppNumber,
45} FavoriteAppShortcut;
46
47typedef enum {
48 DummyAppLeft = 0,
49 DummyAppRight,
50 DummyAppDown,
51 DummyAppOk,
52 DummyAppNumber,
53} DummyAppShortcut;
54
55typedef struct {
56 InputKey data[MAX_PIN_SIZE];
57 uint8_t length;
58} PinCode;
59
60typedef struct {
61 char name_or_path[MAX_APP_LENGTH];
63
64typedef struct {
65 PinCode pin_code;
66 uint32_t auto_lock_delay_ms;
67 uint8_t dummy_mode;
68 uint8_t display_clock;
69 FavoriteApp favorite_apps[FavoriteAppNumber];
70 FavoriteApp dummy_apps[DummyAppNumber];
Furi HAL API.
SavedStruct - data serialization/de-serialization.
APIs for working with storages, directories and files.
Definition desktop_settings.h:64
Definition desktop_settings.h:60
Definition desktop_settings.h:55