Code clean up and handling FIFO errors

Revision:
69:4305ac772a66
Parent:
67:d36977cbfe90
--- a/common/utils.c	Mon Apr 20 05:46:42 2020 +0000
+++ b/common/utils.c	Mon Apr 20 06:23:42 2020 +0000
@@ -260,13 +260,17 @@
          * Wait until the next batch of 1 or more samples is ready, continuously
          * checking DATAREADY until it is asserted
          */
-    //Checking the status of the device before capturing the data 
+    //Checking if FIFO error is set 
     res = admw_GetStatus(hDevice, &status);
     if (res != ADMW_SUCCESS) 
     {
         ADMW_LOG_ERROR("Failed to retrieve device status");
     }
-    utils_printStatus(&status);
+    if (status.deviceStatus & ADMW_DEVICE_STATUS_FIFO_ERROR)
+    {
+        utils_printStatus(&status);
+        break;
+    }
         while (! (bDataReady || bError));
 
             if (!bError) {