mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-19 11:21:39 +03:00
Fix Repeat in subghz remote
This commit is contained in:
parent
d4b32dc143
commit
3b7b48be4a
@ -385,18 +385,36 @@ bool subghz_remote_key_load(
|
||||
FURI_LOG_E(TAG, "Could not read Protocol.");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!furi_string_cmp_str(preset->protocol, "RAW")) {
|
||||
subghz_protocol_raw_gen_fff_data(fff_data, path);
|
||||
// repeat
|
||||
if(!flipper_format_insert_or_update_uint32(fff_data, "Repeat", &preset->repeat, 1)) {
|
||||
FURI_LOG_E(TAG, "Unable to insert or update Repeat");
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_rewind(fff_data)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
stream_copy_full(
|
||||
flipper_format_get_raw_stream(fff_file), flipper_format_get_raw_stream(fff_data));
|
||||
}
|
||||
|
||||
// repeat
|
||||
if(!flipper_format_insert_or_update_uint32(fff_file, "Repeat", &preset->repeat, 1)) {
|
||||
if(!flipper_format_insert_or_update_uint32(fff_data, "Repeat", &preset->repeat, 1)) {
|
||||
FURI_LOG_E(TAG, "Unable to insert or update Repeat");
|
||||
break;
|
||||
}
|
||||
if(!flipper_format_rewind(fff_data)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!flipper_format_rewind(fff_file)) {
|
||||
FURI_LOG_E(TAG, "Rewind error");
|
||||
return false;
|
||||
}
|
||||
|
||||
preset->decoder = subghz_receiver_search_decoder_base_by_name(
|
||||
receiver, furi_string_get_cstr(preset->protocol));
|
||||
@ -478,11 +496,11 @@ void subghz_remote_tx_stop(SubGHzRemote* app) {
|
||||
protocol_registry_items, furi_string_get_cstr(app->txpreset->protocol));
|
||||
//FURI_LOG_D(TAG, "Protocol-TYPE %d", proto->type);
|
||||
|
||||
if(proto && proto->type == SubGhzProtocolTypeDynamic) {
|
||||
//FURI_LOG_D(TAG, "Protocol is dynamic. Saving key");
|
||||
// Remove repeat if it was present
|
||||
flipper_format_delete_key(app->tx_fff_data, "Repeat");
|
||||
|
||||
if(proto && proto->type == SubGhzProtocolTypeDynamic) {
|
||||
//FURI_LOG_D(TAG, "Protocol is dynamic. Saving key");
|
||||
subghz_remote_save_protocol_to_file(app->tx_fff_data, app->tx_file_path);
|
||||
|
||||
keeloq_reset_mfname();
|
||||
|
Loading…
Reference in New Issue
Block a user