Added bool return type to getEvent

This commit is contained in:
Kevin Townsend
2015-03-09 09:30:43 +01:00
parent ba1becf7f1
commit ced9f731da
2 changed files with 4 additions and 2 deletions

View File

@ -478,7 +478,7 @@ uint32_t Adafruit_TSL2561_Unified::calculateLux(uint16_t broadband, uint16_t ir)
@brief Gets the most recent sensor event @brief Gets the most recent sensor event
*/ */
/**************************************************************************/ /**************************************************************************/
void Adafruit_TSL2561_Unified::getEvent(sensors_event_t *event) bool Adafruit_TSL2561_Unified::getEvent(sensors_event_t *event)
{ {
uint16_t broadband, ir; uint16_t broadband, ir;
@ -493,6 +493,8 @@ void Adafruit_TSL2561_Unified::getEvent(sensors_event_t *event)
/* Calculate the actual lux value */ /* Calculate the actual lux value */
getLuminosity(&broadband, &ir); getLuminosity(&broadband, &ir);
event->light = calculateLux(broadband, ir); event->light = calculateLux(broadband, ir);
return true;
} }
/**************************************************************************/ /**************************************************************************/

View File

@ -181,7 +181,7 @@ class Adafruit_TSL2561_Unified : public Adafruit_Sensor {
uint32_t calculateLux(uint16_t broadband, uint16_t ir); uint32_t calculateLux(uint16_t broadband, uint16_t ir);
/* Unified Sensor API Functions */ /* Unified Sensor API Functions */
void getEvent(sensors_event_t*); bool getEvent(sensors_event_t*);
void getSensor(sensor_t*); void getSensor(sensor_t*);
private: private: