]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Apply "iqswap" to the tx iq samples as well
authorc vw <dl1ycf@darc.de>
Mon, 15 Nov 2021 12:49:18 +0000 (13:49 +0100)
committerc vw <dl1ycf@darc.de>
Mon, 15 Nov 2021 12:49:18 +0000 (13:49 +0100)
soapy_protocol.c

index 1c111ef2c627eb6214d6cda46aa16650b8bd8aa9..77977843512ea7a11a5eaefb567e59e6e66a0233 100644 (file)
@@ -408,8 +408,16 @@ void soapy_protocol_iq_samples(float isample,float qsample) {
   long long timeNs=0;
   long timeoutUs=100000L;
   if(isTransmitting()) {
-    output_buffer[(output_buffer_index*2)]=isample;
-    output_buffer[(output_buffer_index*2)+1]=qsample;
+    if (iqswap) {
+      //
+      // Here I assume that iqswap also applies to the TX samples
+      //
+      output_buffer[(output_buffer_index*2)]=qsample;
+      output_buffer[(output_buffer_index*2)+1]=isample;
+    } else {
+      output_buffer[(output_buffer_index*2)]=isample;
+      output_buffer[(output_buffer_index*2)+1]=qsample;
+    }
     output_buffer_index++;
     if(output_buffer_index>=max_tx_samples) {
       int elements=SoapySDRDevice_writeStream(soapy_device,tx_stream,tx_buffs,max_tx_samples,&flags,timeNs,timeoutUs);