sensor-hal: clean up the code and dependency 54/58754/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 3 Feb 2016 07:48:45 +0000 (16:48 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 3 Feb 2016 07:48:45 +0000 (16:48 +0900)
* disable proximity sensor HAL for refactoring
* add macro.h for common macro

Change-Id: I6fa699ca78492f2107484920d519935744d0c4db
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
CMakeLists.txt
src/accel/accel.cpp
src/create.cpp
src/macro.h [new file with mode: 0644]
src/util.cpp
src/util.h

index 7d06cdb..9747230 100644 (file)
@@ -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")
index 2c51cff..55e6302 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/input.h>
 #include <sys/poll.h>
 #include <util.h>
+#include <macro.h>
+#include <sensor_logs.h>
 #include "accel.h"
 
 #define GRAVITY 9.80665
index 761e04e..a442333 100644 (file)
  *
  */
 
-#include <sensor_common.h>
+#include <sensor_hal.h>
+#include <sensor_logs.h>
 
+#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 (file)
index 0000000..5e2ca3e
--- /dev/null
@@ -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
index 434eb80..a8d9d11 100644 (file)
  *
  */
 
+#include <unistd.h>
 #include <dirent.h>
 #include <string.h>
 #include <fstream>
 #include <util.h>
+#include <sensor_logs.h>
 
 using std::ifstream;
 using std::ofstream;
index 77561fd..81488e0 100644 (file)
@@ -21,9 +21,7 @@
 #define _SENSOR_UTIL_H_
 
 #include <sys/time.h>
-#include <sensor_logs.h>
 #include <string>
-#include <sensor_hal.h>
 
 typedef struct {
        int method;