mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 16:03:33 +08:00
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:
@@ -35,7 +35,7 @@
|
||||
|
||||
#ifdef __PX4_NUTTX
|
||||
#include "device_nuttx.h"
|
||||
#elif defined (__PX4_LINUX)
|
||||
#elif defined (__PX4_POSIX)
|
||||
#include "vdev.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user