From d2bb1ef4d3878e38318e8221080555f59fdba558 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 16 Sep 2022 21:30:53 +0300 Subject: [PATCH] fix receiver filter set-up --- applications/main/subghz/scenes/subghz_scene_receiver.c | 7 ++++++- applications/main/subghz/subghz.c | 2 +- applications/main/subghz/subghz_history.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/applications/main/subghz/scenes/subghz_scene_receiver.c b/applications/main/subghz/scenes/subghz_scene_receiver.c index 70ed4c9b4..eedec9ac4 100644 --- a/applications/main/subghz/scenes/subghz_scene_receiver.c +++ b/applications/main/subghz/scenes/subghz_scene_receiver.c @@ -100,6 +100,8 @@ static void subghz_scene_add_to_history_callback( void subghz_scene_receiver_on_enter(void* context) { SubGhz* subghz = context; + subghz_last_setting_set_receiver_values(subghz->last_setting, subghz->txrx->receiver); + string_t str_buff; string_init(str_buff); @@ -248,5 +250,8 @@ bool subghz_scene_receiver_on_event(void* context, SceneManagerEvent event) { } void subghz_scene_receiver_on_exit(void* context) { - UNUSED(context); + SubGhz* subghz = context; + + //filter restoration + subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable); } diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index 2aa29cc84..84c775c3a 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -207,7 +207,7 @@ SubGhz* subghz_alloc() { subghz->txrx->receiver = subghz_receiver_alloc_init(subghz->txrx->environment); // Setup values - subghz_last_setting_set_receiver_values(subghz->last_setting, subghz->txrx->receiver); + subghz_receiver_set_filter(subghz->txrx->receiver, SubGhzProtocolFlag_Decodable); subghz_worker_set_overrun_callback( subghz->txrx->worker, (SubGhzWorkerOverrunCallback)subghz_receiver_reset); diff --git a/applications/main/subghz/subghz_history.c b/applications/main/subghz/subghz_history.c index 427ee624c..efa63689f 100644 --- a/applications/main/subghz/subghz_history.c +++ b/applications/main/subghz/subghz_history.c @@ -1,7 +1,7 @@ #include "subghz_history.h" #include -#define SUBGHZ_HISTORY_MAX 50 +#define SUBGHZ_HISTORY_MAX 65 #define TAG "SubGhzHistory" typedef struct {