Vybhav Kadaba / Mbed OS EV-PRO-MW1001_MWARE1445

Files at this revision

API Documentation at this revision

Comitter:
Vkadaba
Date:
Tue Feb 18 08:16:03 2020 +0000
Parent:
51:d84305e5e1c0
Commit message:
Printing correct Raw values

Changed in this revision

common/utils.c Show annotated file Show diff for this revision Revisions of this file
inc/admw_api.h Show annotated file Show diff for this revision Revisions of this file
src/admw_1001.c Show annotated file Show diff for this revision Revisions of this file
--- a/common/utils.c	Mon Feb 17 11:23:39 2020 +0000
+++ b/common/utils.c	Tue Feb 18 08:16:03 2020 +0000
@@ -134,13 +134,13 @@
 {
 
     for (uint32_t i = 0; i < nNumSamples; i++) {
-        ADMW_LOG_INFO("Sample # %2d Channel # %2d :: Raw %X %f :: Processed %f :: flags:%s%s",
+        ADMW_LOG_INFO("Sample # %2d Channel # %2d :: Raw %f :: Processed %f :: flags:ERROR:%X,ALERT:%X",
                       i+1,
                       pSampleBuffer[i].channelId,
-                      pSampleBuffer[i].rawValue, (pSampleBuffer[i].rawValue/1024.0),
+                      pSampleBuffer[i].rawValue,
                       pSampleBuffer[i].processedValue,
-                      pSampleBuffer[i].status & ADMW_DEVICE_STATUS_ERROR ? " ERROR" : "",
-                      pSampleBuffer[i].status & ADMW_DEVICE_STATUS_ALERT ? " ALERT" : "");
+                      pSampleBuffer[i].status & ADMW_DEVICE_STATUS_ERROR,
+                      pSampleBuffer[i].status & ADMW_DEVICE_STATUS_ALERT);
     }
 }
 
--- a/inc/admw_api.h	Mon Feb 17 11:23:39 2020 +0000
+++ b/inc/admw_api.h	Tue Feb 18 08:16:03 2020 +0000
@@ -174,7 +174,7 @@
     /*!< The measurement channel from which this sample was obtained */
     uint8_t                      measurementStatus;
     /*!< The measurement status from the DMZ layer */
-    uint32_t                      rawValue;
+    float32_t                      rawValue;
     /*!< The raw (unprocessed) value obtained directly from the measurement
      *   channel, if available
      */
--- a/src/admw_1001.c	Mon Feb 17 11:23:39 2020 +0000
+++ b/src/admw_1001.c	Tue Feb 18 08:16:03 2020 +0000
@@ -434,7 +434,7 @@
     if (bWaitForCompletion) {
         do {
             /* Allow a minimum 100usec delay for status update before checking */
-            admw_TimeDelayUsec(100);
+            admw_TimeDelayUsec(50);
 
             eRet = admw_GetCommandRunningState(hDevice, &bCommandRunning);
             if (eRet)