From 74bb7804091db9aa9962d9632821b241abcc7f5c Mon Sep 17 00:00:00 2001 From: Josh Siegle Date: Mon, 29 Apr 2024 16:42:27 -0700 Subject: [PATCH] Only check driver version if board is open --- Source/DeviceThread.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/DeviceThread.cpp b/Source/DeviceThread.cpp index cf4ec03..8b649ee 100644 --- a/Source/DeviceThread.cpp +++ b/Source/DeviceThread.cpp @@ -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); @@ -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