mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00
tsl2561: change getLux calls to return an int
To follow with our simple API requirements, change the return value of getLux() call to an int. This lets SWIG do a better job with generating an API Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
parent
2ea12da8b8
commit
96a8bf7e06
@ -83,10 +83,11 @@ TSL2561::~TSL2561()
|
||||
mraa_i2c_stop(m_i2ControlCtx);
|
||||
}
|
||||
|
||||
mraa_result_t
|
||||
TSL2561::getLux(int &lux)
|
||||
int
|
||||
TSL2561::getLux()
|
||||
{
|
||||
mraa_result_t error = MRAA_SUCCESS;
|
||||
int lux;
|
||||
uint16_t rawLuxCh0;
|
||||
uint16_t rawLuxCh1;
|
||||
uint8_t ch0_low, ch0_high, ch1_low, ch1_high;
|
||||
@ -183,7 +184,7 @@ TSL2561::getLux(int &lux)
|
||||
// strip off fractional portion
|
||||
lux = tempLux >> LUX_SCALE;
|
||||
|
||||
return error;
|
||||
return lux;
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,11 +128,9 @@ class TSL2561{
|
||||
/**
|
||||
* Get calculated lux reading from TSL2561
|
||||
*
|
||||
* @param lux - place holder to receive calculated lux value from TSL2561
|
||||
*
|
||||
* Return mraa_result_t
|
||||
* @return the calculated lux value from the sensor
|
||||
*/
|
||||
mraa_result_t getLux(int &lux);
|
||||
int getLux();
|
||||
|
||||
private:
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user