Skip to content

Commit 2a63d6b

Browse files
Kevin TownsendKevin Townsend
authored andcommitted
Added bool return type to getEvent
1 parent cb5610c commit 2a63d6b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Adafruit_LSM9DS0.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void Adafruit_LSM9DS0::setupGyro ( lsm9ds0GyroScale_t scale )
308308
@brief Gets the most recent accel sensor event
309309
*/
310310
/**************************************************************************/
311-
void Adafruit_LSM9DS0::getEvent(sensors_event_t *accelEvent,
311+
bool Adafruit_LSM9DS0::getEvent(sensors_event_t *accelEvent,
312312
sensors_event_t *magEvent,
313313
sensors_event_t *gyroEvent,
314314
sensors_event_t *tempEvent )
@@ -322,6 +322,8 @@ void Adafruit_LSM9DS0::getEvent(sensors_event_t *accelEvent,
322322
if (magEvent) getMagEvent(magEvent, timestamp);
323323
if (gyroEvent) getGyroEvent(gyroEvent, timestamp);
324324
if (tempEvent) getTempEvent(tempEvent, timestamp);
325+
326+
return true;
325327
}
326328

327329
/**************************************************************************/

Adafruit_LSM9DS0.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class Adafruit_LSM9DS0
189189
/* Adafruit Unified Sensor Functions (not standard yet ... the current base class only */
190190
/* supports one sensor type, and we need to update the unified base class to support */
191191
/* multiple sensors in a single driver, returning an array */
192-
void getEvent ( sensors_event_t* accel, sensors_event_t* mag, sensors_event_t* gyro, sensors_event_t* temp );
192+
bool getEvent ( sensors_event_t* accel, sensors_event_t* mag, sensors_event_t* gyro, sensors_event_t* temp );
193193
void getSensor ( sensor_t* accel, sensor_t* mag, sensor_t* gyro, sensor_t* temp );
194194

195195
/* Subclass to expose each sensor on the LSM9DS0 as an Adafruit_Sensor instance. */
@@ -209,7 +209,7 @@ class Adafruit_LSM9DS0
209209
_eventFunc(eventFunc),
210210
_sensorFunc(sensorFunc)
211211
{}
212-
virtual void getEvent(sensors_event_t* event) {
212+
virtual bool getEvent(sensors_event_t* event) {
213213
/* Take new reading. */
214214
(_parent->*_readFunc)();
215215
/* Fill in event data. */

0 commit comments

Comments
 (0)