Library for MAX30101 SpO2 and heart rate sensor

Dependents:   HeartRate HeartRate proj final_project_ee119 ... more

Files at this revision

API Documentation at this revision

Comitter:
j3
Date:
Sat Sep 02 11:57:40 2017 -0700
Parent:
9:28164e9ac58e
Commit message:
Fixed [Warning] MAX30101.cpp@56,52: narrowing conversion of '(((int)data.MAX30101::InterruptBitField_u::all) & 240)' from 'int' to 'char' inside { } is ill-formed in C++11 [-Wnarrowing]

Changed in this revision

MAX30101.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 28164e9ac58e -r 85513b7480f5 MAX30101.cpp
--- a/MAX30101.cpp	Sat Sep 02 11:51:48 2017 -0700
+++ b/MAX30101.cpp	Sat Sep 02 11:57:40 2017 -0700
@@ -53,8 +53,11 @@
 //*****************************************************************************
 int32_t MAX30101::enableInterrupts(const InterruptBitField_u data)
 {
-    char cmdData[3] = {InterruptEnable1, (data.all & 0xF0), (data.all & 0x02)};
-    
+    char cmdData[3];
+    cmdData[0] = InterruptEnable1;
+    cmdData[1] = (data.all & 0xF0);
+    cmdData[2] = (data.all & 0x02);
+
     return m_i2cBus.write(I2C_W_ADRS, cmdData, 3);
 }