]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Made PURESIGNAL working
authorc vw <dl1ycf@darc.de>
Wed, 15 Aug 2018 15:11:43 +0000 (17:11 +0200)
committerc vw <dl1ycf@darc.de>
Wed, 15 Aug 2018 15:11:43 +0000 (17:11 +0200)
Makefile.mac
old_protocol.c
ps_menu.c
radio.c
receiver.c
transmitter.c

index 777ed97c77700970fd77481b986d6c73535b1c69..f6142e04b228206e724ae3354bc679587b9a4138 100644 (file)
@@ -19,7 +19,7 @@ GIT_VERSION := $(shell git describe --abbrev=0 --tags)
 #FREEDV_INCLUDE=FREEDV
 
 # uncomment the line below to include Pure Signal support
-#PURESIGNAL_INCLUDE=PURESIGNAL
+PURESIGNAL_INCLUDE=PURESIGNAL
 
 # uncomment the line to below include support for sx1509 i2c expander
 #SX1509_INCLUDE=sx1509
index 1200210a04aad6380aa7fc074f94940ba760313f..80427a3591bccb9b596427086b7c60a0b4c96ce2 100644 (file)
@@ -614,7 +614,7 @@ static void process_ozy_input_buffer(unsigned char  *buffer) {
               }
               break;
             case 3:
-              if(device==DEVICE_METIS)  {
+              if(device==DEVICE_HERMES)  {
                 left_sample_double_tx=left_sample_double;
                 right_sample_double_tx=right_sample_double;
                 add_ps_iq_samples(transmitter, left_sample_double_tx,right_sample_double_tx,left_sample_double_rx,right_sample_double_rx);
index 670fedc012477a68e49442e8ccadce40f4c32135..90a7a1cf0eb395665b0bff990826d8db34885efa 100644 (file)
--- a/ps_menu.c
+++ b/ps_menu.c
@@ -322,7 +322,7 @@ void ps_twotone(int state) {
     //set_button_text_color(widget,"black");
   }
   if(state && transmitter->puresignal) {
-    info_thread_id=g_thread_new( "PS info", info_thread, NULL);
+    //info_thread_id=g_thread_new( "PS info", info_thread, NULL);
   } else {
     running=0;
   }
diff --git a/radio.c b/radio.c
index f4cab047b1d2d86bfb04374afb44a7ad7912fca5..a6d8b5f6748588587837e2a54a834c6147914989 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -563,7 +563,6 @@ fprintf(stderr,"Create %d receivers: height=%d\n",receivers,rx_height);
 
 #ifdef PURESIGNAL
   tx_set_ps_sample_rate(transmitter,protocol==NEW_PROTOCOL?192000:active_receiver->sample_rate);
-  // DL1YCF: we must create these receivers in ANY case to avoid seg-faults.
   receiver[PS_TX_FEEDBACK]=create_pure_signal_receiver(PS_TX_FEEDBACK, buffer_size,protocol==ORIGINAL_PROTOCOL?active_receiver->sample_rate:192000,display_width);
   receiver[PS_RX_FEEDBACK]=create_pure_signal_receiver(PS_RX_FEEDBACK, buffer_size,protocol==ORIGINAL_PROTOCOL?active_receiver->sample_rate:192000,display_width);
 #endif
index 1317fe169fbbc8a5de6c6ba5cadcba10655eddee..c33a16a7ab0b209ab759a54724f0e0ddcae4c511 100644 (file)
@@ -743,7 +743,7 @@ fprintf(stderr,"create_pure_signal_receiver: id=%d buffer_size=%d\n",id,buffer_s
   rx->sample_rate=sample_rate;
   rx->buffer_size=buffer_size;
   rx->fft_size=fft_size;
-  rx->pixels=0;
+  rx->pixels=pixels;   // need this for the "MON" button
   rx->fps=0;
 
   rx->width=0;
index a419a379fde52411c94df1f8ba6d474164efd43d..4045f831b5b903b1a9917a7e583c4d39ca692d98 100644 (file)
@@ -308,10 +308,13 @@ static gboolean update_display(gpointer data) {
     }
 #endif
 #ifdef PURESIGNAL
+    // if "MON" button is active (tx->feedback is TRUE),
+    // then obtain spectrum pixels from PS_RX_FEEDBACK,
+    // that is, display the (attenuated) TX signal from the "antenna"
     if(tx->puresignal && tx->feedback) {
-      RECEIVER *tx_feedback=receiver[PS_TX_FEEDBACK];
-      GetPixels(tx_feedback->id,0,tx_feedback->pixel_samples,&rc);
-      memcpy(tx->pixel_samples,tx_feedback->pixel_samples,sizeof(float)*tx->pixels);
+      RECEIVER *rx_feedback=receiver[PS_RX_FEEDBACK];
+      GetPixels(rx_feedback->id,0,rx_feedback->pixel_samples,&rc);
+      memcpy(tx->pixel_samples,rx_feedback->pixel_samples,sizeof(float)*tx->pixels);
     } else {
 #endif
       GetPixels(tx->id,0,tx->pixel_samples,&rc);
@@ -992,9 +995,7 @@ void add_ps_iq_samples(TRANSMITTER *tx, double i_sample_tx,double q_sample_tx, d
       pscc(transmitter->id, rx_feedback->buffer_size, tx_feedback->iq_input_buffer, rx_feedback->iq_input_buffer);
       if(transmitter->displaying) {
         if(transmitter->feedback) {
-          Spectrum0(1, tx_feedback->id, 0, 0, tx_feedback->iq_input_buffer);
-        //} else {
-        //  Spectrum0(1, rx_feedback->id, 0, 0, rx_feedback->iq_input_buffer);
+          Spectrum0(1, rx_feedback->id, 0, 0, rx_feedback->iq_input_buffer);
         }
       }
     }