From: Mu-Woong Lee Date: Wed, 3 Feb 2016 07:48:45 +0000 (+0900) Subject: sensor-hal: clean up the code and dependency X-Git-Tag: submit/tizen/20210607.085043~29^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20e5e6d8f1a493a20d68bccfeee34c5de3145b02;p=platform%2Fhal%2Fbackend%2Ftm1%2Fsensor-tm1.git sensor-hal: clean up the code and dependency * disable proximity sensor HAL for refactoring * add macro.h for common macro Change-Id: I6fa699ca78492f2107484920d519935744d0c4db Signed-off-by: kibak.yoon Signed-off-by: Mu-Woong Lee --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d06cdb..9747230 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ INCLUDE(GNUInstallDirs) SET(ACCEL "ON") SET(GYRO "OFF") -SET(PROXIMITY "ON") +SET(PROXIMITY "OFF") SET(LIGHT "OFF") SET(MAGNETIC "OFF") SET(PRESSURE "OFF") diff --git a/src/accel/accel.cpp b/src/accel/accel.cpp index 2c51cff..55e6302 100644 --- a/src/accel/accel.cpp +++ b/src/accel/accel.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "accel.h" #define GRAVITY 9.80665 diff --git a/src/create.cpp b/src/create.cpp index 761e04e..a442333 100644 --- a/src/create.cpp +++ b/src/create.cpp @@ -17,12 +17,17 @@ * */ -#include +#include +#include +#ifdef ENABLE_ACCEL #include "accel/accel.h" +#endif //#include "gyro/gyro_sensor_device.h" //#include "magnetic/geo_sensor_device.h" +#ifdef ENABLE_PROXIMITY #include "proximity/proxi.h" +#endif //#include "light/light_sensor_device.h" //#include "rotation_vector/rv_raw_sensor_device.h" //#include "pressure/pressure_sensor_device.h" diff --git a/src/macro.h b/src/macro.h new file mode 100644 index 0000000..5e2ca3e --- /dev/null +++ b/src/macro.h @@ -0,0 +1,26 @@ +/* + * libsensord-share + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef __MACRO_H__ +#define __MACRO_H__ + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +#endif /* __MACRO_H__ */ +//! End of a file diff --git a/src/util.cpp b/src/util.cpp index 434eb80..a8d9d11 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -17,10 +17,12 @@ * */ +#include #include #include #include #include +#include using std::ifstream; using std::ofstream; diff --git a/src/util.h b/src/util.h index 77561fd..81488e0 100644 --- a/src/util.h +++ b/src/util.h @@ -21,9 +21,7 @@ #define _SENSOR_UTIL_H_ #include -#include #include -#include typedef struct { int method;