aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2021-11-07 16:33:30 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2021-11-07 20:00:43 +0100
commit86d4523cc78e24e82c145aa79a125cc52b86cfcc (patch)
treead3681ca9b9e32373ed241ecaa805f6d53ed6702 /src
parent7fa5f857315211ede516f9a7c0160404a52b2dfd (diff)
Correctly show channel frequencies in spectrum view when swapping SDR linksHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/libmobile/sender.c5
-rw-r--r--src/libsdr/sdr.c17
2 files changed, 13 insertions, 9 deletions
diff --git a/src/libmobile/sender.c b/src/libmobile/sender.c
index 9ec8797..beb1f42 100644
--- a/src/libmobile/sender.c
+++ b/src/libmobile/sender.c
@@ -28,6 +28,9 @@
#include "../libdebug/debug.h"
#include "sender.h"
#include "../libtimer/timer.h"
+#ifdef HAVE_SDR
+#include "../libsdr/sdr_config.h"
+#endif
/* debug time consumption of audio processing */
//#define DEBUG_TIME_CONSUMPTION
@@ -237,7 +240,7 @@ int sender_open_audio(int buffer_size, double interval)
/* in case of initialized spectrum display (SDR), we add all channels.
* if spectrum display was not initialized (sound card), function call is ignored */
for (inst = sender_head; inst; inst = inst->next)
- display_spectrum_add_mark(inst->kanal, inst->empfangsfrequenz);
+ display_spectrum_add_mark(inst->kanal, (sdr_config->swap_links) ? inst->sendefrequenz : inst->empfangsfrequenz);
#endif
return 0;
diff --git a/src/libsdr/sdr.c b/src/libsdr/sdr.c
index 17ffa12..5ef8ffb 100644
--- a/src/libsdr/sdr.c
+++ b/src/libsdr/sdr.c
@@ -267,6 +267,15 @@ void *sdr_open(const char __attribute__((__unused__)) *device, double *tx_freque
goto error;
}
+ /* swap links, if required */
+ if (sdr_config->swap_links) {
+ double *temp;
+ PDEBUG(DSDR, DEBUG_NOTICE, "Sapping RX and TX frequencies!\n");
+ temp = rx_frequency;
+ rx_frequency = tx_frequency;
+ tx_frequency = temp;
+ }
+
if (tx_frequency) {
/* calculate required bandwidth (IQ rate) */
@@ -458,14 +467,6 @@ void *sdr_open(const char __attribute__((__unused__)) *device, double *tx_freque
}
}
- if (sdr_config->swap_links) {
- double temp;
- PDEBUG(DSDR, DEBUG_NOTICE, "Sapping RX and TX frequencies!\n");
- temp = rx_center_frequency;
- rx_center_frequency = tx_center_frequency;
- tx_center_frequency = temp;
- }
-
display_iq_init(samplerate);
display_spectrum_init(samplerate, rx_center_frequency);