Skip to content

Commit a00bc10

Browse files
committed
Fix subghz actions
1 parent fbc80be commit a00bc10

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

actions/action_subghz.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@ void action_subghz_tx(void* context, const FuriString* action_path, FuriString*
222222
}
223223
} else { // if not RAW protocol
224224
FURI_LOG_I(TAG, "Protocol != RAW");
225-
bool repeat_exists = flipper_format_key_exist(fff_data_file, "Repeat");
226-
if(!repeat_exists) {
227-
flipper_format_write_uint32(fff_data_file, "Repeat", &repeat, 1);
228-
}
225+
flipper_format_insert_or_update_uint32(fff_data_file, "Repeat", &repeat, 1);
229226
transmitter =
230227
subghz_transmitter_alloc_init(environment, furi_string_get_cstr(temp_str));
231228
if(transmitter == NULL) {
@@ -240,17 +237,16 @@ void action_subghz_tx(void* context, const FuriString* action_path, FuriString*
240237
is_init_protocol = false;
241238
}
242239
}
243-
if(!repeat_exists) {
244-
flipper_format_delete_key(fff_data_file, "Repeat");
245-
}
246240
}
247241

248242
if(is_init_protocol) {
249243
check_file = true;
250244
} else {
251245
subghz_devices_sleep(device);
252246
subghz_devices_end(device);
253-
subghz_transmitter_free(transmitter);
247+
if(transmitter != NULL) {
248+
subghz_transmitter_free(transmitter);
249+
}
254250
}
255251
} while(false);
256252

0 commit comments

Comments
 (0)