Diaz George / Mbed OS EV-PRO-MW1001_EXT_REF_VLTG

Files at this revision

API Documentation at this revision

Comitter:
Vkadaba
Date:
Fri Jun 21 10:53:09 2019 +0000
Parent:
9:dc77fcfa7eba
Child:
11:8e6023d2e584
Commit message:
Added print sample function in utilities and tested. Getting samples now

Changed in this revision

common/platform.h Show annotated file Show diff for this revision Revisions of this file
common/utils.c Show annotated file Show diff for this revision Revisions of this file
main.cpp 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/platform.h	Fri Jun 21 07:35:21 2019 +0000
+++ b/common/platform.h	Fri Jun 21 10:53:09 2019 +0000
@@ -14,7 +14,7 @@
 #    define PLATFORM_SPI_SCK         SPI_SCK
 #    define PLATFORM_SPI_CS          D10
 #    define PLATFORM_GPIO_RESET      D6
-#    define PLATFORM_GPIO_STATUS      D3
+#    define PLATFORM_GPIO_ALERT_ERROR      D3
 #    define PLATFORM_GPIO_DATAREADY  D4
 #    define PLATFORM_LOG_TX          D1
 #    define PLATFORM_LOG_RX          D0
--- a/common/utils.c	Fri Jun 21 07:35:21 2019 +0000
+++ b/common/utils.c	Fri Jun 21 10:53:09 2019 +0000
@@ -113,11 +113,17 @@
     uint32_t nNumSamples,
     ADMW_MEASUREMENT_MODE eMeasurementMode)
 {
-    
-
-    
-
-
+ 
+    for (uint32_t i = 0; i < nNumSamples; i++)
+    {
+            ADMW_LOG_INFO("Sample # %2d Channel # %2d :: Raw %0X %f :: Processed %f :: flags:%s%s",
+                               i+1,
+                               pSampleBuffer[i].channelId,
+                               pSampleBuffer[i].rawValue, (pSampleBuffer[i].rawValue/1024.0),
+                               pSampleBuffer[i].processedValue,
+                               pSampleBuffer[i].status & ADMW_DEVICE_STATUS_ERROR ? " ERROR" : "",
+                               pSampleBuffer[i].status & ADMW_DEVICE_STATUS_ALERT ? " ALERT" : "");
+    }
 }
 
 static void gpioCallbackFn(ADMW_GPIO_PIN ePinId, void * pArg)
--- a/main.cpp	Fri Jun 21 07:35:21 2019 +0000
+++ b/main.cpp	Fri Jun 21 10:53:09 2019 +0000
@@ -93,7 +93,7 @@
 extern ADMW_CONFIG multichannel_singlecycle_config;
 
 /* Change the following pointer to select any of the configurations above */
-static ADMW_CONFIG *pSelectedConfig = &sensor0_typeK_cjc0_config;
+static ADMW_CONFIG *pSelectedConfig = &sensor2_typeT_cjc0_config;
 
 static ADMW_CONNECTION connectionInfo = PLATFORM_CONNECTION_INFO;
 
--- a/src/admw_1001.c	Fri Jun 21 07:35:21 2019 +0000
+++ b/src/admw_1001.c	Fri Jun 21 10:53:09 2019 +0000
@@ -55,7 +55,7 @@
 
 #include "crc16.h"
 #define VERSIONID_MAJOR 1
-#define VERSIONID_MINOR 7
+#define VERSIONID_MINOR 4
 
 uint32_t    getDataCnt = 0;