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
This commit is contained in:
MX 2023-02-03 17:20:10 +03:00
parent edddfbcb2c
commit 8c50225da4
No known key found for this signature in database
GPG Key ID: 7CCC66B7DBDD1C83

View File

@ -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);
}