mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
fix dir creation bug, save files only for RAW
TODO: files are broken when they have more than 512 elements in one line Split file to 512 element chunks as it done in regular Read RAW
This commit is contained in:
@@ -93,7 +93,7 @@ bool subghz_history_clear_dir_or_create(SubGhzHistory* instance, bool only_remov
|
||||
|
||||
// Uncomment it
|
||||
// Stage 2 - create dir
|
||||
if(!only_remove_dir && res) {
|
||||
if(!only_remove_dir) {
|
||||
res = storage_simply_mkdir(instance->storage, SUBGHZ_HISTORY_TMP_DIR);
|
||||
#if FURI_DEBUG
|
||||
FURI_LOG_D(TAG, "storage_simply_mkdir done: %s", res ? "true" : "false");
|
||||
@@ -189,9 +189,9 @@ void subghz_history_reset(SubGhzHistory* instance) {
|
||||
instance->last_index_write = 0;
|
||||
instance->code_last_hash_data = 0;
|
||||
|
||||
if(instance->write_tmp_files) {
|
||||
/*if(instance->write_tmp_files) {
|
||||
instance->write_tmp_files = subghz_history_clear_dir_or_create(instance, false);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
uint16_t subghz_history_get_item(SubGhzHistory* instance) {
|
||||
@@ -329,6 +329,8 @@ bool subghz_history_add_to_history(
|
||||
string_init(item->item_str);
|
||||
string_init(item->protocol_name);
|
||||
|
||||
bool tmp_file_for_raw = false;
|
||||
|
||||
// At this point file mapped to memory otherwise file cannot decoded
|
||||
item->flipper_string = flipper_format_string_alloc();
|
||||
subghz_protocol_decoder_base_serialize(decoder_base, item->flipper_string, preset);
|
||||
@@ -357,6 +359,7 @@ bool subghz_history_add_to_history(
|
||||
if(!flipper_format_rewind(item->flipper_string)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
}
|
||||
tmp_file_for_raw = true;
|
||||
|
||||
break;
|
||||
} else if(!strcmp(string_get_cstr(instance->tmp_string), "KeeLoq")) {
|
||||
@@ -414,7 +417,7 @@ bool subghz_history_add_to_history(
|
||||
|
||||
// If we can write to files
|
||||
//bool no_close = false;
|
||||
if(instance->write_tmp_files) {
|
||||
if(instance->write_tmp_files && tmp_file_for_raw) {
|
||||
string_t filename;
|
||||
string_t dir_path;
|
||||
string_init(filename);
|
||||
|
||||
Reference in New Issue
Block a user