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:
Brendan Le Foll 2014-11-12 15:14:13 +00:00
parent 2ea12da8b8
commit 96a8bf7e06
2 changed files with 6 additions and 7 deletions

View File

@ -83,10 +83,11 @@ TSL2561::~TSL2561()
mraa_i2c_stop(m_i2ControlCtx); mraa_i2c_stop(m_i2ControlCtx);
} }
mraa_result_t int
TSL2561::getLux(int &lux) TSL2561::getLux()
{ {
mraa_result_t error = MRAA_SUCCESS; mraa_result_t error = MRAA_SUCCESS;
int lux;
uint16_t rawLuxCh0; uint16_t rawLuxCh0;
uint16_t rawLuxCh1; uint16_t rawLuxCh1;
uint8_t ch0_low, ch0_high, ch1_low, ch1_high; uint8_t ch0_low, ch0_high, ch1_low, ch1_high;
@ -183,7 +184,7 @@ TSL2561::getLux(int &lux)
// strip off fractional portion // strip off fractional portion
lux = tempLux >> LUX_SCALE; lux = tempLux >> LUX_SCALE;
return error; return lux;
} }

View File

@ -128,11 +128,9 @@ class TSL2561{
/** /**
* Get calculated lux reading from TSL2561 * Get calculated lux reading from TSL2561
* *
* @param lux - place holder to receive calculated lux value from TSL2561 * @return the calculated lux value from the sensor
*
* Return mraa_result_t
*/ */
mraa_result_t getLux(int &lux); int getLux();
private: private:
/** /**