From d5df4027d771dc654339e9d7a0c6c3c256165572 Mon Sep 17 00:00:00 2001 From: Skorpionm <85568270+Skorpionm@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:39:12 +0400 Subject: [PATCH] SubGhz: fix resetting the set frequency when retuning (#1300) --- applications/subghz/scenes/subghz_scene_receiver_config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/subghz/scenes/subghz_scene_receiver_config.c b/applications/subghz/scenes/subghz_scene_receiver_config.c index 7c2d031f0..8789a2434 100644 --- a/applications/subghz/scenes/subghz_scene_receiver_config.c +++ b/applications/subghz/scenes/subghz_scene_receiver_config.c @@ -43,14 +43,14 @@ uint8_t subghz_scene_receiver_config_uint32_value_index( uint8_t subghz_scene_receiver_config_next_frequency(const uint32_t value, void* context) { furi_assert(context); SubGhz* subghz = context; - int64_t last_value = INT64_MIN; uint8_t index = 0; for(uint8_t i = 0; i < subghz_setting_get_frequency_count(subghz->setting); i++) { - if((value >= last_value) && (value <= subghz_setting_get_frequency(subghz->setting, i))) { + if(value == subghz_setting_get_frequency(subghz->setting, i)) { index = i; break; + } else { + index = subghz_setting_get_frequency_default_index(subghz->setting); } - last_value = subghz_setting_get_frequency(subghz->setting, i); } return index; }