]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Fixed SOAPYSDR references when not defined
authorJohn Melton G0ORX <john.d.melton@googlemail.com>
Wed, 16 Oct 2019 17:24:04 +0000 (18:24 +0100)
committerJohn Melton G0ORX <john.d.melton@googlemail.com>
Wed, 16 Oct 2019 17:24:04 +0000 (18:24 +0100)
Makefile
audio.c
discovered.h
radio.c
receiver.c
rx_panadapter.c
soapy_discovery.c
vfo.c

index 9884a922d8555593f228e7e18acc6b8423807b92..f7f7a3992ebac60dfd6f0650bb965a0bdeeb6ebb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ PURESIGNAL_INCLUDE=PURESIGNAL
 #PI_SDR_INCLUDE=PI_SDR
 
 # uncomment the line below to include MIDI support
-#MIDI_INCLUDE=MIDI
+MIDI_INCLUDE=MIDI
 
 #uncomment the line below for the platform being compiled on (actually not used)
 UNAME_N=raspberrypi
@@ -109,7 +109,7 @@ RADIOBERRY_OPTIONS=-D RADIOBERRY
 endif
 
 # uncomment the line below for SoapySDR
-SOAPYSDR_INCLUDE=SOAPYSDR
+#SOAPYSDR_INCLUDE=SOAPYSDR
 
 ifeq ($(SOAPYSDR_INCLUDE),SOAPYSDR)
 SOAPYSDR_OPTIONS=-D SOAPYSDR
diff --git a/audio.c b/audio.c
index 2028e32683061cd665a744ec3a29f18b76596cc3..c54facbeea8d0b02665b3737b8f13d92e1de4306 100644 (file)
--- a/audio.c
+++ b/audio.c
@@ -200,9 +200,11 @@ fprintf(stderr,"audio_open_input: %d\n",transmitter->input_device);
     case NEW_PROTOCOL:
       mic_buffer_size = 64;
       break;
+#ifdef SOAPYSDR
     case SOAPYSDR_PROTOCOL:
       mic_buffer_size = 720;
       break;
+#endif
     default:
       break;
   }
index fcff6835ee1fd239b33232a114b978f48c473bc4..617164da761e11602b26f9330cc2f032f66a4bf7 100644 (file)
@@ -109,6 +109,8 @@ struct _DISCOVERED {
 #ifdef SOAPYSDR
       struct soapy {
         char version[128];
+        char hardware_key[64];
+        char driver_key[64];
         int rtlsdr_count;
         int sample_rate;
         size_t rx_channels;
diff --git a/radio.c b/radio.c
index 43fd88a9c48cd9bc4a6b246d1d1085a96b50f001..8e0ad6ff1f93a54ab0f91d24f7c37ab880698021 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -387,11 +387,11 @@ void start_radio() {
 #ifdef SOAPYSDR
     case SOAPYSDR_PROTOCOL:
       can_transmit=(radio->info.soapy.tx_channels!=0);
+      g_print("start_radio: can_transmit=%d tx_channels=%d\n",can_transmit,radio->info.soapy.tx_channels);
       break;
 #endif
   }
 
-  g_print("start_radio: can_transmit=%d tx_channels=%d\n",can_transmit,radio->info.soapy.tx_channels);
 
 #ifdef MIDI
   MIDIstartup();
index 524ff1140db447df0b2f71c004921be153aadcfb..411e38564d69b09b0d606422aa634bca51458cac 100644 (file)
@@ -1011,7 +1011,11 @@ fprintf(stderr,"create_receiver: id=%d default adc=%d\n",rx->id, rx->adc);
 
   receiver_restore_state(rx);
 
+#ifdef SOAPYSDR
   rx->resample_step=radio->info.soapy.sample_rate/rx->sample_rate;
+#else
+  rx->resample_step=1;
+#endif
 
 fprintf(stderr,"create_receiver (after restore): rx=%p id=%d local_audio=%d\n",rx,rx->id,rx->local_audio);
   int scale=rx->sample_rate/48000;
index ad363114d6307fe70b3299bccb8abaaef849a23a..58c942b0663fc9d250e25f664e1eb7c717b8d07b 100644 (file)
@@ -223,7 +223,7 @@ void rx_panadapter_update(RECEIVER *rx) {
 
 
   // filter
-  cairo_set_source_rgba (cr, 0.75, 0.75, 0.00, 0.75);
+  cairo_set_source_rgba (cr, 0.50, 0.50, 0.50, 0.75);
   filter_left =-cwshift+(double)display_width/2.0+(((double)rx->filter_low+vfo[rx->id].offset)/rx->hz_per_pixel);
   filter_right=-cwshift+(double)display_width/2.0+(((double)rx->filter_high+vfo[rx->id].offset)/rx->hz_per_pixel);
   cairo_rectangle(cr, filter_left, 0.0, filter_right-filter_left, (double)display_height);
index 7c46202c2ed5d3f83842f7a7b6ecfd02d292c115..4280a7ed6b1d3f01c4f30f609de6bd0e52fc5c5e 100644 (file)
@@ -196,6 +196,8 @@ static void get_info(char *driver) {
     discovered[devices].software_version=software_version;
     discovered[devices].frequency_min=ranges[0].minimum;
     discovered[devices].frequency_max=ranges[0].maximum;
+    strcpy(discovered[devices].info.soapy.driver_key,driverkey);
+    strcpy(discovered[devices].info.soapy.hardware_key,hardwarekey);
     discovered[devices].info.soapy.sample_rate=sample_rate;
     if(strcmp(driver,"rtlsdr")==0) {
       discovered[devices].info.soapy.rtlsdr_count=rtlsdr_val;
diff --git a/vfo.c b/vfo.c
index 38555daa23b75b2ce2722ac0e06bddf25d554ef8..006c4e4d23e65796571d918ba51c0cf556b5676f 100644 (file)
--- a/vfo.c
+++ b/vfo.c
@@ -200,11 +200,12 @@ void vfo_restore_state() {
 
     vfo[i].band=band20;
     vfo[i].bandstack=0;
+    vfo[i].frequency=14010000;
+#ifdef SOAPYSDR
     if(radio->protocol==SOAPYSDR_PROTOCOL) {
       vfo[i].frequency=144010000;
-    } else {
-      vfo[i].frequency=14010000;
     }
+#endif
     vfo[i].mode=modeCWU;
     vfo[i].filter=6;
     vfo[i].lo=0;