mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
subghz option to delete old signals on full memory
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_IGNORE_FILTER "IgnoreFilter"
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_FILTER "Filter"
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_RSSI_THRESHOLD "RSSI"
|
||||
#define SUBGHZ_LAST_SETTING_FIELD_DELETE_OLD "DelOldSignals"
|
||||
|
||||
SubGhzLastSettings* subghz_last_settings_alloc(void) {
|
||||
SubGhzLastSettings* instance = malloc(sizeof(SubGhzLastSettings));
|
||||
@@ -44,6 +45,7 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count
|
||||
bool temp_external_module_power_amp = false;
|
||||
bool temp_timestamp_file_names = false;
|
||||
bool temp_enable_hopping = false;
|
||||
bool temp_delete_old_sig = false;
|
||||
uint32_t temp_ignore_filter = 0;
|
||||
uint32_t temp_filter = 0;
|
||||
float temp_rssi = 0;
|
||||
@@ -106,6 +108,8 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count
|
||||
1);
|
||||
filter_was_read = flipper_format_read_uint32(
|
||||
fff_data_file, SUBGHZ_LAST_SETTING_FIELD_FILTER, (uint32_t*)&temp_filter, 1);
|
||||
flipper_format_read_bool(
|
||||
fff_data_file, SUBGHZ_LAST_SETTING_FIELD_DELETE_OLD, (bool*)&temp_delete_old_sig, 1);
|
||||
} else {
|
||||
FURI_LOG_E(TAG, "Error open file %s", SUBGHZ_LAST_SETTINGS_PATH);
|
||||
}
|
||||
@@ -156,6 +160,8 @@ void subghz_last_settings_load(SubGhzLastSettings* instance, size_t preset_count
|
||||
|
||||
instance->timestamp_file_names = temp_timestamp_file_names;
|
||||
|
||||
instance->delete_old_signals = temp_delete_old_sig;
|
||||
|
||||
// External power amp CC1101
|
||||
instance->external_module_power_amp = temp_external_module_power_amp;
|
||||
|
||||
@@ -270,6 +276,10 @@ bool subghz_last_settings_save(SubGhzLastSettings* instance) {
|
||||
file, SUBGHZ_LAST_SETTING_FIELD_FILTER, &instance->filter, 1)) {
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_insert_or_update_bool(
|
||||
file, SUBGHZ_LAST_SETTING_FIELD_DELETE_OLD, &instance->delete_old_signals, 1)) {
|
||||
break;
|
||||
}
|
||||
saved = true;
|
||||
} while(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user