@@ -242,13 +242,13 @@ int main(int argc, char *argv[]) {
242
242
int ssdflag = 0 ;
243
243
char * serialvalue = NULL ;
244
244
char * pcbvalue = NULL ;
245
-
245
+ char * outfilename = "eeprom.bin" ;
246
246
int index ;
247
247
int c ;
248
248
249
249
opterr = 0 ;
250
250
251
- while ((c = getopt (argc , argv , "gds:p:" )) != -1 )
251
+ while ((c = getopt (argc , argv , "gds:p:o: " )) != -1 )
252
252
switch (c )
253
253
{
254
254
case 'g' :
@@ -263,6 +263,9 @@ int main(int argc, char *argv[]) {
263
263
case 'p' :
264
264
pcbvalue = optarg ;
265
265
break ;
266
+ case 'o' :
267
+ outfilename = optarg ;
268
+ break ;
266
269
case '?' :
267
270
if (optopt == 'c' )
268
271
fprintf (stderr , "Option -%c requires an argument.\n" , optopt );
@@ -279,17 +282,17 @@ int main(int argc, char *argv[]) {
279
282
printf ("Build: %s %s\n" , __DATE__ , __TIME__ );
280
283
printf ("Descriptor Version: %d %d\n" , 0 , 1 );
281
284
282
- printf ("gpu = %d, ssd = %d, module SN = %s pcb SN = %s\n" ,
283
- gpuflag , ssdflag , serialvalue , pcbvalue );
285
+ printf ("gpu = %d, ssd = %d, module SN = %s pcb SN = %s output file = %s \n" ,
286
+ gpuflag , ssdflag , serialvalue , pcbvalue , outfilename );
284
287
285
288
if (gpuflag ) {
286
289
if (pcbvalue ) {
287
290
strncpy (gpu_cfg .pcba_serial .serial , pcbvalue , GPU_SERIAL_LEN );
288
291
}
289
- program_eeprom (serialvalue , (void * )& gpu_cfg , sizeof (gpu_cfg ), "gpueeprom.bin" );
292
+ program_eeprom (serialvalue , (void * )& gpu_cfg , sizeof (gpu_cfg ), outfilename );
290
293
}
291
294
292
295
if (ssdflag ) {
293
- program_eeprom (serialvalue , (void * )& ssd_cfg , sizeof (ssd_cfg ), "ssdeeprom.bin" );
296
+ program_eeprom (serialvalue , (void * )& ssd_cfg , sizeof (ssd_cfg ), outfilename );
294
297
}
295
298
}
0 commit comments