From 34f4fdbb2bca146447d1c4d1d63b2910463d3560 Mon Sep 17 00:00:00 2001 From: KonradIT Date: Tue, 26 Nov 2024 19:11:23 +0100 Subject: [PATCH 1/2] flag to disable web server --- src/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 76803a8..d139d7d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -220,6 +220,8 @@ uint64_t scan_start_time = 0; // #define LOG_DATA_JSON true int LOG_DATA_JSON_INTERVAL = 1000; // Log at least every second +#define WEB_SERVER true + uint64_t x, y, range_item, w = WATERFALL_START, i = 0; int osd_x = 1, osd_y = 2, col = 0, max_bin = 32; uint64_t ranges_count = 0; @@ -663,6 +665,7 @@ void setup(void) display.clear(); +#ifdef WEB_SERVER both.println("CLICK for WIFI settings."); for (int i = 0; i < 200; i++) @@ -695,6 +698,15 @@ void setup(void) readConfigFile(); +#endif + +#ifndef WEB_SERVER + RANGE_PER_PAGE = FREQ_END - REQ_BEGIN; + RANGE = (int)(CONF_FREQ_END - CONF_FREQ_BEGIN); + SINGLE_STEP = (float)(RANGE / (STEPS * SCAN_RBW_FACTOR)); + range = (int)(CONF_FREQ_END - CONF_FREQ_BEGIN); + iterations = RANGE / RANGE_PER_PAGE; +#endif init_radio(); #ifndef LILYGO From 623ce086f0a907609cc281063052b21153375c47 Mon Sep 17 00:00:00 2001 From: KonradIT Date: Tue, 26 Nov 2024 19:57:26 +0100 Subject: [PATCH 2/2] Fix --- src/main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d139d7d..e6953b6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -220,7 +220,7 @@ uint64_t scan_start_time = 0; // #define LOG_DATA_JSON true int LOG_DATA_JSON_INTERVAL = 1000; // Log at least every second -#define WEB_SERVER true +// #define WEB_SERVER true uint64_t x, y, range_item, w = WATERFALL_START, i = 0; int osd_x = 1, osd_y = 2, col = 0, max_bin = 32; @@ -701,11 +701,20 @@ void setup(void) #endif #ifndef WEB_SERVER - RANGE_PER_PAGE = FREQ_END - REQ_BEGIN; + CONF_SAMPLES = samples; + CONF_FREQ_BEGIN = FREQ_BEGIN; + CONF_FREQ_END = FREQ_END; + + both.println("FREQ BEGIN:" + String(CONF_FREQ_BEGIN)); + both.println("FREQ END:" + String(CONF_FREQ_END)); + both.println("SAMPLES:" + String(CONF_SAMPLES)); + + RANGE_PER_PAGE = CONF_FREQ_END - CONF_FREQ_BEGIN; // FREQ_END - CONF_FREQ_BEGIN RANGE = (int)(CONF_FREQ_END - CONF_FREQ_BEGIN); SINGLE_STEP = (float)(RANGE / (STEPS * SCAN_RBW_FACTOR)); range = (int)(CONF_FREQ_END - CONF_FREQ_BEGIN); iterations = RANGE / RANGE_PER_PAGE; + median_frequency = (CONF_FREQ_BEGIN + CONF_FREQ_END) / 2; #endif init_radio();