From 82e856d18ead8d32a7f22ebe36a3447565c227ae Mon Sep 17 00:00:00 2001 From: Kevin Townsend Date: Mon, 9 Mar 2015 09:11:32 +0100 Subject: [PATCH] Updated getEvent to match new bool return value --- Adafruit_ADXL345_U.cpp | 4 +++- Adafruit_ADXL345_U.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Adafruit_ADXL345_U.cpp b/Adafruit_ADXL345_U.cpp index 28a4c67..74f7a7f 100644 --- a/Adafruit_ADXL345_U.cpp +++ b/Adafruit_ADXL345_U.cpp @@ -295,7 +295,7 @@ dataRate_t Adafruit_ADXL345_Unified::getDataRate(void) @brief Gets the most recent sensor event */ /**************************************************************************/ -void Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { +bool Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { /* Clear the event */ memset(event, 0, sizeof(sensors_event_t)); @@ -306,6 +306,8 @@ void Adafruit_ADXL345_Unified::getEvent(sensors_event_t *event) { event->acceleration.x = getX() * ADXL345_MG2G_MULTIPLIER * SENSORS_GRAVITY_STANDARD; event->acceleration.y = getY() * ADXL345_MG2G_MULTIPLIER * SENSORS_GRAVITY_STANDARD; event->acceleration.z = getZ() * ADXL345_MG2G_MULTIPLIER * SENSORS_GRAVITY_STANDARD; + + return true; } /**************************************************************************/ diff --git a/Adafruit_ADXL345_U.h b/Adafruit_ADXL345_U.h index 58b0054..8f7da79 100644 --- a/Adafruit_ADXL345_U.h +++ b/Adafruit_ADXL345_U.h @@ -113,7 +113,7 @@ class Adafruit_ADXL345_Unified : public Adafruit_Sensor { range_t getRange(void); void setDataRate(dataRate_t dataRate); dataRate_t getDataRate(void); - void getEvent(sensors_event_t*); + bool getEvent(sensors_event_t*); void getSensor(sensor_t*); uint8_t getDeviceID(void);