1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

Added code to parse Fxxx notation for WPC flipper coils, distinguish between WPC and WPC95 in coil numbering, and remap WPC coils between 37 and 44 to x + 101 to use P-ROC's enable[8] which goes to the 8-driver board

This commit is contained in:
gstellenberg
2009-10-10 23:02:03 -05:00
parent e496c5d35e
commit 672c48c61d

View File

@@ -245,10 +245,63 @@ PR_EXPORT uint16_t PRDecode(PRMachineType machineType, const char *str)
x = (str[2]-'0') * 10 + (str[3]-'0');
else return atoi(str);
if (machineType == kPRMachineWPC)
if ((machineType == kPRMachineWPC) || (machineType == kPRMachineWPC95))
{
switch (str[0])
{
case 'F':
case 'f':
switch (str[1])
{
case 'L':
case 'l':
switch (str[2])
{
case 'R':
case 'r':
switch (str[3])
{
case 'M':
case 'm':
return 32;
default:
return 33;
}
default:
switch (str[3])
{
case 'M':
case 'm':
return 34;
default:
return 35;
}
}
default:
switch (str[2])
{
case 'R':
case 'r':
switch (str[3])
{
case 'M':
case 'm':
return 36;
default:
return 37;
}
default:
switch (str[3])
{
case 'M':
case 'm':
return 38;
default:
return 39;
}
}
}
case 'L':
case 'l':
return 80 + 8 * ((x / 10) - 1) + ((x % 10) -1);
@@ -256,8 +309,16 @@ PR_EXPORT uint16_t PRDecode(PRMachineType machineType, const char *str)
case 'c':
if (x <= 28)
return x + 39;
else
else if (x <= 36)
return x + 3;
else if (x <= 44)
{
if (machineType == kPRMachineWPC95)
return x + 7;
else
return x + 101; // WPC 37-44 use 8-driver board
}
else return x + 102;
case 'G':
case 'g':
return x + 71;