Skip to content

Commit

Permalink
Updated getEvent to match new bool return value
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Townsend authored and Kevin Townsend committed Mar 9, 2015
1 parent 8cea211 commit 82e856d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Adafruit_ADXL345_U.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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;
}

/**************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_ADXL345_U.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 82e856d

Please sign in to comment.