]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
streamlining
authorc vw <dl1ycf@darc.de>
Mon, 3 Jun 2019 16:15:06 +0000 (18:15 +0200)
committerc vw <dl1ycf@darc.de>
Mon, 3 Jun 2019 16:15:06 +0000 (18:15 +0200)
ext.h
old_protocol.c
radio.c
vfo.c

diff --git a/ext.h b/ext.h
index c3c9710b4c9cec0b4d91a240deef44ae081ce09c..5ed6b0626429bff51077760faec2015e7ba87816 100644 (file)
--- a/ext.h
+++ b/ext.h
@@ -28,7 +28,6 @@ extern int ext_vfo_update(void *data);
 extern int ext_set_frequency(void *data);
 extern int ext_vfo_filter_changed(void *data);
 extern int ext_band_update(void *data);
-extern int ext_ptt_update(void *data);
 extern int ext_mox_update(void *data);
 extern int ext_tune_update(void *data);
 extern int ext_linein_changed(void *data);
index 579a878dcbbdaf5963960f3256d06fee827cc85d..b830416a38ba3f1e6c8e9545abaad00d11afc341 100644 (file)
@@ -562,20 +562,20 @@ static void process_ozy_input_buffer(unsigned char  *buffer) {
 
   int tx_vfo=split?VFO_B:VFO_A;
 
-  int nreceivers;
+  int num_hpsdr_receivers;
 
 #ifdef PURESIGNAL
     // for PureSignal, the number of receivers needed is hard-coded below.
     // we need at least 3 (for RX), and up to 5 for Orion2 boards, since
     // the TX DAC channel is hard-wired to RX5.
-    nreceivers=3;
-    if (device == DEVICE_HERMES) nreceivers=4;
-    if (device == DEVICE_ANGELIA || device == DEVICE_ORION || device == DEVICE_ORION2) nreceivers=5;
+    num_hpsdr_receivers=3;
+    if (device == DEVICE_HERMES) num_hpsdr_receivers=4;
+    if (device == DEVICE_ANGELIA || device == DEVICE_ORION || device == DEVICE_ORION2) num_hpsdr_receivers=5;
 #else
 #if defined(RADIOBERRY) || defined(PI_SDR)
-       nreceivers = receivers;
+       num_hpsdr_receivers = receivers;
 #else
-       nreceivers=RECEIVERS;
+       num_hpsdr_receivers=RECEIVERS;
 #endif
 #endif
 
@@ -639,10 +639,10 @@ static void process_ozy_input_buffer(unsigned char  *buffer) {
         break;
     }
 
-    int iq_samples=(512-8)/((nreceivers*6)+2);
+    int iq_samples=(512-8)/((num_hpsdr_receivers*6)+2);
 
     for(i=0;i<iq_samples;i++) {
-      for(r=0;r<nreceivers;r++) {
+      for(r=0;r<num_hpsdr_receivers;r++) {
         left_sample   = (int)((signed char) buffer[b++])<<16;
         left_sample  |= (int)((((unsigned char)buffer[b++])<<8)&0xFF00);
         left_sample  |= (int)((unsigned char)buffer[b++]&0xFF);
@@ -845,20 +845,20 @@ void ozy_send_buffer() {
   int mode;
   int i;
   BAND *band;
-  int nreceivers;
+  int num_hpsdr_receivers;
 
 #ifdef PURESIGNAL
     // for PureSignal, the number of receivers needed is hard-coded below.
     // we need at least 3 (for RX), and up to 5 for Orion2 boards, since
     // the TX DAC channel is hard-wired to RX5.
-    nreceivers=3;
-    if (device == DEVICE_HERMES) nreceivers=4;
-    if (device == DEVICE_ANGELIA || device == DEVICE_ORION || device == DEVICE_ORION2) nreceivers=5;
+    num_hpsdr_receivers=3;
+    if (device == DEVICE_HERMES) num_hpsdr_receivers=4;
+    if (device == DEVICE_ANGELIA || device == DEVICE_ORION || device == DEVICE_ORION2) num_hpsdr_receivers=5;
 #else
 #if defined(RADIOBERRY) || defined(PI_SDR)
-       nreceivers = receivers;
+       num_hpsdr_receivers = receivers;
 #else
-       nreceivers=RECEIVERS;
+       num_hpsdr_receivers=RECEIVERS;
 #endif
 #endif
 
@@ -949,6 +949,9 @@ void ozy_send_buffer() {
       output_buffer[C3]|=LT2208_GAIN_ON;
     }
 
+    //
+    // Set ALEX RX1_ANT and RX1_OUT
+    //
     i=receiver[0]->alex_antenna;
 #ifdef PURESIGNAL
     //
@@ -966,6 +969,9 @@ void ozy_send_buffer() {
       case 4:  // Alex: RX1 IN, ANAN: EXT2, ANAN7000: RX BYPASS
         output_buffer[C3]|=0xA0;
         break;
+      case 5:  // XVTR
+        output_buffer[C3]|=0xE0;
+        break;
       default:
        // RX1_OUT and RX1_ANT bits remain zero
         break;
@@ -975,8 +981,9 @@ void ozy_send_buffer() {
     output_buffer[C4]=0x04;  // duplex
 
     // 0 ... 7 maps on 1 ... 8 receivers
-    output_buffer[C4]|=(nreceivers-1)<<3;
+    output_buffer[C4]|=(num_hpsdr_receivers-1)<<3;
     
+    // Set ALEX TX_RELAX (that is, TX_ANT)
     if(isTransmitting()) {
       switch(transmitter->alex_antenna) {
         case 0:  // ANT 1
@@ -1046,7 +1053,7 @@ void ozy_send_buffer() {
         output_buffer[C4]=txFrequency;
         break;
       case 2: // rx frequency
-        if(current_rx<nreceivers) {
+        if(current_rx<num_hpsdr_receivers) {
           output_buffer[C0]=0x04+(current_rx*2);
 #ifdef PURESIGNAL
           int v=receiver[current_rx/2]->id;
@@ -1093,7 +1100,7 @@ void ozy_send_buffer() {
 #endif
           current_rx++;
         }
-        if(current_rx>=nreceivers) {
+        if(current_rx>=num_hpsdr_receivers) {
           current_rx=0;
         }
         break;
@@ -1288,7 +1295,7 @@ void ozy_send_buffer() {
         }
 #ifdef PURESIGNAL
         if(transmitter->puresignal) {
-          output_buffer[C2]|=0x40;        // Synchronize RX5 andh TX frequency on transmit
+          output_buffer[C2]|=0x40;        // Synchronize RX5 and TX frequency on transmit
         }
 #endif
         output_buffer[C3]=0x00;            // Alex2 filters
diff --git a/radio.c b/radio.c
index 82c6fbf9f1e05c6659ccabc4b383c6901dfd7ab9..d232a27182ba441f0da10142724f404f7cccff5d 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -849,14 +849,15 @@ static void rxtx(int state) {
 
 void setMox(int state) {
   vox_cancel();  // remove time-out
-  if (vox) {     // if VOX active, turn it off
-    rxtx(0);
-    vox=0;
-  }
   if(mox!=state) {
-    rxtx(state);
+    if (state && vox) {
+      // Suppress RX-TX transition if VOX was active
+    } else {
+      rxtx(state);
+    }
     mox=state;
   }
+  vox=0;
 }
 
 int getMox() {
diff --git a/vfo.c b/vfo.c
index dba5f8ed2793c327207cfdd83b4e5c8cbddf1551..2e907ce58466f61c8475f0a82e2c80706792c91b 100644 (file)
--- a/vfo.c
+++ b/vfo.c
@@ -743,7 +743,8 @@ void vfo_update() {
         cairo_show_text(cr, temp_text);
 
        // NB and NB2 are mutually exclusive, therefore
-       // they are put to the same place
+       // they are put to the same place in order to save
+       // some space
         cairo_move_to(cr, 150, 50);
         if(active_receiver->nb) {
           cairo_set_source_rgb(cr, 1.0, 1.0, 0.0);