mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
mpu9150: throw exception(s) on fatal errors
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
9c4a4d0ff0
commit
f6ab1fb451
@ -49,7 +49,8 @@ bool MPU9150::init()
|
|||||||
// init the gyro/accel component
|
// init the gyro/accel component
|
||||||
if (!MPU60X0::init())
|
if (!MPU60X0::init())
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": Unable to init MPU60X0" << endl;
|
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||||
|
": Unable to init MPU60X0");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +58,8 @@ bool MPU9150::init()
|
|||||||
// will allow us to access the AK8975 Magnetometer on I2C addr 0x0c.
|
// will allow us to access the AK8975 Magnetometer on I2C addr 0x0c.
|
||||||
if (!enableI2CBypass(true))
|
if (!enableI2CBypass(true))
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": Unable to enable I2C bypass" << endl;
|
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||||
|
": Unable to enable I2C bypass");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +69,8 @@ bool MPU9150::init()
|
|||||||
|
|
||||||
if (!m_mag->init())
|
if (!m_mag->init())
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": Unable to init magnetometer" << endl;
|
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||||
|
": Unable to init magnetometer");
|
||||||
delete m_mag;
|
delete m_mag;
|
||||||
m_mag = 0;
|
m_mag = 0;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user