Better messages

pull/15/head
Bruno Rohée 2023-11-06 14:12:43 +01:00 zatwierdzone przez GitHub
rodzic a9e37bbd50
commit a3faca61d9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -748,14 +748,14 @@ void helpme()
"cmdline opts:\n" "cmdline opts:\n"
"-f <file>\tfilename that contains the eeprom dump (default: " DEFAULT_FILE_NAME ")\n" "-f <file>\tfilename that contains the eeprom dump (default: " DEFAULT_FILE_NAME ")\n"
"-b <file>\tfilename that contains the raw flash image (default " DEFAULT_FLASH_NAME ")\n" "-b <file>\tfilename that contains the raw flash image (default " DEFAULT_FLASH_NAME ")\n"
"-Y \tincrease \"I know what i'm doing\" value, to enable functionality likely to break the radio\n" "-Y \tincrease \"I know what I'm doing\" value, to enable functionality likely to break the radio\n"
"-D \twait for the message from the radio flasher, print it's version\n" "-D \twait for the message from the radio flasher, print it's version\n"
"-F \tflash firmware, WARNING: this will likely brick your radio!\n" "-F \tflash firmware, WARNING: this will likely brick your radio!\n"
"-M <ver> \tSet the firmware major version to <ver> during the flash process (default: " DEFAULT_FLASH_VERSION ")\n" "-M <ver> \tSet the firmware major version to <ver> during the flash process (default: " DEFAULT_FLASH_VERSION ")\n"
"-r \tread eeprom\n" "-r \tread eeprom\n"
"-w \twrite eeprom like the original software does\n" "-w \twrite eeprom like the original software does\n"
"-W \twrite most of the eeprom (but without what i think is calibration data)\n" "-W \twrite most of the EEPROM (but without what I think is calibration data)\n"
"-B \twrite ALL of the eeprom (the \"brick my radio\" mode)\n" "-B \twrite ALL of the EEPROM (the \"brick my radio\" mode)\n"
"-p <port>\tdevice name (default: " DEFAULT_SERIAL_PORT ")\n" "-p <port>\tdevice name (default: " DEFAULT_SERIAL_PORT ")\n"
"-s <speed>\tserial speed (default: 38400, the UV-K5 doesn't accept any other speed)\n" "-s <speed>\tserial speed (default: 38400, the UV-K5 doesn't accept any other speed)\n"
"-h \tprint this help\n" "-h \tprint this help\n"
@ -998,7 +998,7 @@ int main(int argc,char **argv)
/* arbitrary limit do that someone doesn't flash some random short file */ /* arbitrary limit do that someone doesn't flash some random short file */
if ((i_know_what_im_doing<5)&&(flash_length<50000)) { if ((i_know_what_im_doing<5)&&(flash_length<50000)) {
fprintf(stderr,"Failed to read whole eeprom from file %s (read %i), file too short or some other error\n",file,flash_length); fprintf(stderr,"Failed to read whole EEPROM from file %s (read %i), file too short or some other error\n",file,flash_length);
if (flash_length>0) { if (flash_length>0) {
fprintf(stderr,"This failsafe is here so that people don't mistake config files with flash.\nIt can be ignored with an 'i know what i'm doing' value of at least 5\n"); fprintf(stderr,"This failsafe is here so that people don't mistake config files with flash.\nIt can be ignored with an 'i know what i'm doing' value of at least 5\n");
} }
@ -1079,7 +1079,7 @@ int main(int argc,char **argv)
} }
} }
close(fd); close(fd);
if (verbose>0) { printf("\rSucessfuly read eeprom\n"); } if (verbose>0) { printf("\rSuccessfully read EEPROM\n"); }
if (verbose>2) { hdump((unsigned char *)&eeprom,UVK5_EEPROM_SIZE); } if (verbose>2) { hdump((unsigned char *)&eeprom,UVK5_EEPROM_SIZE); }
write_file(file,(unsigned char *)&eeprom,UVK5_EEPROM_SIZE); write_file(file,(unsigned char *)&eeprom,UVK5_EEPROM_SIZE);
@ -1090,7 +1090,7 @@ int main(int argc,char **argv)
case MODE_WRITE_MOST: case MODE_WRITE_MOST:
case MODE_WRITE_ALL: case MODE_WRITE_ALL:
if ((mode==MODE_WRITE_ALL)&&(i_know_what_im_doing<1)) { if ((mode==MODE_WRITE_ALL)&&(i_know_what_im_doing<1)) {
printf("ERROR: the \"I know what i'm doing\" value has to be at least 1 to confirm that you know what you're doing\n"); printf("ERROR: the \"I know what I'm doing\" value has to be at least 1 to confirm that you know what you're doing\n");
exit(0); exit(0);
} }
@ -1102,7 +1102,7 @@ int main(int argc,char **argv)
} }
r=read(ffd,(unsigned char *)&eeprom[i],UVK5_EEPROM_SIZE); r=read(ffd,(unsigned char *)&eeprom[i],UVK5_EEPROM_SIZE);
if (r!=UVK5_EEPROM_SIZE) { if (r!=UVK5_EEPROM_SIZE) {
fprintf(stderr,"Failed to read whole eeprom from file %s, file too short?\n",file); fprintf(stderr,"Failed to read whole EEPROM from file %s, file too short?\n",file);
exit(1); exit(1);
} }
close(ffd); close(ffd);
@ -1146,7 +1146,7 @@ int main(int argc,char **argv)
} }
} }
k5_reset(fd); k5_reset(fd);
if (verbose>0) { printf("\rSucessfuly wrote eeprom\n"); } if (verbose>0) { printf("\rSuccessfully wrote EEPROM\n"); }
break; break;