split out gyro code
This commit is contained in:
@ -195,14 +195,13 @@ int main(void)
|
||||
}
|
||||
LOG_INF("Initialized %s", accel->name);
|
||||
|
||||
gyro = accel; // FIXME: this is a hack while splitting apart BMX055
|
||||
// gyro = DEVICE_DT_GET(DT_NODELABEL(bmx055_gyro));
|
||||
// if (!device_is_ready(gyro))
|
||||
// {
|
||||
// LOG_ERR("Device %s not ready", gyro->name);
|
||||
// return 0;
|
||||
// }
|
||||
// LOG_INF("Initialized %s", gyro->name);
|
||||
gyro = DEVICE_DT_GET(DT_NODELABEL(bmx055_gyro));
|
||||
if (!device_is_ready(gyro))
|
||||
{
|
||||
LOG_ERR("Device %s not ready", gyro->name);
|
||||
return 0;
|
||||
}
|
||||
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));
|
||||
@ -273,10 +272,10 @@ int main(void)
|
||||
LOG_ERR("Could not get acceleration");
|
||||
}
|
||||
|
||||
// if (sensor_sample_fetch(gyro) < 0)
|
||||
// {
|
||||
// LOG_ERR("Could not fetch sample from gyro");
|
||||
// }
|
||||
if (sensor_sample_fetch(gyro) < 0)
|
||||
{
|
||||
LOG_ERR("Could not fetch sample from gyro");
|
||||
}
|
||||
if (sensor_channel_get(gyro, SENSOR_CHAN_GYRO_X, &gyro_x) < 0)
|
||||
{
|
||||
LOG_ERR("Could not get gyro");
|
||||
@ -352,11 +351,11 @@ int main(void)
|
||||
{
|
||||
LOG_ERR("Failed to print a string");
|
||||
}
|
||||
if (cfb_print(display, str_my, 0, 16))
|
||||
if (cfb_print(display, str_gy, 0, 16))
|
||||
{
|
||||
LOG_ERR("Failed to print a string");
|
||||
}
|
||||
if (cfb_print(display, str_mz, 0, 16 * 2))
|
||||
if (cfb_print(display, str_gz, 0, 16 * 2))
|
||||
{
|
||||
LOG_ERR("Failed to print a string");
|
||||
}
|
||||
|
Reference in New Issue
Block a user