]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Small Corrections
authorc vw <dl1ycf@darc.de>
Wed, 17 Jul 2019 14:33:33 +0000 (16:33 +0200)
committerc vw <dl1ycf@darc.de>
Wed, 17 Jul 2019 14:33:33 +0000 (16:33 +0200)
iambic.c
new_discovery.c
old_discovery.c
old_protocol.c
property.c

index 3609ee36c9e11fbe42bc7f84a4e99029c3c30f25..dae4e29aa1879f60b00467f928d7a4701f693a4d 100644 (file)
--- a/iambic.c
+++ b/iambic.c
@@ -702,7 +702,8 @@ int keyer_init() {
 
     running = 1;
 #ifdef __APPLE__
-    cw_event=sem_open("CW", O_CREAT, 0700, 0);
+    sem_unlink("CW");
+    cw_event=sem_open("CW", O_CREAT | O_EXCL), 0700, 0);
     rc = (cw_event == SEM_FAILED);
 #else
     rc = sem_init(&cw_event, 0, 0);
index 3fed57e589d7ca6b728bbb5a9c2f17c0e995c9da..67b95ce542a29d176d98b9b378bcc6b9c13f0372 100644 (file)
@@ -171,7 +171,7 @@ void new_discover(struct ifaddrs* iface) {
 
     if(sendto(discovery_socket,buffer,60,0,(struct sockaddr*)&to_addr,sizeof(to_addr))<0) {
         perror("new_discover: sendto socket failed for discovery_socket\n");
-        exit(-1);
+        return;
     }
 
     // wait for receive thread to complete
index c5a71592d724380e7ed36d0ac0b3e7175d1efe31..8517d842ffc41b39f699ad2e1d81ee0c27d39ded 100644 (file)
@@ -162,7 +162,7 @@ static void discover(struct ifaddrs* iface) {
         interface_addr.sin_port = htons(0); // system assigned port
         if(bind(discovery_socket,(struct sockaddr*)&interface_addr,sizeof(interface_addr))<0) {
             perror("discover: bind socket failed for discovery_socket:");
-            exit(-1);
+            return;
         }
 
         fprintf(stderr,"discover: bound to %s\n",interface_name);
@@ -208,7 +208,7 @@ static void discover(struct ifaddrs* iface) {
 
     if(sendto(discovery_socket,buffer,len,0,(struct sockaddr*)&to_addr,sizeof(to_addr))<0) {
         perror("discover: sendto socket failed for discovery_socket:");
-        exit(-1);
+        return;
     }
 
     // wait for receive thread to complete
index b830416a38ba3f1e6c8e9545abaad00d11afc341..01c300d555f05638a1b6dabe6a0b9f58b4e2b865 100644 (file)
@@ -960,7 +960,7 @@ void ozy_send_buffer() {
     // the feedback signal is routed automatically/internally
     // If feedback is to the second ADC, leave RX1 ANT settings untouched
     //
-    if (isTransmitting() && transmitter->puresignal && receiver[PS_RX_FEEDBACK]->adc == 0) i=receiver[PS_RX_FEEDBACK]->alex_antenna;
+    if (isTransmitting() && transmitter->puresignal) i=receiver[PS_RX_FEEDBACK]->alex_antenna;
 #endif
     switch(i) {
       case 3:  // Alex: RX2 IN, ANAN: EXT1, ANAN7000: still uses internal feedback 
@@ -1224,10 +1224,8 @@ void ozy_send_buffer() {
             output_buffer[C1]|=receiver[0]->adc;                       // RX1 bound to ADC of first receiver
             output_buffer[C1]|=(receiver[1]->adc<<2);                  // RX2 actually unsused with PURESIGNAL
             output_buffer[C1]|=receiver[1]->adc<<4;                    // RX3 bound to ADC of second receiver
-            output_buffer[C1]|=(receiver[PS_RX_FEEDBACK]->adc<<6);     // RX4 is PS_RX_Feedbacka
-                                                                       // Usually ADC0, but if feedback is to
-                                                                       // RX2 input it must be ADC1 (see ps_menu.c)
-           // RX5 is hard-wired to the TX DAC and needs no ADC setting.
+                                                                       // RX4 is PS_RX_Feedback and bound to ADC0
+                                                                       // RX5 is hard-wired to the TX DAC and needs no ADC setting.
        }
 #else
         output_buffer[C1]|=receiver[0]->adc;
@@ -1277,16 +1275,6 @@ void ozy_send_buffer() {
         output_buffer[C1]=0x00;
 
         if(isTransmitting()) {
-#ifdef PURESIGNAL
-         // If we are using the RX2 jack for PURESIGNAL RX feedback, then we MUST NOT ground
-         // the ADC2 input upon TX.
-         if (transmitter->puresignal && receiver[PS_RX_FEEDBACK]->adc == 1) {
-           // Note that this statement seems to have no effect since
-           // one cannot goto to "manual filter setting" for the ALEX2 board individually
-            output_buffer[C1]|=0x40; // Set ADC2 filter board to "ByPass"
-         } else
-#endif
-
             output_buffer[C1]|=0x80; // ground RX2 on transmit, bit0-6 are Alex2 filters
         }
         output_buffer[C2]=0x00;
index 67abcbe77b62a3efd8ab8b06b25e888e59faf7a7..08f74af65b678b26c1a3793d085fd5e7cb535736 100644 (file)
@@ -47,16 +47,19 @@ void loadProperties(char* filename) {
             if(string[0]!='#') {
                 name=strtok(string,"=");
                 value=strtok(NULL,"\n");
-                property=malloc(sizeof(PROPERTY));
-                property->name=malloc(strlen(name)+1);
-                strcpy(property->name,name);
-                property->value=malloc(strlen(value)+1);
-                strcpy(property->value,value);
-                property->next_property=properties;
-                properties=property;
-                if(strcmp(name,"property_version")==0) {
-                  version=atof(value);
-                }
+               // Beware of "illegal" lines in corrupted files
+               if (name != NULL && value != NULL) {
+                  property=malloc(sizeof(PROPERTY));
+                  property->name=malloc(strlen(name)+1);
+                  strcpy(property->name,name);
+                  property->value=malloc(strlen(value)+1);
+                  strcpy(property->value,value);
+                  property->next_property=properties;
+                  properties=property;
+                  if(strcmp(name,"property_version")==0) {
+                    version=atof(value);
+                  }
+               }
             }
         }
         fclose(f);