mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
Rework by review finished
This commit is contained in:
@@ -134,19 +134,14 @@ void subghz_scene_signal_settings_on_exit(void* context) {
|
|||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
|
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
|
||||||
|
|
||||||
// check is the file available for update or write brand new value to it
|
// check is the file available for update/insert CounterMode value
|
||||||
if(flipper_format_file_open_existing(fff_data_file, file_path)) {
|
if(flipper_format_file_open_existing(fff_data_file, file_path)) {
|
||||||
if(flipper_format_update_uint32(fff_data_file, "CounterMode", &counter_mode, 1)) {
|
if(flipper_format_insert_or_update_uint32(
|
||||||
FURI_LOG_D(TAG, "Successfully update CounterMode value to %li", counter_mode);
|
fff_data_file, "CounterMode", &counter_mode, 1)) {
|
||||||
|
FURI_LOG_D(
|
||||||
|
TAG, "Successfully updated/inserted CounterMode value %li", counter_mode);
|
||||||
} else {
|
} else {
|
||||||
FURI_LOG_E(TAG, "Error update CounterMode value trying append and add .. ");
|
FURI_LOG_E(TAG, "Error update/insert CounterMode value");
|
||||||
flipper_format_file_close(fff_data_file);
|
|
||||||
flipper_format_file_open_append(fff_data_file, file_path);
|
|
||||||
if(flipper_format_write_uint32(fff_data_file, "CounterMode", &counter_mode, 1)) {
|
|
||||||
FURI_LOG_D(TAG, "Successfully added CounterMode value %li", counter_mode);
|
|
||||||
} else {
|
|
||||||
FURI_LOG_E(TAG, "Error with adding CounterMode value %li", counter_mode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FURI_LOG_E(TAG, "Error open file %s for writing", file_path);
|
FURI_LOG_E(TAG, "Error open file %s for writing", file_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user