From dd2e23f9018acc382bec6bf98c58edf2fe25016c Mon Sep 17 00:00:00 2001 From: GullCode Date: Tue, 11 Oct 2022 12:40:08 +0200 Subject: [PATCH 1/3] Updated FREQMAN_MAX_PER_FILE value --- firmware/application/freqman.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/application/freqman.hpp b/firmware/application/freqman.hpp index 8e9b2069a..57906cde7 100644 --- a/firmware/application/freqman.hpp +++ b/firmware/application/freqman.hpp @@ -32,8 +32,8 @@ #include "ui_widget.hpp" #define FREQMAN_DESC_MAX_LEN 30 -#define FREQMAN_MAX_PER_FILE 99 -#define FREQMAN_MAX_PER_FILE_STR "99" +#define FREQMAN_MAX_PER_FILE 500 /* MAX PER FILES */ +#define FREQMAN_MAX_PER_FILE_STR "500" /*STRING OF FREQMAN_MAX_PER_FILE */ using namespace ui; using namespace std; From 480f4927401ed5a79534296f46e5ae72ca6f6a9d Mon Sep 17 00:00:00 2001 From: GullCode Date: Tue, 11 Oct 2022 12:40:31 +0200 Subject: [PATCH 2/3] Removed MAX_DB_ENTRY definition --- firmware/application/apps/ui_scanner.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/firmware/application/apps/ui_scanner.hpp b/firmware/application/apps/ui_scanner.hpp index caa571f9c..888d565b9 100644 --- a/firmware/application/apps/ui_scanner.hpp +++ b/firmware/application/apps/ui_scanner.hpp @@ -34,7 +34,6 @@ #include "file.hpp" -#define MAX_DB_ENTRY 500 #define MAX_FREQ_LOCK 10 //50ms cycles scanner locks into freq when signal detected, to verify signal is not spureous namespace ui { From ae8633c5693a8ccef702bd8dd693ec668e07c3f8 Mon Sep 17 00:00:00 2001 From: GullCode Date: Tue, 11 Oct 2022 12:40:49 +0200 Subject: [PATCH 3/3] Use FREQMAN_MAX_PER_FILE instead of MAX_DB_ENTRY --- firmware/application/apps/ui_scanner.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/firmware/application/apps/ui_scanner.cpp b/firmware/application/apps/ui_scanner.cpp index 29cdb10db..b29b7234c 100644 --- a/firmware/application/apps/ui_scanner.cpp +++ b/firmware/application/apps/ui_scanner.cpp @@ -160,9 +160,9 @@ ScannerView::~ScannerView() { } void ScannerView::show_max() { //show total number of freqs to scan - if (frequency_list.size() == MAX_DB_ENTRY) { + if (frequency_list.size() == FREQMAN_MAX_PER_FILE ) { text_max.set_style(&style_red); - text_max.set( "/ " + to_string_dec_uint(MAX_DB_ENTRY) + " (DB MAX!)"); + text_max.set( "/ " + to_string_dec_uint(FREQMAN_MAX_PER_FILE ) + " (DB MAX!)"); } else { text_max.set_style(&style_grey); @@ -304,7 +304,7 @@ ScannerView::ScannerView( ); rf::Frequency frequency = frequency_range.min; - while (frequency_list.size() < MAX_DB_ENTRY && frequency <= frequency_range.max) { //add manual range + while (frequency_list.size() < FREQMAN_MAX_PER_FILE && frequency <= frequency_range.max) { //add manual range frequency_list.push_back(frequency); description_list.push_back(""); //If empty, will keep showing the last description frequency+=def_step; @@ -398,7 +398,7 @@ void ScannerView::frequency_file_load(std::string file_name, bool stop_all_befor if ( load_freqman_file(file_name, database) ) { loaded_file_name = file_name; // keep loaded filename in memory for(auto& entry : database) { // READ LINE PER LINE - if (frequency_list.size() < MAX_DB_ENTRY) { //We got space! + if (frequency_list.size() < FREQMAN_MAX_PER_FILE ) { //We got space! if (entry.type == RANGE) { //RANGE switch (entry.step) { case AM_US: def_step = 10000; break ; @@ -421,7 +421,7 @@ void ScannerView::frequency_file_load(std::string file_name, bool stop_all_befor + ">" + to_string_short_freq(entry.frequency_b) + " S" + to_string_short_freq(def_step).erase(0,1) //euquiq: lame kludge to reduce spacing in step freq ); - while (frequency_list.size() < MAX_DB_ENTRY && entry.frequency_a <= entry.frequency_b) { //add the rest of the range + while (frequency_list.size() < FREQMAN_MAX_PER_FILE && entry.frequency_a <= entry.frequency_b) { //add the rest of the range entry.frequency_a+=def_step; frequency_list.push_back(entry.frequency_a); description_list.push_back(""); //Token (keep showing the last description)