Diaz George / Mbed OS EV-PRO-MW1001_EXT_REF_VLTG
Revision:
32:57d6dc184906
Parent:
31:38f9097982c7
--- a/src/admw_1001.c	Tue Nov 05 12:45:48 2019 +0000
+++ b/src/admw_1001.c	Thu Nov 14 13:33:58 2019 +0000
@@ -1065,6 +1065,15 @@
     return ADMW_SUCCESS;
 }
 
+static ADMW_RESULT admw_SetExternalReferenceVoltage(
+    ADMW_DEVICE_HANDLE hDevice,
+    float32_t externalRefVoltage)
+{
+    WRITE_REG_FLOAT(hDevice, externalRefVoltage, CORE_EXTERNAL_VOLTAGE_REFERENCE);
+
+    return ADMW_SUCCESS;
+}
+
 static ADMW_RESULT admw_SetExternalReferenceValues(
     ADMW_DEVICE_HANDLE hDevice,
     float32_t externalRef1Value)
@@ -1111,6 +1120,13 @@
         ADMW_LOG_ERROR("Failed to set RSenseValue");
         return eRet;
     }
+ 
+    eRet = admw_SetExternalReferenceVoltage(hDevice, pMeasConfig->externalRefVoltage);
+    if (eRet != ADMW_SUCCESS)
+    {
+        ADMW_LOG_ERROR("Failed to set External reference Voltage");
+        return eRet;
+    }     
     return ADMW_SUCCESS;
 }