mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 22:03:33 +08:00
QuRT and POSIX changes - part 2
Second staged group of changes for QuRT and related POSIX changes Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -60,7 +60,7 @@ struct adc_msg_s
|
||||
|
||||
// Example settings
|
||||
#define ADC_BATTERY_VOLTAGE_CHANNEL 10
|
||||
#define ADC_BATTERY_CURRENT_CHANNEL -1
|
||||
#define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1))
|
||||
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 11
|
||||
#define ADCSIM0_DEVICE_PATH "/dev/adc0"
|
||||
#else
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(__PX4_NUTTX)
|
||||
#include <px4_config.h>
|
||||
#include <nuttx/config.h>
|
||||
#elif defined (__PX4_POSIX) || defined (__PX4_QURT)
|
||||
#define CONFIG_NFILE_STREAMS 1
|
||||
#define CONFIG_SCHED_WORKQUEUE 1
|
||||
|
||||
+18
-5
@@ -117,13 +117,26 @@ inline bool px4_interrupt_context(void) { return false; }
|
||||
inline int I2C_TRANSFER(px4_i2c_dev_t *dev, px4_i2c_msg_t *msg, int count);
|
||||
inline int I2C_TRANSFER(px4_i2c_dev_t *dev, px4_i2c_msg_t *msg, int count) { return 0; }
|
||||
|
||||
struct i2c_msg_s
|
||||
#ifdef __PX4_QURT
|
||||
|
||||
struct i2c_msg
|
||||
{
|
||||
uint16_t addr; /* Slave address */
|
||||
uint16_t flags; /* See I2C_M_* definitions */
|
||||
uint8_t *buffer;
|
||||
int length;
|
||||
uint16_t addr; /* Slave address */
|
||||
uint16_t flags; /* See I2C_M_* definitions */
|
||||
uint8_t *buf;
|
||||
int len;
|
||||
};
|
||||
|
||||
#define I2C_RDWR 0x0FFF
|
||||
|
||||
struct i2c_rdwr_ioctl_data {
|
||||
struct i2c_msg *msgs; /* pointers to i2c_msgs */
|
||||
uint32_t nmsgs; /* number of i2c_msgs */
|
||||
};
|
||||
|
||||
int ioctl(int fd, int flags, unsigned long data);
|
||||
int write(int fd, const char *buffer, int buflen);
|
||||
#endif
|
||||
#else
|
||||
#error "No target platform defined"
|
||||
#endif
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
#include <systemlib/param/param.h>
|
||||
#include <systemlib/systemlib.h>
|
||||
|
||||
#elif defined(__PX4_POSIX)
|
||||
#elif defined(__PX4_POSIX) && !defined(__PX4_QURT)
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <uORB/uORB.h>
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "px4_subscriber.h"
|
||||
#include "px4_publisher.h"
|
||||
#include "px4_middleware.h"
|
||||
#include "px4_posix.h"
|
||||
#include "px4_app.h"
|
||||
|
||||
#if defined(__PX4_ROS)
|
||||
@@ -274,10 +275,10 @@ public:
|
||||
}
|
||||
|
||||
/* Poll fd with smallest interval */
|
||||
struct pollfd pfd;
|
||||
px4_pollfd_struct_t pfd;
|
||||
pfd.fd = _sub_min_interval->getUORBHandle();
|
||||
pfd.events = POLLIN;
|
||||
poll(&pfd, 1, timeout_ms);
|
||||
px4_poll(&pfd, 1, timeout_ms);
|
||||
spinOnce();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user