]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
update
authorhadaq <hadaq>
Wed, 9 Sep 2009 22:53:36 +0000 (22:53 +0000)
committerhadaq <hadaq>
Wed, 9 Sep 2009 22:53:36 +0000 (22:53 +0000)
trbrich/trbflash.c

index 9234b42c64fadd8cd6b9476b663e63511dbffe6c..781fe5efb94255e57fb17fc8a095c9b139480add 100644 (file)
@@ -63,7 +63,7 @@ static const char FlashTypeStr[][16] = {"INVALID", "ADCM1", "ADCM2", "MDC"};
 
 static FlashType flashType = FLASH_INVALID; 
 
-static const char trbflash_version[] = "$Revision: 2.04 $"; 
+static const char trbflash_version[] = "$Revision: 2.05 $"; 
 
 static uint32_t mdcFlashSelect = 1;
 
@@ -431,7 +431,7 @@ static int readPage(uint16_t trb_address, uint32_t pageNumber,
   if (sendCommand(trb_address, trbcmd, numBytes - 1) == -1) {
     return -1;
   }
-  
+
   size = (numBytes / 4) + (numBytes % 4 != 0 ? 1 : 0);
   if ((status = trb_register_read_mem(trb_address, BlockRam, 0, size,
                                       trbBuffer, TRB_BUFFER_SIZE)) 
@@ -548,25 +548,25 @@ static int programImageBuffer(uint16_t trb_address, unsigned int size,
   if (verifyOnly == 0) {
     /* Be nice and ask before start flashing the roms */
     char c;
-    fprintf(stdout, "You decided to reprogram the FlashRom(s), " 
-            "are you sure [N,y]: ");
+    if (flashType == FLASH_MDC) {
+      if (mdcFlashSelect == 0) {
+        fprintf(stdout, "You decided to reprogram the FlashRom(s) #0 of "
+                "MDC, the so called 'GoldenImage'. Do you really know what "
+                "you're about to do [N,y]: ");
+      } else {
+        fprintf(stdout, "You decided to reprogram the FlashRom(s) #1 of "
+                "MDC, are you sure [N,y]: ");
+      }
+    } else {
+      fprintf(stdout, "You decided to reprogram the FlashRom(s) of "
+              "RICH, are you sure [N,y]: ");
+    }
+    
     c = getc(stdin);
     if (!((c == 'Y') || (c == 'y'))) {
       fprintf(stderr, "\nAborting on user request\n");
       return -1;
     }
-    
-    if (flashType == FLASH_MDC) {
-      if (mdcFlashSelect == 0) {
-        fprintf(stdout, "\nFlashRom(s) #0 of MDC (i.e. the GoldenImage(s)), "
-                "do you know what you're about to do [N,y]: ");
-        c = getc(stdin);
-        if (!((c == 'Y') || (c == 'y'))) {
-          fprintf(stderr, "\nAborting on user request\n");
-          return -1;
-        }  
-      }
-    }      
   }
   
   if (verifyOnly == 0) {