]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
oops #2
authorc vw <chwu@vpn-ipv4-0464.triple-a.uni-kl.de>
Sat, 27 Jul 2019 09:36:28 +0000 (11:36 +0200)
committerc vw <chwu@vpn-ipv4-0464.triple-a.uni-kl.de>
Sat, 27 Jul 2019 09:36:28 +0000 (11:36 +0200)
old_protocol.c
transmitter.c

index 7e665823d5bb0af6183819d654c0648fb516a05c..443336df949fd445784fcb73334060b112755958 100644 (file)
@@ -543,7 +543,8 @@ static gpointer receive_thread(gpointer arg) {
 // These are FIXED numbers and depend on the device and whether the code
 // is compiled with or without PURESIGNAL
 // Furthermore, we provide a function that determines the frequency for
-// a given (HPSDR) receiver. This makes the code below much more transparent.
+// a given (HPSDR) receiver and for the transmitter.
+//
 //
 
 static int rx_feedback_receiver() {
@@ -572,7 +573,7 @@ static int rx_feedback_receiver() {
 
 static int tx_feedback_receiver() {
   //
-  // Depending on the device, return channel number of RX feedback receiver
+  // Depending on the device, return channel number of TX feedback receiver
   //
   int ret;
   switch (device) {
@@ -597,7 +598,7 @@ static int tx_feedback_receiver() {
 static int first_receiver() {
   //
   // Depending on the device and whether we compiled for PURESIGNAL,
-  // return the number of the first receiver
+  // return the channel number of the first receiver
   //
   return 0;
 }
@@ -605,7 +606,7 @@ static int first_receiver() {
 static int second_receiver() {
   //
   // Depending on the device and whether we compiled for PURESIGNAL,
-  // return the number of the second receiver
+  // return the channel number of the second receiver
   //
 #ifdef PURESIGNAL
   return 2;
@@ -625,7 +626,13 @@ static long long channel_freq(int chan) {
   //
   // This function returns the TX frequency if chan is
   // outside the allowed range, and thus can be used
-  // to determine the TX frequency.
+  // to set the TX frequency.
+  //
+  // If transmitting with PURESIGNAL, the frequency of
+  // the "antenna" feedback channel is set to the TX freq.
+  //
+  // This subroutine is the ONLY place here where the VFO
+  // frequencies are looked at.
   //
   int v;
   long long freq;
@@ -657,11 +664,15 @@ static long long channel_freq(int chan) {
       break;
 #endif
   }
+  //
+  // When transmitting with PURESIGNAL, set frequency of PS feedback channel to tx freq
+  //
+  if (isTransmitting() && transmitter->puresignal && chan == rx_feedback_receiver()) {
+    v = -1;
+  }
   if (v < 0) {
     //
-    // v=-1 indicates that there is no VFO associated,
-    // in this case we take the TX frequency. So we can use this
-    // function also to determine the TX frequency
+    // v=-1 indicates that we should use the TX frequency.
     //
     if(active_receiver->id==VFO_A) {
       if(split) {
index 68b70821449c7c6784a48a31f32c8d2511477dc6..d9ec70906fc53ca59b06b8f42c3652466913ad2b 100644 (file)
@@ -341,6 +341,7 @@ static gboolean update_display(gpointer data) {
     // If both spectra have the same number of pixels, this code
     // just copies all of them
     //
+#ifdef PURESIGNAL
     if(tx->puresignal && tx->feedback) {
       RECEIVER *rx_feedback=receiver[PS_RX_FEEDBACK];
       GetPixels(rx_feedback->id,0,rx_feedback->pixel_samples,&rc);
@@ -352,8 +353,11 @@ static gboolean update_display(gpointer data) {
       // if full == width, then we just copy all samples
       memcpy(tfp, rfp, width*sizeof(float));
     } else {
+#endif
       GetPixels(tx->id,0,tx->pixel_samples,&rc);
+#ifdef PURESIGNAL
     }
+#endif
     if(rc) {
       tx_panadapter_update(tx);
     }