mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-14 08:47:13 +00:00
External module power bug fixes
This commit is contained in:
parent
5ddb9bd444
commit
c560394358
4 changed files with 7 additions and 3 deletions
|
@ -181,7 +181,7 @@ bool subghz_scene_ext_module_settings_on_event(void* context, SceneManagerEvent
|
|||
// Check if module is present, if no -> show error
|
||||
if(!furi_hal_subghz_check_radio()) {
|
||||
value_index_exm = 0;
|
||||
furi_hal_subghz_set_radio_type(value_index_exm);
|
||||
furi_hal_subghz_set_radio_type(SubGhzRadioInternal);
|
||||
furi_string_set(subghz->error_str, "Please connect\nexternal radio");
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowErrorSub);
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
|
|||
furi_hal_subghz_enable_ext_power();
|
||||
|
||||
if(!furi_hal_subghz_check_radio()) {
|
||||
furi_hal_subghz_set_radio_type(SubGhzRadioInternal);
|
||||
furi_string_set(subghz->error_str, "Please connect\nexternal radio");
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowErrorSub);
|
||||
return true;
|
||||
|
|
|
@ -73,6 +73,9 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
|
|||
subghz->in_decoder_scene = false;
|
||||
subghz->in_decoder_scene_skip = false;
|
||||
|
||||
// Call enable power for external module
|
||||
furi_hal_subghz_enable_ext_power();
|
||||
|
||||
// View Dispatcher
|
||||
subghz->view_dispatcher = view_dispatcher_alloc();
|
||||
view_dispatcher_enable_queue(subghz->view_dispatcher);
|
||||
|
|
|
@ -93,10 +93,10 @@ bool furi_hal_subghz_enable_ext_power(void) {
|
|||
}
|
||||
if(furi_hal_subghz.radio_type != SubGhzRadioInternal) {
|
||||
uint8_t attempts = 0;
|
||||
while(!furi_hal_power_is_otg_enabled() && attempts++ < 2) {
|
||||
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
|
||||
furi_hal_power_enable_otg();
|
||||
//CC1101 power-up time
|
||||
furi_delay_ms(5);
|
||||
furi_delay_ms(10);
|
||||
}
|
||||
}
|
||||
return furi_hal_power_is_otg_enabled();
|
||||
|
|
Loading…
Reference in a new issue