From d6bb8bc1db079b896d41757b8848f225ce4b5957 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Wed, 14 May 2014 14:09:41 +0100 Subject: [PATCH] aio: fix for maa aio API change and make required libmaa version exactly 0.2.3 Signed-off-by: Brendan Le Foll --- CMakeLists.txt | 3 ++- src/grove/grove.cxx | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66b5237e..3ce86eed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "") diff --git a/src/grove/grove.cxx b/src/grove/grove.cxx index 4cb211f2..63f2ecd4 100644 --- a/src/grove/grove.cxx +++ b/src/grove/grove.cxx @@ -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); }