mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 20:49:49 +04:00
subghz raw erase fixes
by @Willy-JL
This commit is contained in:
@@ -50,6 +50,12 @@ bool subghz_scene_need_saving_on_event(void* context, SceneManagerEvent event) {
|
|||||||
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
|
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateIDLE);
|
||||||
|
|
||||||
if(state == SubGhzRxKeyStateExit) {
|
if(state == SubGhzRxKeyStateExit) {
|
||||||
|
if(scene_manager_has_previous_scene(subghz->scene_manager, SubGhzSceneReadRAW)) {
|
||||||
|
if(!furi_string_empty(subghz->file_path_tmp)) {
|
||||||
|
subghz_delete_file(subghz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
subghz_txrx_set_preset(
|
subghz_txrx_set_preset(
|
||||||
subghz->txrx, "AM650", subghz->last_settings->frequency, NULL, 0);
|
subghz->txrx, "AM650", subghz->last_settings->frequency, NULL, 0);
|
||||||
scene_manager_search_and_switch_to_previous_scene(
|
scene_manager_search_and_switch_to_previous_scene(
|
||||||
|
|||||||
@@ -144,6 +144,11 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
if((subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) ||
|
if((subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) ||
|
||||||
(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateBack)) {
|
(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateBack)) {
|
||||||
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateExit);
|
subghz_rx_key_state_set(subghz, SubGhzRxKeyStateExit);
|
||||||
|
if(subghz_scene_read_raw_update_filename(subghz)) {
|
||||||
|
furi_string_set(subghz->file_path_tmp, subghz->file_path);
|
||||||
|
} else {
|
||||||
|
furi_string_reset(subghz->file_path_tmp);
|
||||||
|
}
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneNeedSaving);
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneNeedSaving);
|
||||||
} else {
|
} else {
|
||||||
//Restore default setting
|
//Restore default setting
|
||||||
@@ -178,7 +183,8 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SubGhzCustomEventViewReadRAWErase:
|
case SubGhzCustomEventViewReadRAWErase:
|
||||||
if(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) {
|
if((subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateAddKey) ||
|
||||||
|
(subghz_rx_key_state_get(subghz) == SubGhzRxKeyStateBack)) {
|
||||||
if(subghz_scene_read_raw_update_filename(subghz)) {
|
if(subghz_scene_read_raw_update_filename(subghz)) {
|
||||||
furi_string_set(subghz->file_path_tmp, subghz->file_path);
|
furi_string_set(subghz->file_path_tmp, subghz->file_path);
|
||||||
subghz_delete_file(subghz);
|
subghz_delete_file(subghz);
|
||||||
|
|||||||
Reference in New Issue
Block a user