Linux to posix conversion

Changed "linux" target to "posix". Most of the changes are shared with
QuRT and with OSX. The Linux specific parts are in for i2c which uses
<linux/i2c.h> and <linux/i2c-dev.h>.

There is also a check for __PX4_LINUX in mavlink for a tty ioctl that is
not supported.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-04-21 09:53:09 -07:00
parent 40faa98416
commit f3b5076d70
109 changed files with 106 additions and 107 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ MODULE_COMMAND = blinkm
ifeq ($(PX4_TARGET_OS),nuttx)
SRCS = blinkm_nuttx.cpp
else
SRCS = blinkm_linux.cpp
SRCS = blinkm_posix.cpp
endif
MAXOPTIMIZATION = -Os
+1 -1
View File
@@ -35,7 +35,7 @@
#ifdef __PX4_NUTTX
#include "device_nuttx.h"
#elif defined (__PX4_LINUX)
#elif defined (__PX4_POSIX)
#include "vdev.h"
#endif
+1 -1
View File
@@ -35,5 +35,5 @@
#ifdef __PX4_NUTTX
#include "i2c_nuttx.h"
#else
#include "i2c_linux.h"
#include "i2c_posix.h"
#endif
@@ -41,8 +41,10 @@
*/
#include "i2c.h"
#ifdef __PX4_LINUX
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#endif
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -43,8 +43,10 @@
#include "vdev.h"
#include <px4_i2c.h>
#ifdef __PX4_LINUX
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#endif
#include <string>
namespace device __EXPORT
+2 -2
View File
@@ -44,11 +44,11 @@ SRCS = \
spi.cpp \
ringbuffer.cpp
endif
ifeq ($(PX4_TARGET_OS),linux)
ifeq ($(PX4_TARGET_OS),posix)
SRCS = vdev.cpp \
device.cpp \
vdev_posix.cpp \
i2c_linux.cpp \
i2c_posix.cpp \
sim.cpp \
ringbuffer.cpp
endif
+3 -3
View File
@@ -114,14 +114,14 @@
/* no GPIO driver on the PX4_STM32F4DISCOVERY board */
#endif
#ifdef CONFIG_ARCH_BOARD_LINUXTEST
/* no GPIO driver on the LINUXTEST board */
#ifdef CONFIG_ARCH_BOARD_POSIXTEST
/* no GPIO driver on the POSIXTEST board */
#endif
#if !defined(CONFIG_ARCH_BOARD_PX4IO_V1) && !defined(CONFIG_ARCH_BOARD_PX4IO_V2) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V1) && !defined(CONFIG_ARCH_BOARD_PX4FMU_V2) && \
!defined(CONFIG_ARCH_BOARD_AEROCORE) && !defined(CONFIG_ARCH_BOARD_PX4_STM32F4DISCOVERY) && \
!defined(CONFIG_ARCH_BOARD_LINUXTEST)
!defined(CONFIG_ARCH_BOARD_POSIXTEST)
# error No CONFIG_ARCH_BOARD_xxxx set
#endif
/*
+1 -1
View File
@@ -41,6 +41,6 @@ ifeq ($(PX4_TARGET_OS),nuttx)
SRCS = hil.cpp
MAXOPTIMIZATION = -Os
else
SRCS = hil_linux.cpp
SRCS = hil_posix.cpp
endif
+1 -1
View File
@@ -40,7 +40,7 @@ MODULE_COMMAND = ms5611
ifeq ($(PX4_TARGET_OS),nuttx)
SRCS = ms5611_nuttx.cpp ms5611_spi.cpp ms5611_i2c.cpp
else
SRCS = ms5611_linux.cpp ms5611_spi.cpp ms5611_i2c.cpp ms5611_sim.cpp
SRCS = ms5611_posix.cpp ms5611_spi.cpp ms5611_i2c.cpp ms5611_sim.cpp
endif
MAXOPTIMIZATION = -Os
+1 -1
View File
@@ -7,7 +7,7 @@ MODULE_COMMAND = rgbled
ifeq ($(PX4_TARGET_OS),nuttx)
SRCS = rgbled.cpp
else
SRCS = rgbled_linux.cpp
SRCS = rgbled_posix.cpp
endif
MAXOPTIMIZATION = -Os