This commit is contained in:
Willy-JL
2023-03-06 17:40:02 +00:00
33 changed files with 114 additions and 68 deletions
@@ -122,6 +122,9 @@ POCSAGPagerApp* pocsag_pager_app_alloc() {
app->txrx->worker, (SubGhzWorkerPairCallback)subghz_receiver_decode);
subghz_worker_set_context(app->txrx->worker, app->txrx->receiver);
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
furi_hal_power_suppress_charge_enter();
scene_manager_next_scene(app->scene_manager, POCSAGPagerSceneStart);
@@ -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
@@ -167,6 +167,9 @@ ProtoViewApp* protoview_app_alloc() {
app->frequency = subghz_setting_get_default_frequency(app->setting);
app->modulation = 0; /* Defaults to ProtoViewModulations[0]. */
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
furi_hal_power_suppress_charge_enter();
app->running = 1;
@@ -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) {
@@ -400,6 +403,9 @@ int32_t spectrum_analyzer_app(void* p) {
SpectrumAnalyzer* spectrum_analyzer = spectrum_analyzer_alloc();
InputEvent input;
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
furi_hal_power_suppress_charge_enter();
FURI_LOG_D("Spectrum", "Main Loop - Starting worker");
@@ -1,5 +1,5 @@
App(
appid="SubGHz_Playlist",
appid="subghz_playlist",
name="Sub-GHz Playlist",
apptype=FlipperAppType.EXTERNAL,
entry_point="playlist_app",

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

@@ -672,6 +672,9 @@ int32_t playlist_app(void* p) {
Playlist* app = playlist_alloc(meta);
meta->view_port = app->view_port;
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
furi_hal_power_suppress_charge_enter();
// select playlist file
@@ -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)) {

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

@@ -105,6 +105,9 @@ WeatherStationApp* weather_station_app_alloc() {
app->txrx->worker, (SubGhzWorkerPairCallback)subghz_receiver_decode);
subghz_worker_set_context(app->txrx->worker, app->txrx->receiver);
// Enable power for External CC1101 if it is connected
furi_hal_subghz_enable_ext_power();
furi_hal_power_suppress_charge_enter();
scene_manager_next_scene(app->scene_manager, WeatherStationSceneStart);
@@ -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);