mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 14:08:45 -04:00
Compass: add dev_id for VRBrain
This commit is contained in:
parent
f42c9579d7
commit
070f1c1bbb
@ -30,6 +30,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <drivers/drv_device.h>
|
||||
#include <drivers/drv_mag.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <stdio.h>
|
||||
@ -56,6 +57,9 @@ bool AP_Compass_VRBRAIN::init(void)
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<_num_instances; i++) {
|
||||
// get device id
|
||||
_dev_id[i] = ioctl(_mag_fd[i], DEVIOCGDEVICEID, 0);
|
||||
|
||||
// average over up to 20 samples
|
||||
if (ioctl(_mag_fd[i], SENSORIOCSQUEUEDEPTH, 20) != 0) {
|
||||
hal.console->printf("Failed to setup compass queue\n");
|
||||
|
Loading…
Reference in New Issue
Block a user