From: hadaq Date: Wed, 9 Sep 2009 22:53:36 +0000 (+0000) Subject: update X-Git-Tag: v6.0~345 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=bad67a480e359a9e1766aec0c2a5707c5f19732f;p=trbnettools.git update --- diff --git a/trbrich/trbflash.c b/trbrich/trbflash.c index 9234b42..781fe5e 100644 --- a/trbrich/trbflash.c +++ b/trbrich/trbflash.c @@ -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) {