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

Fixed logic comparing the requested machineType against the P-ROC's machine type.

This commit is contained in:
gstellenberg
2009-10-20 23:41:21 -05:00
parent 73bcc3575b
commit cee4aab5a2

View File

@@ -61,12 +61,16 @@ PRDevice* PRDevice::Create(PRMachineType machineType)
PRMachineType readMachineType = dev->GetReadMachineType();
// Custom is always accepted
if (machineType != kPRMachineCustom &&
// Don't accept if requested type is WPC/WPC95 but read machine is not.
( ((machineType == kPRMachineWPC) || (machineType == kPRMachineWPC95)) &&
(readMachineType != kPRMachineWPC &&
readMachineType != kPRMachineWPC95)) ||
readMachineType != kPRMachineWPC95) ||
// Also don't accept if the requested is not WPC/WPC95 but the P-ROC is.
(machineType != kPRMachineWPC && machineType != kPRMachineWPC95 &&
readMachineType == kPRMachineWPC) )
readMachineType == kPRMachineWPC) ) )
{
dev->Close();
DEBUG(PRLog(kPRLogError, "Machine type 0x%x invalid for P-ROC board settings 0x%x.\n", machineType, readMachineType));