Fix issues with external module 5v power

This commit is contained in:
MX
2023-03-06 10:08:59 +03:00
parent 507c8582ca
commit f25af91d23
8 changed files with 47 additions and 5 deletions
+5
View File
@@ -674,6 +674,9 @@ int32_t playlist_app(void* p) {
furi_hal_power_suppress_charge_enter();
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
// select playlist file
{
DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
@@ -752,6 +755,8 @@ int32_t playlist_app(void* p) {
exit_cleanup:
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();
if(app->worker != NULL) {
if(playlist_worker_running(app->worker)) {
@@ -124,6 +124,9 @@ POCSAGPagerApp* pocsag_pager_app_alloc() {
furi_hal_power_suppress_charge_enter();
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
scene_manager_next_scene(app->scene_manager, POCSAGPagerSceneStart);
return app;
@@ -135,6 +138,9 @@ void pocsag_pager_app_free(POCSAGPagerApp* app) {
//CC1101 off
pcsg_sleep(app);
// Disable power for External CC1101 if it was enabled and module is connected
furi_hal_subghz_disable_ext_power();
// Submenu
view_dispatcher_remove_view(app->view_dispatcher, POCSAGPagerViewSubmenu);
submenu_free(app->submenu);
+6
View File
@@ -170,6 +170,9 @@ ProtoViewApp* protoview_app_alloc() {
furi_hal_power_suppress_charge_enter();
app->running = 1;
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
return app;
}
@@ -182,6 +185,9 @@ void protoview_app_free(ProtoViewApp* app) {
// Put CC1101 on sleep, this also restores charging.
radio_sleep(app);
// Disable power for External CC1101 if it was enabled and module is connected
furi_hal_subghz_disable_ext_power();
// View related.
view_port_enabled_set(app->view_port, false);
gui_remove_view_port(app->gui, app->view_port);
@@ -392,6 +392,9 @@ void spectrum_analyzer_free(SpectrumAnalyzer* instance) {
furi_hal_subghz_idle();
furi_hal_subghz_sleep();
// Disable power for External CC1101 if it was enabled and module is connected
furi_hal_subghz_disable_ext_power();
}
int32_t spectrum_analyzer_app(void* p) {
@@ -402,6 +405,9 @@ int32_t spectrum_analyzer_app(void* p) {
furi_hal_power_suppress_charge_enter();
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
FURI_LOG_D("Spectrum", "Main Loop - Starting worker");
furi_delay_ms(50);
@@ -107,6 +107,9 @@ WeatherStationApp* weather_station_app_alloc() {
furi_hal_power_suppress_charge_enter();
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
scene_manager_next_scene(app->scene_manager, WeatherStationSceneStart);
return app;
@@ -118,6 +121,9 @@ void weather_station_app_free(WeatherStationApp* app) {
//CC1101 off
ws_sleep(app);
// Disable power for External CC1101 if it was enabled and module is connected
furi_hal_subghz_disable_ext_power();
// Submenu
view_dispatcher_remove_view(app->view_dispatcher, WeatherStationViewSubmenu);
submenu_free(app->submenu);