diff --git a/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.c b/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.c index 63243490e..260676a24 100644 --- a/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.c +++ b/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.c @@ -72,8 +72,6 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) { .frequency_coarse = 0, .rssi_coarse = 0, .frequency_fine = 0, .rssi_fine = 0}; float rssi = 0; uint32_t frequency = 0; - float rssi_temp = 0; - uint32_t frequency_temp = 0; CC1101Status status; //Start CC1101 @@ -197,9 +195,6 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) { TAG, "=:%u:%f", frequency_rssi.frequency_fine, (double)frequency_rssi.rssi_fine); instance->sample_hold_counter = 20; - rssi_temp = frequency_rssi.rssi_fine; - frequency_temp = frequency_rssi.frequency_fine; - if(instance->filVal) { frequency_rssi.frequency_fine = subghz_frequency_analyzer_worker_expRunningAverageAdaptive( @@ -208,10 +203,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) { // Deliver callback if(instance->pair_callback) { instance->pair_callback( - instance->context, - frequency_rssi.frequency_fine, - frequency_rssi.rssi_fine, - true); + instance->context, frequency_rssi.frequency_fine, frequency_rssi.rssi_fine); } } else if( // Deliver results coarse (frequency_rssi.rssi_coarse > instance->trigger_level) && @@ -223,8 +215,6 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) { (double)frequency_rssi.rssi_coarse); instance->sample_hold_counter = 20; - rssi_temp = frequency_rssi.rssi_coarse; - frequency_temp = frequency_rssi.frequency_coarse; if(instance->filVal) { frequency_rssi.frequency_coarse = subghz_frequency_analyzer_worker_expRunningAverageAdaptive( @@ -235,22 +225,14 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) { instance->pair_callback( instance->context, frequency_rssi.frequency_coarse, - frequency_rssi.rssi_coarse, - true); + frequency_rssi.rssi_coarse); } } else { if(instance->sample_hold_counter > 0) { instance->sample_hold_counter--; - if(instance->sample_hold_counter == 18) { - if(instance->pair_callback) { - instance->pair_callback( - instance->context, frequency_temp, rssi_temp, false); - } - } } else { instance->filVal = 0; - if(instance->pair_callback) - instance->pair_callback(instance->context, 0, 0, false); + if(instance->pair_callback) instance->pair_callback(instance->context, 0, 0); } } } diff --git a/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.h b/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.h index eba4409ce..3b93f60ad 100644 --- a/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.h +++ b/applications/main/subghz/helpers/subghz_frequency_analyzer_worker.h @@ -5,11 +5,8 @@ typedef struct SubGhzFrequencyAnalyzerWorker SubGhzFrequencyAnalyzerWorker; -typedef void (*SubGhzFrequencyAnalyzerWorkerPairCallback)( - void* context, - uint32_t frequency, - float rssi, - bool signal); +typedef void ( + *SubGhzFrequencyAnalyzerWorkerPairCallback)(void* context, uint32_t frequency, float rssi); typedef struct { uint32_t frequency_coarse; diff --git a/applications/main/subghz/views/subghz_frequency_analyzer.c b/applications/main/subghz/views/subghz_frequency_analyzer.c index f82e1159e..c0508576d 100644 --- a/applications/main/subghz/views/subghz_frequency_analyzer.c +++ b/applications/main/subghz/views/subghz_frequency_analyzer.c @@ -151,31 +151,6 @@ void subghz_frequency_analyzer_draw_rssi( canvas_draw_line(canvas, x, y + 3, x + (RSSI_MAX - RSSI_MIN) * 2 / RSSI_SCALE, y + 3); } -static void subghz_frequency_analyzer_history_frequency_draw( - Canvas* canvas, - SubGhzFrequencyAnalyzerModel* model) { - char buffer[64]; - uint8_t x = 66; - uint8_t y = 43; - - canvas_set_font(canvas, FontKeyboard); - for(uint8_t i = 0; i < 3; i++) { - if(model->history_frequency[i]) { - snprintf( - buffer, - sizeof(buffer), - "%03ld.%03ld", - model->history_frequency[i] / 1000000 % 1000, - model->history_frequency[i] / 1000 % 1000); - canvas_draw_str(canvas, x, y + i * 10, buffer); - } else { - canvas_draw_str(canvas, x, y + i * 10, "---.---"); - } - canvas_draw_str(canvas, x + 44, y + i * 10, "MHz"); - } - canvas_set_font(canvas, FontSecondary); -} - void subghz_frequency_analyzer_draw(Canvas* canvas, SubGhzFrequencyAnalyzerModel* model) { char buffer[64];