mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
struct doesn't correct written
This commit is contained in:
@@ -1,36 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "subghz_last_settings_filename.h"
|
||||
|
||||
#include <furi_hal.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <toolbox/saved_struct.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#define SUBGHZ_LAST_SETTINGS_VER (1)
|
||||
#define SUBGHZ_LAST_SETTINGS_PATH EXT_PATH(SUBGHZ_LAST_SETTINGS_FILE_NAME)
|
||||
#define SUBGHZ_LAST_SETTINGS_MAGIC (0xCC)
|
||||
|
||||
#define SAVE_SUBGHZ_LAST_SETTINGS(x) \
|
||||
saved_struct_save( \
|
||||
SUBGHZ_LAST_SETTINGS_PATH, \
|
||||
(x), \
|
||||
sizeof(SubGhzLastSettings), \
|
||||
SUBGHZ_LAST_SETTINGS_MAGIC, \
|
||||
SUBGHZ_LAST_SETTINGS_VER)
|
||||
|
||||
#define LOAD_SUBGHZ_LAST_SETTINGS(x) \
|
||||
saved_struct_load( \
|
||||
SUBGHZ_LAST_SETTINGS_PATH, \
|
||||
(x), \
|
||||
sizeof(SubGhzLastSettings), \
|
||||
SUBGHZ_LAST_SETTINGS_MAGIC, \
|
||||
SUBGHZ_LAST_SETTINGS_VER)
|
||||
|
||||
typedef struct {
|
||||
uint32_t frequency;
|
||||
uint8_t preset;
|
||||
int32_t preset;
|
||||
} SubGhzLastSettings;
|
||||
|
||||
void subghz_last_settings_check_struct(void);
|
||||
SubGhzLastSettings* subghz_last_settings_alloc(void);
|
||||
|
||||
void subghz_last_settings_free(SubGhzLastSettings* instance);
|
||||
|
||||
void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count);
|
||||
|
||||
bool subghz_last_settings_save(SubGhzLastSettings* instance);
|
||||
Reference in New Issue
Block a user