Test, please delete

Branch:
v2.0
Revision:
27:567abf893938
Parent:
23:2adb6216b001
Child:
29:57edca10d78c
--- a/main.cpp	Mon Mar 26 14:50:05 2018 +0000
+++ b/main.cpp	Mon Mar 26 20:28:05 2018 +0100
@@ -1,7 +1,20 @@
 /*
- ******************************************************************************
- * file:   main.cpp
- *-----------------------------------------------------------------------------
+CONFIDENTIAL AND PROPRIETARY INFORMATION
+
+Copyright (c) 2018 Emutex Ltd. All rights reserved.
+This software and documentation contain confidential and
+proprietary information that is the property of
+Emutex Ltd. The software and documentation are
+furnished under a license agreement and may be used
+or copied only in accordance with the terms of the license
+agreement. No part of the software and documentation
+may be reproduced, transmitted, or translated, in any
+form or by any means, electronic, mechanical, manual,
+optical, or otherwise, without prior written permission
+of Emutex Ltd., or as expressly provided by the license agreement.
+Reverse engineering is prohibited, and reproduction,
+disclosure or use without specific written authorization
+of Emutex Ltd. is strictly forbidden.
  *
 Copyright 2017 (c) Analog Devices, Inc.
 
@@ -37,6 +50,12 @@
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  *****************************************************************************/
+/*!
+ ******************************************************************************
+ * @file:
+ *-----------------------------------------------------------------------------
+ *
+ */
 #include "mbed.h"
 #include "inc/adi_sense_api.h"
 #include "inc/adi_sense_1000/adi_sense_1000_api.h"
@@ -44,8 +63,11 @@
 #include "common/utils.h"
 
 extern ADI_SENSE_CONFIG sensor0_rtd_2w_pt100_config;
+extern ADI_SENSE_CONFIG sensor0_microphone_config;
+extern ADI_SENSE_CONFIG sensor0_diode_2c_config;
 extern ADI_SENSE_CONFIG sensor1_typeK_cjc1_config;
 extern ADI_SENSE_CONFIG sensor1_rtd_3w_pt100_config;
+extern ADI_SENSE_CONFIG sensor1_diode_3c_config;
 extern ADI_SENSE_CONFIG sensor2_typeT_cjc0_config;
 extern ADI_SENSE_CONFIG sensor2_bridge_6w_pressure_config;
 extern ADI_SENSE_CONFIG sensor3_typeJ_cjc0_config;
@@ -54,8 +76,10 @@
 extern ADI_SENSE_CONFIG current_honeywellPressure_config;
 extern ADI_SENSE_CONFIG i2c0_honeywellHumidicon_config;
 extern ADI_SENSE_CONFIG i2c0_sensirionSHT3X_config;
+extern ADI_SENSE_CONFIG i2c0_onsemiNOA1305_config;
 extern ADI_SENSE_CONFIG spi0_honeywellTrustability_config;
 extern ADI_SENSE_CONFIG spi0_adiAdxl362_config;
+extern ADI_SENSE_CONFIG spi0_adiAdxl355_config;
 extern ADI_SENSE_CONFIG multichannel_continuous_config;
 extern ADI_SENSE_CONFIG multichannel_multicycle_config;
 extern ADI_SENSE_CONFIG multichannel_singlecycle_config;
@@ -83,6 +107,7 @@
 int main()
 {
     ADI_SENSE_RESULT res;
+    ADI_SENSE_STATUS status;
     ADI_SENSE_DEVICE_HANDLE hDevice;
     ADI_SENSE_MEASUREMENT_MODE eMeasurementMode = ADI_SENSE_MEASUREMENT_MODE_NORMAL;
     bool_t bDeviceReady;
@@ -138,6 +163,20 @@
         ADI_SENSE_LOG_ERROR("Failed to apply device configuration");
         return res;
     }
+    /*
+     * Check device status after updating the configuration
+     */
+    res = adi_sense_GetStatus(hDevice, &status);
+    if (res != ADI_SENSE_SUCCESS)
+    {
+        ADI_SENSE_LOG_ERROR("Failed to retrieve device status");
+        return res;
+    }
+    if (status.deviceStatus &
+        (ADI_SENSE_DEVICE_STATUS_ERROR | ADI_SENSE_DEVICE_STATUS_ALERT))
+    {
+        utils_printStatus(&status);
+    }
 
     /*
      * Kick off the measurement cycle here
@@ -157,4 +196,3 @@
 
     return 0;
 }
-