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

Separated machineType stern into sternSAM and sternWhitestar.

This commit is contained in:
Gerry Stellenberg
2009-09-28 23:33:09 -05:00
parent d767e74258
commit 3f36b408ca

View File

@@ -58,7 +58,11 @@ PRDevice* PRDevice::Create(PRMachineType machineType)
return NULL; return NULL;
} }
if (machineType != kPRMachineCustom && machineType != dev->GetReadMachineType()) PRMachineType readMachineType = dev->GetReadMachineType();
if (machineType != kPRMachineCustom &&
( (machineType == kPRMachineWPC && readMachineType != kPRMachineWPC) ||
(machineType != kPRMachineWPC && readMachineType == kPRMachineWPC) ))
{ {
dev->Close(); dev->Close();
return NULL; return NULL;
@@ -288,7 +292,8 @@ PRResult PRDevice::DriverLoadMachineTypeDefaults(PRMachineType machineType, uint
break; break;
} }
case kPRMachineStern: case kPRMachineSternWhitestar:
case kPRMachineSternSAM:
{ {
memcpy(mappedDriverGroupEnableIndex,mappedSternDriverGroupEnableIndex, memcpy(mappedDriverGroupEnableIndex,mappedSternDriverGroupEnableIndex,
sizeof(mappedDriverGroupEnableIndex)); sizeof(mappedDriverGroupEnableIndex));
@@ -832,7 +837,7 @@ PRResult PRDevice::VerifyChipID()
DEBUG(PRLog(kPRLogInfo, "Watchdog Settings: 0x%x\n", buffer[3])); DEBUG(PRLog(kPRLogInfo, "Watchdog Settings: 0x%x\n", buffer[3]));
DEBUG(PRLog(kPRLogInfo, "Switches: 0x%x\n", buffer[4])); DEBUG(PRLog(kPRLogInfo, "Switches: 0x%x\n", buffer[4]));
if (buffer[4] & 0x1) readMachineType = kPRMachineWPC; if (buffer[4] & 0x1) readMachineType = kPRMachineWPC;
else readMachineType = kPRMachineStern; else readMachineType = kPRMachineSternWhitestar; // Choose SAM or Whitestar, doesn't matter.
rc = kPRSuccess; rc = kPRSuccess;
} }
else { else {