Skip to content

Commit

Permalink
Only check driver version if board is open
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiegle committed Apr 29, 2024
1 parent beb1770 commit 74bb780
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Source/DeviceThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,15 @@ bool DeviceThread::openBoard(bool displayInfo)
{
const oni_driver_info_t *driverInfo;
int return_code = evalBoard->open(&driverInfo);
if (displayInfo)

int major, minor, patch;
evalBoard->getONIVersion(&major, &minor, &patch);
LOGC("ONI Library version: ", major, ".", minor, ".", patch);
LOGC("ONI Driver: ", driverInfo->name, " Version: ", driverInfo->major, ".", driverInfo->minor, ".", driverInfo->patch, (driverInfo->pre_release ? "-" : ""), (driverInfo->pre_release ? driverInfo->pre_release : ""));

if (return_code == 1) // successfully opened board
{
int major, minor, patch;
evalBoard->getONIVersion(&major, &minor, &patch);
LOGC("ONI Library version: ", major, ".", minor, ".", patch);
LOGC("ONI Driver: ", driverInfo->name, " Version: ", driverInfo->major, ".", driverInfo->minor, ".", driverInfo->patch, (driverInfo->pre_release ? "-" : ""), (driverInfo->pre_release ? driverInfo->pre_release : ""));

if (evalBoard->getFTDriverInfo(&major, &minor, &patch))
{
LOGC("FTDI Driver version: ", major, ".", minor, ".", patch);
Expand All @@ -365,10 +368,7 @@ bool DeviceThread::openBoard(bool displayInfo)
{
LOGC("FTDI Library version: ", major, ".", minor, ".", patch);
}
}

if (return_code == 1)
{
deviceFound = true;
}
else // board could not be opened
Expand Down

0 comments on commit 74bb780

Please sign in to comment.