1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

use device id instead of type

This commit is contained in:
Ralph Metzler 2016-10-10 00:10:39 +02:00
parent 1171b345df
commit a3b517391a

View File

@ -459,6 +459,7 @@ int main(int argc, char **argv)
int ddbnum = 0; int ddbnum = 0;
int force = 0; int force = 0;
char *fname = NULL;
while (1) { while (1) {
int option_index = 0; int option_index = 0;
@ -470,12 +471,15 @@ int main(int argc, char **argv)
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
c = getopt_long(argc, argv, c = getopt_long(argc, argv,
"d:n:s:o:l:dfhj", "d:n:s:o:l:dfhjb:",
long_options, &option_index); long_options, &option_index);
if (c==-1) if (c==-1)
break; break;
switch (c) { switch (c) {
case 'b':
fname = optarg;
break;
case 'd': case 'd':
dump = strtoul(optarg, NULL, 16); dump = strtoul(optarg, NULL, 16);
break; break;
@ -553,27 +557,6 @@ int main(int argc, char **argv)
return 0; return 0;
} }
if (ddbid.device == 0x0011)
type = 1;
if (ddbid.device == 0x0201)
type = 2;
if (ddbid.device == 0x02)
type = 3;
if (ddbid.device == 0x03)
type = 0;
if (ddbid.device == 0x07)
type = 4;
if (ddbid.device == 0x320)
type = 5;
if (ddbid.device == 0x13)
type = 6;
if (ddbid.device == 0x12)
type = 7;
if (ddbid.device == 0x08)
type = 8;
if (ddbid.device == 0x210)
type = 9;
if (!SectorSize) if (!SectorSize)
return 0; return 0;
@ -616,42 +599,46 @@ int main(int argc, char **argv)
} else { } else {
int fh, i; int fh, i;
int fsize; int fsize;
char *fname;
switch (type) { if (!fname)
case 0: switch (ddbid.device) {
fname="DVBBridgeV1B_DVBBridgeV1B.bit"; case 0x0002:
printf("Octopus\n");
break;
case 1:
fname="CIBridgeV1B_CIBridgeV1B.bit";
printf("Octopus CI\n");
break;
case 2:
fname="DVBModulatorV1B_DVBModulatorV1B.bit";
printf("Modulator\n");
break;
case 3:
fname="DVBBridgeV1A_DVBBridgeV1A.bit"; fname="DVBBridgeV1A_DVBBridgeV1A.bit";
printf("Octopus 35\n"); printf("Octopus 35\n");
break; break;
case 4: case 0x0003:
fname="DVBBridgeV1B_DVBBridgeV1B.bit";
printf("Octopus\n");
break;
case 0x0007:
fname="DVBBridgeV2A_DD01_0007_MXL.fpga"; fname="DVBBridgeV2A_DD01_0007_MXL.fpga";
printf("Octopus 4/8\n"); printf("Octopus 4/8\n");
break; break;
case 8: case 0x0008:
fname="DVBBridgeV2A_DD01_0008_CXD.fpga"; fname="DVBBridgeV2A_DD01_0008_CXD.fpga";
printf("Octopus 4/8\n"); printf("Octopus 4/8\n");
break; break;
case 6: case 0x0011:
fname="DVBBridgeV2B_DD01_0013_PRO.fpga"; fname="CIBridgeV1B_CIBridgeV1B.bit";
printf("Octopus PRO\n"); printf("Octopus CI\n");
break; break;
case 7: case 0x0012:
fname="DVBBridgeV2B_DD01_0012_STD.fpga"; fname="DVBBridgeV2B_DD01_0012_STD.fpga";
printf("Octopus CI\n"); printf("Octopus CI\n");
break; break;
case 9: case 0x0013:
fname="DVBBridgeV2B_DD01_0013_PRO.fpga";
printf("Octopus PRO\n");
break;
case 0x0201:
fname="DVBModulatorV1B_DVBModulatorV1B.bit";
printf("Modulator\n");
break;
case 0x0203:
fname="DVBModulatorV1B_DD01_0203.fpga";
printf("Modulator Test\n");
break;
case 0x0210:
fname="DVBModulatorV2A_DD01_0210.fpga"; fname="DVBModulatorV2A_DD01_0210.fpga";
printf("Modulator V2\n"); printf("Modulator V2\n");
break; break;
@ -661,7 +648,7 @@ int main(int argc, char **argv)
} }
fh = open(fname, O_RDONLY); fh = open(fname, O_RDONLY);
if (fh < 0 ) { if (fh < 0 ) {
printf("File not found \n"); printf("File %s not found \n", fname);
return 0; return 0;
} }
printf("Using bitstream %s\n", fname); printf("Using bitstream %s\n", fname);