mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 20:53:34 +08:00
delete baro_report (alias for sensor_baro_s)
This commit is contained in:
committed by
Lorenz Meier
parent
85c2b6307c
commit
571364c617
@@ -202,7 +202,7 @@ BMP280::init()
|
||||
}
|
||||
|
||||
/* allocate basic report buffers */
|
||||
_reports = new ringbuffer::RingBuffer(2, sizeof(baro_report));
|
||||
_reports = new ringbuffer::RingBuffer(2, sizeof(sensor_baro_s));
|
||||
|
||||
if (_reports == nullptr) {
|
||||
PX4_ERR("can't get memory for reports");
|
||||
@@ -249,7 +249,7 @@ BMP280::init()
|
||||
_fcal.p9 = _cal->p9 * powf(2, -35);
|
||||
|
||||
/* do a first measurement cycle to populate reports with valid data */
|
||||
struct baro_report brp;
|
||||
sensor_baro_s brp;
|
||||
_reports->flush();
|
||||
|
||||
if (measure()) {
|
||||
@@ -279,8 +279,8 @@ BMP280::init()
|
||||
ssize_t
|
||||
BMP280::read(struct file *filp, char *buffer, size_t buflen)
|
||||
{
|
||||
unsigned count = buflen / sizeof(struct baro_report);
|
||||
struct baro_report *brp = reinterpret_cast<struct baro_report *>(buffer);
|
||||
unsigned count = buflen / sizeof(sensor_baro_s);
|
||||
sensor_baro_s *brp = reinterpret_cast<sensor_baro_s *>(buffer);
|
||||
int ret = 0;
|
||||
|
||||
/* buffer must be large enough */
|
||||
@@ -497,7 +497,7 @@ BMP280::collect()
|
||||
|
||||
perf_begin(_sample_perf);
|
||||
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
/* this should be fairly close to the end of the conversion, so the best approximation of the time */
|
||||
report.timestamp = hrt_absolute_time();
|
||||
report.error_count = perf_event_count(_comms_errors);
|
||||
@@ -715,7 +715,7 @@ void
|
||||
test(enum BMP280_BUS busid)
|
||||
{
|
||||
struct bmp280_bus_option &bus = find_bus(busid);
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
ssize_t sz;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ int
|
||||
LPS22HB::collect()
|
||||
{
|
||||
perf_begin(_sample_perf);
|
||||
struct baro_report new_report;
|
||||
sensor_baro_s new_report;
|
||||
|
||||
/* get measurements from the device : MSB enables register address auto-increment */
|
||||
#pragma pack(push, 1)
|
||||
|
||||
@@ -115,7 +115,7 @@ private:
|
||||
perf_counter_t _sample_perf;
|
||||
perf_counter_t _comms_errors;
|
||||
|
||||
baro_report _last_report{}; /**< used for info() */
|
||||
sensor_baro_s _last_report{}; /**< used for info() */
|
||||
|
||||
/**
|
||||
* Initialise the automatic measurement state machine and start it.
|
||||
|
||||
@@ -376,8 +376,8 @@ out:
|
||||
ssize_t
|
||||
LPS25H::read(struct file *filp, char *buffer, size_t buflen)
|
||||
{
|
||||
unsigned count = buflen / sizeof(struct baro_report);
|
||||
struct baro_report *brp = reinterpret_cast<struct baro_report *>(buffer);
|
||||
unsigned count = buflen / sizeof(sensor_baro_s);
|
||||
sensor_baro_s *brp = reinterpret_cast<sensor_baro_s *>(buffer);
|
||||
int ret = 0;
|
||||
|
||||
/* buffer must be large enough */
|
||||
@@ -425,7 +425,7 @@ LPS25H::read(struct file *filp, char *buffer, size_t buflen)
|
||||
}
|
||||
|
||||
if (_reports->get(brp)) {
|
||||
ret = sizeof(struct baro_report);
|
||||
ret = sizeof(sensor_baro_s);
|
||||
}
|
||||
} while (0);
|
||||
|
||||
@@ -658,7 +658,7 @@ LPS25H::collect()
|
||||
int ret;
|
||||
|
||||
perf_begin(_sample_perf);
|
||||
struct baro_report new_report;
|
||||
sensor_baro_s new_report;
|
||||
bool sensor_is_onboard = false;
|
||||
|
||||
/* this should be fairly close to the end of the measurement, so the best approximation of the time */
|
||||
@@ -889,7 +889,7 @@ void
|
||||
test(enum LPS25H_BUS busid)
|
||||
{
|
||||
struct lps25h_bus_option &bus = find_bus(busid);
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
ssize_t sz;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ MPL3115A2::init()
|
||||
/* register alternate interfaces if we have to */
|
||||
_class_instance = register_class_devname(BARO_BASE_DEVICE_PATH);
|
||||
|
||||
struct baro_report brp;
|
||||
sensor_baro_s brp;
|
||||
_reports->flush();
|
||||
|
||||
while (true) {
|
||||
@@ -323,8 +323,8 @@ out:
|
||||
ssize_t
|
||||
MPL3115A2::read(struct file *filp, char *buffer, size_t buflen)
|
||||
{
|
||||
unsigned count = buflen / sizeof(struct baro_report);
|
||||
struct baro_report *brp = reinterpret_cast<struct baro_report *>(buffer);
|
||||
unsigned count = buflen / sizeof(sensor_baro_s);
|
||||
sensor_baro_s *brp = reinterpret_cast<sensor_baro_s *>(buffer);
|
||||
int ret = 0;
|
||||
|
||||
/* buffer must be large enough */
|
||||
@@ -619,7 +619,7 @@ MPL3115A2::collect()
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
|
||||
/* this should be fairly close to the end of the conversion, so the best approximation of the time */
|
||||
report.timestamp = hrt_absolute_time();
|
||||
@@ -820,7 +820,7 @@ void
|
||||
test(enum MPL3115A2_BUS busid)
|
||||
{
|
||||
struct mpl3115a2_bus_option &bus = find_bus(busid);
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
ssize_t sz;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ MS5611::init()
|
||||
/* register alternate interfaces if we have to */
|
||||
_class_instance = register_class_devname(BARO_BASE_DEVICE_PATH);
|
||||
|
||||
struct baro_report brp;
|
||||
sensor_baro_s brp;
|
||||
/* do a first measurement cycle to populate reports with valid data */
|
||||
_measure_phase = 0;
|
||||
_reports->flush();
|
||||
@@ -390,8 +390,8 @@ out:
|
||||
ssize_t
|
||||
MS5611::read(struct file *filp, char *buffer, size_t buflen)
|
||||
{
|
||||
unsigned count = buflen / sizeof(struct baro_report);
|
||||
struct baro_report *brp = reinterpret_cast<struct baro_report *>(buffer);
|
||||
unsigned count = buflen / sizeof(sensor_baro_s);
|
||||
sensor_baro_s *brp = reinterpret_cast<sensor_baro_s *>(buffer);
|
||||
int ret = 0;
|
||||
|
||||
/* buffer must be large enough */
|
||||
@@ -698,7 +698,7 @@ MS5611::collect()
|
||||
|
||||
perf_begin(_sample_perf);
|
||||
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
/* this should be fairly close to the end of the conversion, so the best approximation of the time */
|
||||
report.timestamp = hrt_absolute_time();
|
||||
report.error_count = perf_event_count(_comms_errors);
|
||||
@@ -1023,7 +1023,7 @@ void
|
||||
test(enum MS5611_BUS busid)
|
||||
{
|
||||
struct ms5611_bus_option &bus = find_bus(busid);
|
||||
struct baro_report report;
|
||||
sensor_baro_s report;
|
||||
ssize_t sz;
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -51,6 +51,5 @@
|
||||
#define BARO0_DEVICE_PATH "/dev/baro0"
|
||||
|
||||
#include <uORB/topics/sensor_baro.h>
|
||||
#define baro_report sensor_baro_s
|
||||
|
||||
#endif /* _DRV_BARO_H */
|
||||
|
||||
Reference in New Issue
Block a user