aio: fix for maa aio API change and make required libmaa version exactly 0.2.3 v0.1.0
authorBrendan Le Foll <brendan.le.foll@intel.com>
Wed, 14 May 2014 13:09:41 +0000 (14:09 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Wed, 14 May 2014 13:09:41 +0000 (14:09 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
CMakeLists.txt
src/grove/grove.cxx

index 66b5237..3ce86ee 100644 (file)
@@ -8,7 +8,8 @@ endif ()
 
 find_package (Threads REQUIRED)
 find_package (PkgConfig REQUIRED)
-pkg_check_modules (MAA REQUIRED maa>=0.2.2)
+# force the libmaa version to be the required version
+pkg_check_modules (MAA REQUIRED maa=0.2.3)
 message (INFO " found libmaa version: ${MAA_VERSION}")
 
 set (CMAKE_SWIG_FLAGS "")
index 4cb211f..63f2ecd 100644 (file)
@@ -78,7 +78,7 @@ GroveTemp::~GroveTemp()
 
 int GroveTemp::value ()
 {
-    int a = maa_aio_read_u16(m_aio);
+    int a = maa_aio_read(m_aio);
     float r = (float)(1023-a)*10000/a;
     float t = 1/(logf(r/10000)/3975 + 1/298.15)-273.15;
     return (int) t;
@@ -86,7 +86,7 @@ int GroveTemp::value ()
 
 float GroveTemp::raw_value()
 {
-    return (float) maa_aio_read_u16(m_aio);
+    return (float) maa_aio_read(m_aio);
 }
 
 //// GroveLight ////
@@ -106,12 +106,12 @@ GroveLight::~GroveLight()
 int GroveLight::value ()
 {
     // rough conversion to Lux
-    int a = maa_aio_read_u16(m_aio);
+    int a = maa_aio_read(m_aio);
     a = 10000/(((1023-a)*10/a)*15)^(4/3);
     return a;
 }
 
 float GroveLight::raw_value()
 {
-    return (float) maa_aio_read_u16(m_aio);
+    return (float) maa_aio_read(m_aio);
 }