Fork of Maxim's human body temp sensor library that works with mbed-os 5

Fork of MAX30205 by Maxim Integrated

Revision:
9:2b8357c91343
Parent:
8:2aeb45dd2bb9
diff -r 2aeb45dd2bb9 -r 2b8357c91343 MAX30205.cpp
--- a/MAX30205.cpp	Thu Jul 27 22:49:16 2017 +0000
+++ b/MAX30205.cpp	Wed Oct 18 15:51:47 2017 +0000
@@ -37,8 +37,7 @@
 
 //******************************************************************************
 MAX30205::MAX30205(I2C &i2c, uint8_t slaveAddress): 
-m_i2c(i2c), m_writeAddress(slaveAddress << 1), 
-m_readAddress((slaveAddress << 1) | 1)
+m_i2c(i2c), m_address(slaveAddress)
 {
 }
 
@@ -141,7 +140,7 @@
   uint8_t lo = (value & 0xFF);
   char cmdData[3] = {reg, hi, lo};
   
-  result = m_i2c.write(m_writeAddress, cmdData, 3);
+  result = m_i2c.write(m_address, cmdData, 3);
   
   return result;
 }
@@ -155,10 +154,10 @@
   char data[2];
   char cmdData[1] = {reg};
   
-  result = m_i2c.write(m_writeAddress, cmdData, 1);
+  result = m_i2c.write(m_address, cmdData, 1);
   if(result == 0)
   {
-      result = m_i2c.read(m_readAddress, data, 2);
+      result = m_i2c.read(m_address, data, 2);
       if (result == 0)
       {
           value = (data[0] << 8) + data[1];