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

Added handling for 'custom' machineType to pypinproc. Set error text on machine type failure in PRCreate.

This commit is contained in:
Adam Preble
2009-10-17 18:05:45 -04:00
parent 672c48c61d
commit 4ac76276d0

View File

@@ -48,6 +48,7 @@ PRDevice* PRDevice::Create(PRMachineType machineType)
if (dev == NULL) if (dev == NULL)
{ {
DEBUG(PRLog(kPRLogError, "Error allocating memory for P-ROC device\n")); DEBUG(PRLog(kPRLogError, "Error allocating memory for P-ROC device\n"));
PRSetLastErrorText("Error allocating memory for P-ROC device");
return NULL; return NULL;
} }
@@ -68,6 +69,8 @@ PRDevice* PRDevice::Create(PRMachineType machineType)
readMachineType == kPRMachineWPC) ) readMachineType == kPRMachineWPC) )
{ {
dev->Close(); dev->Close();
DEBUG(PRLog(kPRLogError, "Machine type 0x%x invalid for P-ROC board settings 0x%x.\n", machineType, readMachineType));
PRSetLastErrorText("Machine type error.");
return NULL; return NULL;
} }