mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 02:43:34 +08:00
replace mag_report with sensor_mag_s
This commit is contained in:
@@ -104,7 +104,7 @@ HMC5883::init()
|
||||
}
|
||||
|
||||
/* allocate basic report buffers */
|
||||
_reports = new ringbuffer::RingBuffer(2, sizeof(mag_report));
|
||||
_reports = new ringbuffer::RingBuffer(2, sizeof(sensor_mag_s));
|
||||
|
||||
if (_reports == nullptr) {
|
||||
goto out;
|
||||
@@ -243,8 +243,8 @@ void HMC5883::check_conf(void)
|
||||
ssize_t
|
||||
HMC5883::read(cdev::file_t *filp, char *buffer, size_t buflen)
|
||||
{
|
||||
unsigned count = buflen / sizeof(struct mag_report);
|
||||
struct mag_report *mag_buf = reinterpret_cast<struct mag_report *>(buffer);
|
||||
unsigned count = buflen / sizeof(sensor_mag_s);
|
||||
sensor_mag_s *mag_buf = reinterpret_cast<sensor_mag_s *>(buffer);
|
||||
int ret = 0;
|
||||
|
||||
/* buffer must be large enough */
|
||||
@@ -261,7 +261,7 @@ HMC5883::read(cdev::file_t *filp, char *buffer, size_t buflen)
|
||||
*/
|
||||
while (count--) {
|
||||
if (_reports->get(mag_buf)) {
|
||||
ret += sizeof(struct mag_report);
|
||||
ret += sizeof(sensor_mag_s);
|
||||
mag_buf++;
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ HMC5883::read(cdev::file_t *filp, char *buffer, size_t buflen)
|
||||
}
|
||||
|
||||
if (_reports->get(mag_buf)) {
|
||||
ret = sizeof(struct mag_report);
|
||||
ret = sizeof(sensor_mag_s);
|
||||
}
|
||||
} while (0);
|
||||
|
||||
@@ -498,7 +498,7 @@ HMC5883::collect()
|
||||
uint8_t check_counter;
|
||||
|
||||
perf_begin(_sample_perf);
|
||||
struct mag_report new_report;
|
||||
sensor_mag_s new_report;
|
||||
bool sensor_is_onboard = false;
|
||||
|
||||
float xraw_f;
|
||||
|
||||
Reference in New Issue
Block a user