From: c vw Date: Wed, 15 Aug 2018 15:11:43 +0000 (+0200) Subject: Made PURESIGNAL working X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/status?a=commitdiff_plain;h=a310da8ac749a1f36662f2bdd43e7de9edfbfaa0;p=pihpsdr.git Made PURESIGNAL working --- diff --git a/Makefile.mac b/Makefile.mac index 777ed97..f6142e0 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -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 diff --git a/old_protocol.c b/old_protocol.c index 1200210..80427a3 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -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); diff --git a/ps_menu.c b/ps_menu.c index 670fedc..90a7a1c 100644 --- 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 f4cab04..a6d8b5f 100644 --- 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 diff --git a/receiver.c b/receiver.c index 1317fe1..c33a16a 100644 --- a/receiver.c +++ b/receiver.c @@ -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; diff --git a/transmitter.c b/transmitter.c index a419a37..4045f83 100644 --- a/transmitter.c +++ b/transmitter.c @@ -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); } } }