From e3b59eb05b2b2d87b4aa1c7de90560585d1d4897 Mon Sep 17 00:00:00 2001 From: "Lay, Kuan Loon" Date: Thu, 21 Apr 2016 18:38:33 +0800 Subject: [PATCH] apds9930: proper close iio device in destructor and update sensor description Proper close iio device in destructor. APDS-9930 is light and proximity sensor from Avago Technologies. This sensor can measure ambient light in lux and proximity distance in 100mm. The library provided is libupm-apds9930.so.0.4.0. The example provided is apds9930-example where this app will print the value of ambient light and proximity in every 1 second. Signed-off-by: Lay, Kuan Loon Signed-off-by: Noel Eck --- src/apds9930/apds9930.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apds9930/apds9930.cxx b/src/apds9930/apds9930.cxx index 8e02df46..4b1084d7 100644 --- a/src/apds9930/apds9930.cxx +++ b/src/apds9930/apds9930.cxx @@ -41,7 +41,8 @@ APDS9930::APDS9930(int device) APDS9930::~APDS9930() { - // mraa_iio_stop(m_iio); + if(m_iio) + mraa_iio_close(m_iio); } int