mirror of
https://github.com/preble/libpinproc
synced 2026-02-22 18:15:25 +01:00
Added handling for 'custom' machineType to pypinproc. Set error text on machine type failure in PRCreate.
This commit is contained in:
@@ -48,6 +48,7 @@ PRDevice* PRDevice::Create(PRMachineType machineType)
|
||||
if (dev == NULL)
|
||||
{
|
||||
DEBUG(PRLog(kPRLogError, "Error allocating memory for P-ROC device\n"));
|
||||
PRSetLastErrorText("Error allocating memory for P-ROC device");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -68,6 +69,8 @@ PRDevice* PRDevice::Create(PRMachineType machineType)
|
||||
readMachineType == kPRMachineWPC) )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user