From 3c3939235cbfb2b1af855b9d411e726a6ce971bf Mon Sep 17 00:00:00 2001 From: Ramasamy Date: Wed, 25 Mar 2015 15:30:59 +0530 Subject: [PATCH] Modifying error/return conditions during fusion sensor initialization - Only failure of accel object initialization will return error - Failure of gyro and magnetic object initialization will print info Change-Id: I6cf67581d4a5fd18d87e418f095a067ceb07841e --- src/fusion/fusion_sensor.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fusion/fusion_sensor.cpp b/src/fusion/fusion_sensor.cpp index fa80416..ae30dea 100755 --- a/src/fusion/fusion_sensor.cpp +++ b/src/fusion/fusion_sensor.cpp @@ -195,12 +195,17 @@ bool fusion_sensor::init(void) m_gyro_sensor = sensor_plugin_loader::get_instance().get_sensor(GYROSCOPE_SENSOR); m_magnetic_sensor = sensor_plugin_loader::get_instance().get_sensor(GEOMAGNETIC_SENSOR); - if (!m_accel_sensor || !m_gyro_sensor || !m_magnetic_sensor) { - ERR("Failed to load sensors, accel: 0x%x, gyro: 0x%x, mag: 0x%x", - m_accel_sensor, m_gyro_sensor, m_magnetic_sensor); + if (!m_accel_sensor) { + ERR("Failed to load accel sensor: 0x%x", m_accel_sensor); return false; } + if (!m_gyro_sensor) + INFO("Failed to load gyro sensor: 0x%x", m_gyro_sensor); + + if (!m_magnetic_sensor) + INFO("Failed to load geomagnetic sensor: 0x%x", m_magnetic_sensor); + INFO("%s is created!", sensor_base::get_name()); return true; } -- 2.7.4