split out magnetometer
This commit is contained in:
@ -203,14 +203,13 @@ int main(void)
|
||||
}
|
||||
LOG_INF("Initialized %s", gyro->name);
|
||||
|
||||
mag = accel; // FIXME: this is a hack while splitting apart BMX055
|
||||
// mag = DEVICE_DT_GET(DT_NODELABEL(bmx055_mag));
|
||||
// if (!device_is_ready(mag))
|
||||
// {
|
||||
// LOG_ERR("Device %s not ready", mag->name);
|
||||
// return 0;
|
||||
// }
|
||||
// LOG_INF("Initialized %s", mag->name);
|
||||
mag = DEVICE_DT_GET(DT_NODELABEL(bmx055_mag));
|
||||
if (!device_is_ready(mag))
|
||||
{
|
||||
LOG_ERR("Device %s not ready", mag->name);
|
||||
return 0;
|
||||
}
|
||||
LOG_INF("Initialized %s", mag->name);
|
||||
|
||||
lis = DEVICE_DT_GET(DT_NODELABEL(lis2dh));
|
||||
if (!device_is_ready(lis))
|
||||
@ -289,10 +288,10 @@ int main(void)
|
||||
LOG_ERR("Could not get gyro");
|
||||
}
|
||||
|
||||
// if (sensor_sample_fetch(mag) < 0)
|
||||
// {
|
||||
// LOG_ERR("Could not fetch sample from mag");
|
||||
// }
|
||||
if (sensor_sample_fetch(mag) < 0)
|
||||
{
|
||||
LOG_ERR("Could not fetch sample from mag");
|
||||
}
|
||||
if (sensor_channel_get(mag, SENSOR_CHAN_MAGN_X, &mag_x) < 0)
|
||||
{
|
||||
LOG_ERR("Could not get mag");
|
||||
|
Reference in New Issue
Block a user