mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-24 01:28:11 -07:00
Fix subghz external module power issues
This commit is contained in:
@@ -73,10 +73,6 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
|
|||||||
subghz->in_decoder_scene = false;
|
subghz->in_decoder_scene = false;
|
||||||
subghz->in_decoder_scene_skip = false;
|
subghz->in_decoder_scene_skip = false;
|
||||||
|
|
||||||
// Call enable power for external module
|
|
||||||
furi_hal_subghz_enable_ext_power();
|
|
||||||
furi_delay_ms(15);
|
|
||||||
|
|
||||||
// View Dispatcher
|
// View Dispatcher
|
||||||
subghz->view_dispatcher = view_dispatcher_alloc();
|
subghz->view_dispatcher = view_dispatcher_alloc();
|
||||||
view_dispatcher_enable_queue(subghz->view_dispatcher);
|
view_dispatcher_enable_queue(subghz->view_dispatcher);
|
||||||
@@ -425,9 +421,6 @@ void subghz_free(SubGhz* subghz, bool alloc_for_tx_only) {
|
|||||||
|
|
||||||
// The rest
|
// The rest
|
||||||
free(subghz);
|
free(subghz);
|
||||||
|
|
||||||
// Disable power for External CC1101 if it was enabled and module is connected
|
|
||||||
furi_hal_subghz_disable_ext_power();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t subghz_app(void* p) {
|
int32_t subghz_app(void* p) {
|
||||||
@@ -452,6 +445,9 @@ int32_t subghz_app(void* p) {
|
|||||||
subghz_environment_load_keystore(
|
subghz_environment_load_keystore(
|
||||||
subghz->txrx->environment, EXT_PATH("subghz/assets/keeloq_mfcodes_user"));
|
subghz->txrx->environment, EXT_PATH("subghz/assets/keeloq_mfcodes_user"));
|
||||||
|
|
||||||
|
// Call enable power for external module
|
||||||
|
furi_hal_subghz_enable_ext_power();
|
||||||
|
|
||||||
// Auto switch to internal radio if external radio is not available
|
// Auto switch to internal radio if external radio is not available
|
||||||
if(!furi_hal_subghz_check_radio()) {
|
if(!furi_hal_subghz_check_radio()) {
|
||||||
subghz->last_settings->external_module_enabled = false;
|
subghz->last_settings->external_module_enabled = false;
|
||||||
@@ -509,6 +505,8 @@ int32_t subghz_app(void* p) {
|
|||||||
view_dispatcher_run(subghz->view_dispatcher);
|
view_dispatcher_run(subghz->view_dispatcher);
|
||||||
|
|
||||||
furi_hal_power_suppress_charge_exit();
|
furi_hal_power_suppress_charge_exit();
|
||||||
|
// Disable power for External CC1101 if it was enabled and module is connected
|
||||||
|
furi_hal_subghz_disable_ext_power();
|
||||||
|
|
||||||
subghz_free(subghz, alloc_for_tx);
|
subghz_free(subghz, alloc_for_tx);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user