mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
lsm9ds0: include stdexcept, remove extraneoous error output
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
3ad25f65c8
commit
b81be93411
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <exception>
|
#include <stdexcept>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "lsm9ds0.h"
|
#include "lsm9ds0.h"
|
||||||
@ -61,9 +61,6 @@ LSM9DS0::LSM9DS0(int bus, uint8_t gAddress, uint8_t xmAddress) :
|
|||||||
mraa_result_t rv;
|
mraa_result_t rv;
|
||||||
if ( (rv = m_i2cG.address(m_gAddr)) != MRAA_SUCCESS)
|
if ( (rv = m_i2cG.address(m_gAddr)) != MRAA_SUCCESS)
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": Could not initialize Gyro i2c address."
|
|
||||||
<< endl;
|
|
||||||
mraa_result_print(rv);
|
|
||||||
throw std::runtime_error(string(__FUNCTION__) +
|
throw std::runtime_error(string(__FUNCTION__) +
|
||||||
": Could not initialize Gyro i2c address");
|
": Could not initialize Gyro i2c address");
|
||||||
return;
|
return;
|
||||||
@ -71,8 +68,6 @@ LSM9DS0::LSM9DS0(int bus, uint8_t gAddress, uint8_t xmAddress) :
|
|||||||
|
|
||||||
if ( (rv = m_i2cXM.address(m_xmAddr)) != MRAA_SUCCESS)
|
if ( (rv = m_i2cXM.address(m_xmAddr)) != MRAA_SUCCESS)
|
||||||
{
|
{
|
||||||
cerr << __FUNCTION__ << ": Could not initialize XM i2c address. " << endl;
|
|
||||||
mraa_result_print(rv);
|
|
||||||
throw std::runtime_error(string(__FUNCTION__) +
|
throw std::runtime_error(string(__FUNCTION__) +
|
||||||
": Could not initialize XM i2c address");
|
": Could not initialize XM i2c address");
|
||||||
return;
|
return;
|
||||||
@ -745,7 +740,7 @@ mraa::Gpio*& LSM9DS0::getPin(INTERRUPT_PINS_T intr)
|
|||||||
return m_gpioXM_GEN2;
|
return m_gpioXM_GEN2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw std::logic_error(string(__FUNCTION__) +
|
throw std::out_of_range(string(__FUNCTION__) +
|
||||||
": Invalid interrupt enum passed");
|
": Invalid interrupt enum passed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user