including : move the '#include' duplicate written to common file 32/160232/2
authorSegwon <segwon.han@samsung.com>
Wed, 15 Nov 2017 02:03:38 +0000 (11:03 +0900)
committerSegwon <segwon.han@samsung.com>
Wed, 15 Nov 2017 06:15:50 +0000 (15:15 +0900)
Change-Id: I5926833c5cef4f5d82bcca78164289562b53c2ca
Signed-off-by: Segwon <segwon.han@samsung.com>
23 files changed:
CMakeLists.txt
include/gdbus/peripheral_gdbus_common.h
include/gdbus/peripheral_gdbus_gpio.h
include/gdbus/peripheral_gdbus_i2c.h
include/gdbus/peripheral_gdbus_pwm.h
include/gdbus/peripheral_gdbus_spi.h
include/gdbus/peripheral_gdbus_uart.h
include/interface/peripheral_interface_common.h
include/interface/peripheral_interface_gpio.h
include/interface/peripheral_interface_i2c.h
include/interface/peripheral_interface_pwm.h
include/interface/peripheral_interface_spi.h
include/interface/peripheral_interface_uart.h
src/gdbus/peripheral_gdbus_gpio.c
src/gdbus/peripheral_gdbus_i2c.c
src/gdbus/peripheral_gdbus_pwm.c
src/gdbus/peripheral_gdbus_spi.c
src/gdbus/peripheral_gdbus_uart.c
src/interface/peripheral_interface_gpio.c
src/interface/peripheral_interface_i2c.c
src/interface/peripheral_interface_pwm.c
src/interface/peripheral_interface_spi.c
src/interface/peripheral_interface_uart.c

index 9b17fa7..7fd0979 100644 (file)
@@ -30,6 +30,9 @@ INCLUDE_DIRECTORIES(${INC_DIR})
 INCLUDE_DIRECTORIES(${INC_DIR}/gdbus)
 INCLUDE_DIRECTORIES(${INC_DIR}/interface)
 
+SET(SRC_DIR src)
+INCLUDE_DIRECTORIES(${SRC_DIR}/gdbus)
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
 FOREACH(flag ${${fw_name}_CFLAGS})
index 685efdb..9a8450e 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 #ifndef __PERIPHERAL_GDBUS_COMMON_H__
 #define __PERIPHERAL_GDBUS_COMMON_H__
 
 #include <gio/gio.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <gio/gunixfdlist.h>
+
+#include "peripheral_io.h"
+#include "peripheral_internal.h"
+#include "peripheral_common.h"
+#include "peripheral_io_gdbus.h"
 
 #define PERIPHERAL_GDBUS_INTERFACE     "org.tizen.peripheral_io"
 #define PERIPHERAL_GDBUS_GPIO_PATH     "/Org/Tizen/Peripheral_io/Gpio"
index 3fd5307..c63aeba 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __PERIPHERAL_GDBUS_GPIO_H__
 #define __PERIPHERAL_GDBUS_GPIO_H__
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_gpio_open(peripheral_gpio_h gpio);
 int peripheral_gdbus_gpio_close(peripheral_gpio_h gpio);
 
index 0670442..e1b1722 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __PERIPHERAL_GDBUS_I2C_H__
 #define __PERIPHERAL_GDBUS_I2C_H__
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_i2c_open(peripheral_i2c_h i2c, int bus, int address);
 int peripheral_gdbus_i2c_close(peripheral_i2c_h i2c);
 
index 148e938..70a4b02 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __PERIPHERAL_GDBUS_PWM_H__
 #define __PERIPHERAL_GDBUS_PWM_H__
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_pwm_open(peripheral_pwm_h pwm, int chip, int pin);
 int peripheral_gdbus_pwm_close(peripheral_pwm_h pwm);
 
index 8a6ac61..94b2242 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 #ifndef __PERIPHERAL_GDBUS_SPI_H_
 #define __PERIPHERAL_GDBUS_SPI_H_
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_spi_open(peripheral_spi_h spi, int bus, int cs);
 int peripheral_gdbus_spi_close(peripheral_spi_h spi);
 
index 175452c..bf7af68 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 #ifndef __PERIPHERAL_GDBUS_UART_H_
 #define __PERIPHERAL_GDBUS_UART_H_
 
+#include "peripheral_gdbus_common.h"
+
 int peripheral_gdbus_uart_open(peripheral_uart_h uart, int port);
 int peripheral_gdbus_uart_close(peripheral_uart_h uart);
 
index 33a8d39..a69254e 100644 (file)
 #ifndef __PERIPHERAL_INTERFACE_COMMON_H__
 #define __PERIPHERAL_INTERFACE_COMMON_H__
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "peripheral_io.h"
+#include "peripheral_internal.h"
+#include "peripheral_common.h"
+
 #define CHECK_ERROR(val) \
        do { \
                if (val < 0) { \
index cc68e92..ff3a794 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_GPIO_H__
 #define __PERIPHERAL_INTERFACE_GPIO_H__
 
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 #define SYSFS_GPIO_DIR "/sys/class/gpio"
 #define GPIO_BUFFER_MAX 64
index 41326d6..6e3dc23 100644 (file)
@@ -17,9 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_I2C_H__
 #define __PERIPHERAL_INTERFACE_I2C_H__
 
-#include <stdint.h>
-
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 #define SYSFS_I2C_DIR "/dev/i2c"
 #define I2C_BUFFER_MAX 64
index 0867663..f37b40d 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_PWM_H__
 #define __PERIPHERAL_INTERFACE_PWM_H__
 
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 /**
 * @brief pwm_close() deinit pwm pin.
index d7a471d..801c324 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_SPI_H__
 #define __PERIPHERAL_INTERFACE_SPI_H__
 
-#include "peripheral_io.h"
+#include "peripheral_interface_common.h"
 
 int peripheral_interface_spi_close(peripheral_spi_h spi);
 int peripheral_interface_spi_set_mode(peripheral_spi_h spi, peripheral_spi_mode_e mode);
index 4648ae1..c4c82ec 100644 (file)
@@ -17,9 +17,7 @@
 #ifndef __PERIPHERAL_INTERFACE_UART_H__
 #define __PERIPHERAL_INTERFACE_UART_H__
 
-#include "peripheral_io.h"
-
-#include <stdint.h>
+#include "peripheral_interface_common.h"
 
 /**
 * @brief uart_close() closes uart port.
index f5e6b0b..c8a6d8c 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_gpio.h"
 
 #define GPIO_FD_INDEX_DIRECTION 0
 #define GPIO_FD_INDEX_EDGE      1
index 767332b..29ba888 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_i2c.h"
 
 #define I2C_FD_INDEX 0
 
index e9b501b..48ff164 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_pwm.h"
 
 #define PWM_FD_INDEX_PERIOD      0
 #define PWM_FD_INDEX_DUTY_CYCLE  1
index 2d07cd3..fce5a41 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_spi.h"
 
 #define SPI_FD_INDEX 0
 
index 32d7992..852e244 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gio/gunixfdlist.h>
-
-#include "peripheral_io.h"
-#include "peripheral_gdbus_common.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
-#include "peripheral_io_gdbus.h"
+#include "peripheral_gdbus_uart.h"
 
 #define UART_FD_INDEX 0
 
index 7d4ef2f..950de19 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_gpio.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define MAX_ERR_LEN 255
 
index fadbf63..87be206 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_i2c.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define MAX_ERR_LEN 255
 
index faefc1a..bbfeefb 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdbool.h>
-
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_pwm.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define SYSFS_PWM_PATH "/sys/class/pwm"
 
index 1c83726..e8a0fc6 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <sys/ioctl.h>
 #include <linux/spi/spidev.h>
 
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_spi.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define SYSFS_SPI_DIR "/dev/spidev"
 #define SYSFS_SPI_BUFSIZ "/sys/module/spidev/parameters/bufsiz"
index a0f9637..4944bb9 100644 (file)
  * limitations under the License.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
 #include <termios.h>
-#include <stdbool.h>
-#include <sys/ioctl.h>
 
-#include "peripheral_interface_common.h"
 #include "peripheral_interface_uart.h"
-#include "peripheral_common.h"
-#include "peripheral_internal.h"
 
 #define PATH_BUF_MAX           64
 #define UART_BUF_MAX           16