]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
update
authorhadaq <hadaq>
Wed, 19 May 2010 15:55:05 +0000 (15:55 +0000)
committerhadaq <hadaq>
Wed, 19 May 2010 15:55:05 +0000 (15:55 +0000)
trbrich/pulser.c
trbrich/trb_i2c.c
trbrich/trbflash.c
trbrich/trbrichcmd.c

index 0792a4d0772b37ddda699b690adcfcffce1cafbd..b54fa1f50bcfaaf4c9c7b100597d43d01608f2d4 100644 (file)
@@ -11,7 +11,7 @@
 #include <trbnet.h>
 #include <trberror.h>
 
-static const char pulser_version[] = "$Revision: 1.8 $"; 
+static const char pulser_version[] = "$Revision: 1.9 $"; 
 
 /* 6MByte for 6 Sectors should be enough */
 #define BUFFER_SIZE (6 * 1024 * 1024 / 4)
@@ -107,11 +107,7 @@ int main(int argc, char ** argv)
   }
 
   /* open port */
-#ifndef TRB_RPC
   init_ports();
-#else
-  trb_connect(NULL);
-#endif  
 
   /* Open HLD-File */
   if (strncmp(hldFileName, "stdout", 256) != 0) {
index bed9eca60438abde9ced1ef7bf8c319211642e34..27d47afe71683cd0ccf942130e9548f84c630059 100644 (file)
@@ -11,7 +11,7 @@
 
 #define BUFFER_SIZE (6 * 4096)
 
-static const char trb_i2c_version[] = "$Revision: 1.7 $"; 
+static const char trb_i2c_version[] = "$Revision: 1.8 $"; 
 
 static const uint16_t trb_i2c_register = 0x8040;
 
@@ -159,11 +159,7 @@ int main(int argc, char** argv)
   }
         
   /* Open port */
-#ifndef TRB_RPC
   init_ports();
-#else
-  trb_connect(NULL);
-#endif
   
   if (strcmp(argv[optind], "w") == 0) {
     
index aa39c479717dd96b0de1649478d2c55345356320..23096fa886ae8992026eeb9be476def60aadde92 100644 (file)
@@ -90,7 +90,7 @@ static const char FlashTypeStr[][32] =
 
 static FlashType flashType = FLASH_INVALID; 
 static uint32_t manId = 0;
-static const char trbflash_version[] = "$Revision: 2.16 $"; 
+static const char trbflash_version[] = "$Revision: 2.17 $"; 
 
 static uint32_t mdcFlashSelect = 1;
 
@@ -121,51 +121,6 @@ static void atexit0()
   free(imageBuffer);
 }
 
-static int readSetupRegister(uint16_t trb_address,
-                             uint8_t value[NUM_ENDPOINTS])
-{
-  unsigned int ctr = 0;
-  int status = -1;
-  int c;
-  int i;
-
-  /* Wait until NoMoreData is withdrawn */
-  do {
-    if ((status = trb_register_read(trb_address, SetupReg,
-                                    trbBuffer, TRB_BUFFER_SIZE)) == -1) {
-      fprintf(logFile, "Error > readSetupRegister: TRBNet %s\n",
-              trb_strerror(trb_errno));
-      return -1;
-    }
-    
-    /* Check timeout */
-    if (ctr >=  timeout) {
-      fprintf(logFile, "Error > readSetupRegister: timeout\n");
-      return -1;
-    }
-    ctr++;
-  } while (trb_term.status_channel == 0x04);
-  
-  if (trb_term.status_channel != 0) {
-    fprintf(logFile, "Error > readSetupRegister: invalid Status returned %s\n",
-            trb_strerror(trb_errno));
-    return -1;
-  }
-  
-  if (status <= 0) {
-    fprintf(logFile, "Error > readSetupRegister: invalid length returned\n");
-    return -1;
-  }
-  
-  c = 0;
-  for (i = 1; i < status; i += 2) {
-    if (value != NULL) value[c] = (uint8_t)((trbBuffer[i] >> 24) & 0xff);  
-    c++;
-  }
-  
-  return c;
-}
-
 static int writeSetupRegister(uint16_t trb_address, uint8_t value)
 {
   unsigned int ctr = 0;
@@ -1020,7 +975,7 @@ static int prepareImageBuffer()
   /* Overwrite Header with 0xff */
   end = 0;
   for (i = 0; i < 2 * PAGE_SIZE; i++) {
-    if (strncmp(imageBuffer + i, "Bitstream CRC: 0x", 17) == 0) {
+    if (strncmp((char*)(imageBuffer + i), "Bitstream CRC: 0x", 17) == 0) {
       end = i + 22;
       break;
     }
@@ -1038,7 +993,7 @@ static int prepareImageBuffer()
 
 static int createInfoPage(const char* fileName, const char* userString)
 {
-  char* buffer = imageBuffer + (NUM_PAGES - 1) * PAGE_SIZE;
+  char* buffer = (char*)(imageBuffer + (NUM_PAGES - 1) * PAGE_SIZE);
   struct stat statBuf;
 
   unsigned int i;
@@ -1183,14 +1138,10 @@ int main(int argc, char ** argv)
     exit(EXIT_FAILURE);
   }
  
-#ifndef TRB_RPC 
   if (init_ports() == -1) {
     trb_error("Init_Ports");
     exit(EXIT_FAILURE);
   }
-#else
-  trb_connect(NULL);
-#endif
   
   atexit(atexit0);
 
@@ -1509,9 +1460,9 @@ int main(int argc, char ** argv)
       fprintf(stdout, "\nEndPoint: 0x%04x   InfoPage\n",
               pageBufferAddress[i]);
       if (
-          (strncmp(pageBuffer[i] + 0, "NAME:", 5) != 0) ||
-          (strncmp(pageBuffer[i] + 64, "DATE:", 5) != 0) ||
-          (strncmp(pageBuffer[i] + 96, "USER:", 5) != 0)
+          (strncmp((char*)(pageBuffer[i] + 0), "NAME:", 5) != 0) ||
+          (strncmp((char*)(pageBuffer[i] + 64), "DATE:", 5) != 0) ||
+          (strncmp((char*)(pageBuffer[i] + 96), "USER:", 5) != 0)
           ) {
         fprintf(stdout, "INVALID CONTENT\n");
         continue;
index 4f9571de83b1b92e4c1afaf48424765e262d1d06..d99b86677a0c3206668a33dd48096b851a652f71 100644 (file)
@@ -13,7 +13,7 @@
 
 #define TEMP_RESOLUTION 0.0625
 
-static const char trbrichcmd_version[] = "$Revision: 1.8 $"; 
+static const char trbrichcmd_version[] = "$Revision: 1.9 $"; 
 
 static const uint16_t adcm_uid_register = 0xc000;
 
@@ -70,11 +70,7 @@ int main(int argc, char** argv)
   }
         
   /* Open port */
-#ifndef TRB_RPC
   init_ports();
-#else
-  trb_connect(NULL);
-#endif
 
   if (strcmp(argv[optind], "uid") == 0) {