@@ -29,10 +29,12 @@ const char* const detect_raw_text[DETECT_RAW_COUNT] = {
2929 "ON" ,
3030};
3131
32+ #ifndef SUBGHZ_SAVE_DETECT_RAW_SETTING
3233const SubGhzProtocolFlag detect_raw_value [DETECT_RAW_COUNT ] = {
3334 SubGhzProtocolFlag_Decodable ,
3435 SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_RAW ,
3536};
37+ #endif
3638
3739#define RSSI_THRESHOLD_COUNT 7
3840const char * const rssi_threshold_text [RSSI_THRESHOLD_COUNT ] = {
@@ -105,6 +107,7 @@ uint8_t subghz_scene_receiver_config_hopper_value_index(
105107 }
106108}
107109
110+ #ifndef SUBGHZ_SAVE_DETECT_RAW_SETTING
108111uint8_t subghz_scene_receiver_config_detect_raw_value_index (
109112 const SubGhzProtocolFlag value ,
110113 const SubGhzProtocolFlag values [],
@@ -118,6 +121,7 @@ uint8_t subghz_scene_receiver_config_detect_raw_value_index(
118121 }
119122 return index ;
120123}
124+ #endif
121125
122126uint8_t subghz_scene_receiver_config_rssi_threshold_value_index (
123127 const int value ,
@@ -186,12 +190,18 @@ static void subghz_scene_receiver_config_set_detect_raw(VariableItem* item) {
186190 uint8_t index = variable_item_get_current_value_index (item );
187191
188192 variable_item_set_current_value_text (item , detect_raw_text [index ]);
193+ #ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING
194+ subghz -> last_settings -> detect_raw = index ;
195+
196+ subghz_last_settings_set_detect_raw_values (subghz );
197+ #else
189198 subghz_receiver_set_filter (subghz -> txrx -> receiver , detect_raw_value [index ]);
190199
191200 subghz_protocol_decoder_raw_set_auto_mode (
192201 subghz_receiver_search_decoder_base_by_name (
193202 subghz -> txrx -> receiver , SUBGHZ_PROTOCOL_RAW_NAME ),
194203 (index == 1 ));
204+ #endif
195205}
196206
197207static void subghz_scene_receiver_config_set_hopping_running (VariableItem * item ) {
@@ -244,10 +254,10 @@ void subghz_scene_receiver_config_on_enter(void* context) {
244254 VariableItem * item ;
245255 uint8_t value_index ;
246256
247- #if FURI_DEBUG
257+ #ifdef FURI_DEBUG
248258 FURI_LOG_D (
249259 TAG ,
250- "last frequency: %d, preset : %d" ,
260+ "Last frequency: %d, Preset : %d" ,
251261 subghz -> last_settings -> frequency ,
252262 subghz -> last_settings -> preset );
253263#endif
@@ -304,10 +314,14 @@ void subghz_scene_receiver_config_on_enter(void* context) {
304314 DETECT_RAW_COUNT ,
305315 subghz_scene_receiver_config_set_detect_raw ,
306316 subghz );
317+ #ifdef SUBGHZ_SAVE_DETECT_RAW_SETTING
318+ value_index = subghz -> last_settings -> detect_raw ;
319+ #else
307320 value_index = subghz_scene_receiver_config_detect_raw_value_index (
308321 subghz_receiver_get_filter (subghz -> txrx -> receiver ),
309322 detect_raw_value ,
310323 DETECT_RAW_COUNT );
324+ #endif
311325 variable_item_set_current_value_index (item , value_index );
312326 variable_item_set_current_value_text (item , detect_raw_text [value_index ]);
313327
0 commit comments