From 8c50225da46fe9a838474f6aab6526da41085a3f Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 3 Feb 2023 17:20:10 +0300 Subject: [PATCH] Fix issue with external module settings It was possible to set it to external module without module connected, and as it saves its state in memory, all other plugins that uses subghz will not work, now we checking for module when you changing that setting --- .../subghz/scenes/subghz_scene_ext_module_settings.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/applications/main/subghz/scenes/subghz_scene_ext_module_settings.c b/applications/main/subghz/scenes/subghz_scene_ext_module_settings.c index dabf42d42..3f2c4240b 100644 --- a/applications/main/subghz/scenes/subghz_scene_ext_module_settings.c +++ b/applications/main/subghz/scenes/subghz_scene_ext_module_settings.c @@ -44,11 +44,20 @@ bool subghz_scene_ext_module_settings_on_event(void* context, SceneManagerEvent UNUSED(subghz); UNUSED(event); + furi_hal_subghz_set_radio_type(value_index); + + if(!furi_hal_subghz_check_radio()) { + value_index = 0; + furi_hal_subghz_set_radio_type(value_index); + furi_string_set(subghz->error_str, "Please connect\nexternal radio"); + scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowErrorSub); + } + return false; } void subghz_scene_ext_module_settings_on_exit(void* context) { SubGhz* subghz = context; variable_item_list_reset(subghz->variable_item_list); - furi_hal_subghz_set_radio_type(value_index); + //furi_hal_subghz_set_radio_type(value_index); }