From: Segwon Date: Wed, 15 Nov 2017 02:03:38 +0000 (+0900) Subject: including : move the '#include' duplicate written to common file X-Git-Tag: accepted/tizen/unified/20171221.071344~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F160232%2F2;p=platform%2Fcore%2Fapi%2Fperipheral-io.git including : move the '#include' duplicate written to common file Change-Id: I5926833c5cef4f5d82bcca78164289562b53c2ca Signed-off-by: Segwon --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b17fa7..7fd0979 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/include/gdbus/peripheral_gdbus_common.h b/include/gdbus/peripheral_gdbus_common.h index 685efdb..9a8450e 100644 --- a/include/gdbus/peripheral_gdbus_common.h +++ b/include/gdbus/peripheral_gdbus_common.h @@ -13,10 +13,19 @@ * 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 +#include +#include +#include + +#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" diff --git a/include/gdbus/peripheral_gdbus_gpio.h b/include/gdbus/peripheral_gdbus_gpio.h index 3fd5307..c63aeba 100644 --- a/include/gdbus/peripheral_gdbus_gpio.h +++ b/include/gdbus/peripheral_gdbus_gpio.h @@ -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); diff --git a/include/gdbus/peripheral_gdbus_i2c.h b/include/gdbus/peripheral_gdbus_i2c.h index 0670442..e1b1722 100644 --- a/include/gdbus/peripheral_gdbus_i2c.h +++ b/include/gdbus/peripheral_gdbus_i2c.h @@ -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); diff --git a/include/gdbus/peripheral_gdbus_pwm.h b/include/gdbus/peripheral_gdbus_pwm.h index 148e938..70a4b02 100644 --- a/include/gdbus/peripheral_gdbus_pwm.h +++ b/include/gdbus/peripheral_gdbus_pwm.h @@ -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); diff --git a/include/gdbus/peripheral_gdbus_spi.h b/include/gdbus/peripheral_gdbus_spi.h index 8a6ac61..94b2242 100644 --- a/include/gdbus/peripheral_gdbus_spi.h +++ b/include/gdbus/peripheral_gdbus_spi.h @@ -13,9 +13,12 @@ * 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); diff --git a/include/gdbus/peripheral_gdbus_uart.h b/include/gdbus/peripheral_gdbus_uart.h index 175452c..bf7af68 100644 --- a/include/gdbus/peripheral_gdbus_uart.h +++ b/include/gdbus/peripheral_gdbus_uart.h @@ -13,9 +13,12 @@ * 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); diff --git a/include/interface/peripheral_interface_common.h b/include/interface/peripheral_interface_common.h index 33a8d39..a69254e 100644 --- a/include/interface/peripheral_interface_common.h +++ b/include/interface/peripheral_interface_common.h @@ -17,6 +17,17 @@ #ifndef __PERIPHERAL_INTERFACE_COMMON_H__ #define __PERIPHERAL_INTERFACE_COMMON_H__ +#include +#include +#include +#include +#include +#include + +#include "peripheral_io.h" +#include "peripheral_internal.h" +#include "peripheral_common.h" + #define CHECK_ERROR(val) \ do { \ if (val < 0) { \ diff --git a/include/interface/peripheral_interface_gpio.h b/include/interface/peripheral_interface_gpio.h index cc68e92..ff3a794 100644 --- a/include/interface/peripheral_interface_gpio.h +++ b/include/interface/peripheral_interface_gpio.h @@ -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 diff --git a/include/interface/peripheral_interface_i2c.h b/include/interface/peripheral_interface_i2c.h index 41326d6..6e3dc23 100644 --- a/include/interface/peripheral_interface_i2c.h +++ b/include/interface/peripheral_interface_i2c.h @@ -17,9 +17,7 @@ #ifndef __PERIPHERAL_INTERFACE_I2C_H__ #define __PERIPHERAL_INTERFACE_I2C_H__ -#include - -#include "peripheral_io.h" +#include "peripheral_interface_common.h" #define SYSFS_I2C_DIR "/dev/i2c" #define I2C_BUFFER_MAX 64 diff --git a/include/interface/peripheral_interface_pwm.h b/include/interface/peripheral_interface_pwm.h index 0867663..f37b40d 100644 --- a/include/interface/peripheral_interface_pwm.h +++ b/include/interface/peripheral_interface_pwm.h @@ -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. diff --git a/include/interface/peripheral_interface_spi.h b/include/interface/peripheral_interface_spi.h index d7a471d..801c324 100644 --- a/include/interface/peripheral_interface_spi.h +++ b/include/interface/peripheral_interface_spi.h @@ -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); diff --git a/include/interface/peripheral_interface_uart.h b/include/interface/peripheral_interface_uart.h index 4648ae1..c4c82ec 100644 --- a/include/interface/peripheral_interface_uart.h +++ b/include/interface/peripheral_interface_uart.h @@ -17,9 +17,7 @@ #ifndef __PERIPHERAL_INTERFACE_UART_H__ #define __PERIPHERAL_INTERFACE_UART_H__ -#include "peripheral_io.h" - -#include +#include "peripheral_interface_common.h" /** * @brief uart_close() closes uart port. diff --git a/src/gdbus/peripheral_gdbus_gpio.c b/src/gdbus/peripheral_gdbus_gpio.c index f5e6b0b..c8a6d8c 100644 --- a/src/gdbus/peripheral_gdbus_gpio.c +++ b/src/gdbus/peripheral_gdbus_gpio.c @@ -14,15 +14,7 @@ * limitations under the License. */ -#include -#include -#include - -#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 diff --git a/src/gdbus/peripheral_gdbus_i2c.c b/src/gdbus/peripheral_gdbus_i2c.c index 767332b..29ba888 100644 --- a/src/gdbus/peripheral_gdbus_i2c.c +++ b/src/gdbus/peripheral_gdbus_i2c.c @@ -14,15 +14,7 @@ * limitations under the License. */ -#include -#include -#include - -#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 diff --git a/src/gdbus/peripheral_gdbus_pwm.c b/src/gdbus/peripheral_gdbus_pwm.c index e9b501b..48ff164 100644 --- a/src/gdbus/peripheral_gdbus_pwm.c +++ b/src/gdbus/peripheral_gdbus_pwm.c @@ -14,15 +14,7 @@ * limitations under the License. */ -#include -#include -#include - -#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 diff --git a/src/gdbus/peripheral_gdbus_spi.c b/src/gdbus/peripheral_gdbus_spi.c index 2d07cd3..fce5a41 100644 --- a/src/gdbus/peripheral_gdbus_spi.c +++ b/src/gdbus/peripheral_gdbus_spi.c @@ -14,15 +14,7 @@ * limitations under the License. */ -#include -#include -#include - -#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 diff --git a/src/gdbus/peripheral_gdbus_uart.c b/src/gdbus/peripheral_gdbus_uart.c index 32d7992..852e244 100644 --- a/src/gdbus/peripheral_gdbus_uart.c +++ b/src/gdbus/peripheral_gdbus_uart.c @@ -14,15 +14,7 @@ * limitations under the License. */ -#include -#include -#include - -#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 diff --git a/src/interface/peripheral_interface_gpio.c b/src/interface/peripheral_interface_gpio.c index 7d4ef2f..950de19 100644 --- a/src/interface/peripheral_interface_gpio.c +++ b/src/interface/peripheral_interface_gpio.c @@ -14,18 +14,7 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include -#include - -#include "peripheral_interface_common.h" #include "peripheral_interface_gpio.h" -#include "peripheral_common.h" -#include "peripheral_internal.h" #define MAX_ERR_LEN 255 diff --git a/src/interface/peripheral_interface_i2c.c b/src/interface/peripheral_interface_i2c.c index fadbf63..87be206 100644 --- a/src/interface/peripheral_interface_i2c.c +++ b/src/interface/peripheral_interface_i2c.c @@ -14,18 +14,9 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include #include -#include "peripheral_interface_common.h" #include "peripheral_interface_i2c.h" -#include "peripheral_common.h" -#include "peripheral_internal.h" #define MAX_ERR_LEN 255 diff --git a/src/interface/peripheral_interface_pwm.c b/src/interface/peripheral_interface_pwm.c index faefc1a..bbfeefb 100644 --- a/src/interface/peripheral_interface_pwm.c +++ b/src/interface/peripheral_interface_pwm.c @@ -14,18 +14,7 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include -#include - -#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" diff --git a/src/interface/peripheral_interface_spi.c b/src/interface/peripheral_interface_spi.c index 1c83726..e8a0fc6 100644 --- a/src/interface/peripheral_interface_spi.c +++ b/src/interface/peripheral_interface_spi.c @@ -14,19 +14,10 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include #include #include -#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" diff --git a/src/interface/peripheral_interface_uart.c b/src/interface/peripheral_interface_uart.c index a0f9637..4944bb9 100644 --- a/src/interface/peripheral_interface_uart.c +++ b/src/interface/peripheral_interface_uart.c @@ -14,20 +14,9 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include #include -#include -#include -#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