mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
th02: 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
f358b2e16d
commit
26317cbd2a
@ -55,8 +55,8 @@ TH02::getTemperature () {
|
|||||||
|
|
||||||
/* Start a new temperature conversion */
|
/* Start a new temperature conversion */
|
||||||
if (m_i2c.writeReg(TH02_REG_CONFIG, TH02_CMD_MEASURE_TEMP)) {
|
if (m_i2c.writeReg(TH02_REG_CONFIG, TH02_CMD_MEASURE_TEMP)) {
|
||||||
cerr << __FUNCTION__ << "@" << __LINE__
|
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||||
<< ": writeReg failed" << endl;
|
": I2c.writeReg() failed");
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ TH02::getHumidity () {
|
|||||||
|
|
||||||
/* Start a new humidity conversion */
|
/* Start a new humidity conversion */
|
||||||
if (m_i2c.writeReg(TH02_REG_CONFIG, TH02_CMD_MEASURE_HUMI)) {
|
if (m_i2c.writeReg(TH02_REG_CONFIG, TH02_CMD_MEASURE_HUMI)) {
|
||||||
cerr << __FUNCTION__ << "@" << __LINE__
|
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||||
<< ": writeReg failed" << endl;
|
": I2c.writeReg() failed");
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user