Skip to content

Commit

Permalink
Fix subghz actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed May 29, 2024
1 parent fbc80be commit a00bc10
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions actions/action_subghz.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,7 @@ void action_subghz_tx(void* context, const FuriString* action_path, FuriString*
}
} else { // if not RAW protocol
FURI_LOG_I(TAG, "Protocol != RAW");
bool repeat_exists = flipper_format_key_exist(fff_data_file, "Repeat");
if(!repeat_exists) {
flipper_format_write_uint32(fff_data_file, "Repeat", &repeat, 1);
}
flipper_format_insert_or_update_uint32(fff_data_file, "Repeat", &repeat, 1);
transmitter =
subghz_transmitter_alloc_init(environment, furi_string_get_cstr(temp_str));
if(transmitter == NULL) {
Expand All @@ -240,17 +237,16 @@ void action_subghz_tx(void* context, const FuriString* action_path, FuriString*
is_init_protocol = false;
}
}
if(!repeat_exists) {
flipper_format_delete_key(fff_data_file, "Repeat");
}
}

if(is_init_protocol) {
check_file = true;
} else {
subghz_devices_sleep(device);
subghz_devices_end(device);
subghz_transmitter_free(transmitter);
if(transmitter != NULL) {
subghz_transmitter_free(transmitter);
}
}
} while(false);

Expand Down

0 comments on commit a00bc10

Please sign in to comment.