commit 55e2f6d1a857d9524c1cfa886280c04aa15430ed
Author: Jan Hoffmann <jan@hfmn.pl>
Date:   Thu Jan 10 14:50:07 2019 +0100

    doxygen + travis + fixes

diff --git a/Adafruit_BNO055.cpp b/Adafruit_BNO055.cpp
index 36820b0..ab2c95c 100644
--- a/Adafruit_BNO055.cpp
+++ b/Adafruit_BNO055.cpp
@@ -18,13 +18,13 @@
  ***************************************************************************/
 
 #if ARDUINO >= 100
- #include "Arduino.h"
+#include "Arduino.h"
 #else
- #include "WProgram.h"
+#include "WProgram.h"
 #endif
 
-#include <math.h>
 #include <limits.h>
+#include <math.h>
 
 #include "Adafruit_BNO055.h"
 
@@ -35,10 +35,11 @@
 /**************************************************************************/
 /*!
     @brief  Instantiates a new Adafruit_BNO055 class
+    @param  sensorID
+    @param  address
 */
 /**************************************************************************/
-Adafruit_BNO055::Adafruit_BNO055(int32_t sensorID, uint8_t address)
-{
+Adafruit_BNO055::Adafruit_BNO055(int32_t sensorID, uint8_t address) {
   _sensorID = sensorID;
   _address = address;
 }
@@ -50,10 +51,11 @@ Adafruit_BNO055::Adafruit_BNO055(int32_t sensorID, uint8_t address)
 /**************************************************************************/
 /*!
     @brief  Sets up the HW
+    @param  mode
+    @return true if process is sucessfull
 */
 /**************************************************************************/
-bool Adafruit_BNO055::begin(adafruit_bno055_opmode_t mode)
-{
+bool Adafruit_BNO055::begin(adafruit_bno055_opmode_t mode) {
   /* Enable I2C */
   Wire.begin();
 
@@ -64,12 +66,11 @@ bool Adafruit_BNO055::begin(adafruit_bno055_opmode_t mode)
 
   /* Make sure we have the right device */
   uint8_t id = read8(BNO055_CHIP_ID_ADDR);
-  if(id != BNO055_ID)
-  {
+  if (id != BNO055_ID) {
     delay(1000); // hold on for boot
     id = read8(BNO055_CHIP_ID_ADDR);
-    if(id != BNO055_ID) {
-      return false;  // still not? ok bail
+    if (id != BNO055_ID) {
+      return false; // still not? ok bail
     }
   }
 
@@ -78,8 +79,7 @@ bool Adafruit_BNO055::begin(adafruit_bno055_opmode_t mode)
 
   /* Reset */
   write8(BNO055_SYS_TRIGGER_ADDR, 0x20);
-  while (read8(BNO055_CHIP_ID_ADDR) != BNO055_ID)
-  {
+  while (read8(BNO055_CHIP_ID_ADDR) != BNO055_ID) {
     delay(10);
   }
   delay(50);
@@ -120,10 +120,10 @@ bool Adafruit_BNO055::begin(adafruit_bno055_opmode_t mode)
 /**************************************************************************/
 /*!
     @brief  Puts the chip in the specified operating mode
+    @param  mode
 */
 /**************************************************************************/
-void Adafruit_BNO055::setMode(adafruit_bno055_opmode_t mode)
-{
+void Adafruit_BNO055::setMode(adafruit_bno055_opmode_t mode) {
   _mode = mode;
   write8(BNO055_OPR_MODE_ADDR, _mode);
   delay(30);
@@ -132,10 +132,11 @@ void Adafruit_BNO055::setMode(adafruit_bno055_opmode_t mode)
 /**************************************************************************/
 /*!
     @brief  Changes the chip's axis remap
+    @param  remapcode
 */
 /**************************************************************************/
-void Adafruit_BNO055::setAxisRemap( adafruit_bno055_axis_remap_config_t remapcode )
-{
+void Adafruit_BNO055::setAxisRemap(
+    adafruit_bno055_axis_remap_config_t remapcode) {
   adafruit_bno055_opmode_t modeback = _mode;
 
   setMode(OPERATION_MODE_CONFIG);
@@ -150,10 +151,10 @@ void Adafruit_BNO055::setAxisRemap( adafruit_bno055_axis_remap_config_t remapcod
 /**************************************************************************/
 /*!
     @brief  Changes the chip's axis signs
+    @param  remapsign
 */
 /**************************************************************************/
-void Adafruit_BNO055::setAxisSign( adafruit_bno055_axis_remap_sign_t remapsign )
-{
+void Adafruit_BNO055::setAxisSign(adafruit_bno055_axis_remap_sign_t remapsign) {
   adafruit_bno055_opmode_t modeback = _mode;
 
   setMode(OPERATION_MODE_CONFIG);
@@ -165,14 +166,13 @@ void Adafruit_BNO055::setAxisSign( adafruit_bno055_axis_remap_sign_t remapsign )
   delay(20);
 }
 
-
 /**************************************************************************/
 /*!
     @brief  Use the external 32.768KHz crystal
+    @param  usextal boolean
 */
 /**************************************************************************/
-void Adafruit_BNO055::setExtCrystalUse(boolean usextal)
-{
+void Adafruit_BNO055::setExtCrystalUse(boolean usextal) {
   adafruit_bno055_opmode_t modeback = _mode;
 
   /* Switch to config mode (just in case since this is the default) */
@@ -190,14 +190,17 @@ void Adafruit_BNO055::setExtCrystalUse(boolean usextal)
   delay(20);
 }
 
-
 /**************************************************************************/
 /*!
     @brief  Gets the latest system status info
+    @param  system_status
+    @param  self_test_result
+    @param  system_error
 */
 /**************************************************************************/
-void Adafruit_BNO055::getSystemStatus(uint8_t *system_status, uint8_t *self_test_result, uint8_t *system_error)
-{
+void Adafruit_BNO055::getSystemStatus(uint8_t *system_status,
+                                      uint8_t *self_test_result,
+                                      uint8_t *system_error) {
   write8(BNO055_PAGE_ID_ADDR, 0);
 
   /* System Status (see section 4.3.58)
@@ -211,7 +214,7 @@ void Adafruit_BNO055::getSystemStatus(uint8_t *system_status, uint8_t *self_test
      6 = System running without fusion algorithms */
 
   if (system_status != 0)
-    *system_status    = read8(BNO055_SYS_STAT_ADDR);
+    *system_status = read8(BNO055_SYS_STAT_ADDR);
 
   /* Self Test Results (see section )
      --------------------------------
@@ -242,7 +245,7 @@ void Adafruit_BNO055::getSystemStatus(uint8_t *system_status, uint8_t *self_test
      A = Sensor configuration error */
 
   if (system_error != 0)
-    *system_error     = read8(BNO055_SYS_ERR_ADDR);
+    *system_error = read8(BNO055_SYS_ERR_ADDR);
 
   delay(200);
 }
@@ -252,8 +255,7 @@ void Adafruit_BNO055::getSystemStatus(uint8_t *system_status, uint8_t *self_test
     @brief  Gets the chip revision numbers
 */
 /**************************************************************************/
-void Adafruit_BNO055::getRevInfo(adafruit_bno055_rev_info_t* info)
-{
+void Adafruit_BNO055::getRevInfo(adafruit_bno055_rev_info_t *info) {
   uint8_t a, b;
 
   memset(info, 0, sizeof(adafruit_bno055_rev_info_t));
@@ -262,13 +264,13 @@ void Adafruit_BNO055::getRevInfo(adafruit_bno055_rev_info_t* info)
   info->accel_rev = read8(BNO055_ACCEL_REV_ID_ADDR);
 
   /* Check the magnetometer revision */
-  info->mag_rev   = read8(BNO055_MAG_REV_ID_ADDR);
+  info->mag_rev = read8(BNO055_MAG_REV_ID_ADDR);
 
   /* Check the gyroscope revision */
-  info->gyro_rev  = read8(BNO055_GYRO_REV_ID_ADDR);
+  info->gyro_rev = read8(BNO055_GYRO_REV_ID_ADDR);
 
   /* Check the SW revision */
-  info->bl_rev    = read8(BNO055_BL_REV_ID_ADDR);
+  info->bl_rev = read8(BNO055_BL_REV_ID_ADDR);
 
   a = read8(BNO055_SW_REV_ID_LSB_ADDR);
   b = read8(BNO055_SW_REV_ID_MSB_ADDR);
@@ -280,9 +282,14 @@ void Adafruit_BNO055::getRevInfo(adafruit_bno055_rev_info_t* info)
     @brief  Gets current calibration state.  Each value should be a uint8_t
             pointer and it will be set to 0 if not calibrated and 3 if
             fully calibrated.
+    @param  sys
+    @param  gyro
+    @param  accel
+    @param  mag
 */
 /**************************************************************************/
-void Adafruit_BNO055::getCalibration(uint8_t* sys, uint8_t* gyro, uint8_t* accel, uint8_t* mag) {
+void Adafruit_BNO055::getCalibration(uint8_t *sys, uint8_t *gyro,
+                                     uint8_t *accel, uint8_t *mag) {
   uint8_t calData = read8(BNO055_CALIB_STAT_ADDR);
   if (sys != NULL) {
     *sys = (calData >> 6) & 0x03;
@@ -301,24 +308,25 @@ void Adafruit_BNO055::getCalibration(uint8_t* sys, uint8_t* gyro, uint8_t* accel
 /**************************************************************************/
 /*!
     @brief  Gets the temperature in degrees celsius
+    @return temperature in degrees celsius
 */
 /**************************************************************************/
-int8_t Adafruit_BNO055::getTemp(void)
-{
+int8_t Adafruit_BNO055::getTemp() {
   int8_t temp = (int8_t)(read8(BNO055_TEMP_ADDR));
   return temp;
 }
 
 /**************************************************************************/
 /*!
-    @brief  Gets a vector reading from the specified source
+    @brief   Gets a vector reading from the specified source
+    @param   vector_type
+    @return  vector from specified source
 */
 /**************************************************************************/
-imu::Vector<3> Adafruit_BNO055::getVector(adafruit_vector_type_t vector_type)
-{
+imu::Vector<3> Adafruit_BNO055::getVector(adafruit_vector_type_t vector_type) {
   imu::Vector<3> xyz;
   uint8_t buffer[6];
-  memset (buffer, 0, 6);
+  memset(buffer, 0, 6);
 
   int16_t x, y, z;
   x = y = z = 0;
@@ -332,34 +340,33 @@ imu::Vector<3> Adafruit_BNO055::getVector(adafruit_vector_type_t vector_type)
 
   /* Convert the value to an appropriate range (section 3.6.4) */
   /* and assign the value to the Vector type */
-  switch(vector_type)
-  {
-    case VECTOR_MAGNETOMETER:
-      /* 1uT = 16 LSB */
-      xyz[0] = ((double)x)/16.0;
-      xyz[1] = ((double)y)/16.0;
-      xyz[2] = ((double)z)/16.0;
-      break;
-    case VECTOR_GYROSCOPE:
-      /* 1dps = 16 LSB */
-      xyz[0] = ((double)x)/16.0;
-      xyz[1] = ((double)y)/16.0;
-      xyz[2] = ((double)z)/16.0;
-      break;
-    case VECTOR_EULER:
-      /* 1 degree = 16 LSB */
-      xyz[0] = ((double)x)/16.0;
-      xyz[1] = ((double)y)/16.0;
-      xyz[2] = ((double)z)/16.0;
-      break;
-    case VECTOR_ACCELEROMETER:
-    case VECTOR_LINEARACCEL:
-    case VECTOR_GRAVITY:
-      /* 1m/s^2 = 100 LSB */
-      xyz[0] = ((double)x)/100.0;
-      xyz[1] = ((double)y)/100.0;
-      xyz[2] = ((double)z)/100.0;
-      break;
+  switch (vector_type) {
+  case VECTOR_MAGNETOMETER:
+    /* 1uT = 16 LSB */
+    xyz[0] = ((double)x) / 16.0;
+    xyz[1] = ((double)y) / 16.0;
+    xyz[2] = ((double)z) / 16.0;
+    break;
+  case VECTOR_GYROSCOPE:
+    /* 1dps = 16 LSB */
+    xyz[0] = ((double)x) / 16.0;
+    xyz[1] = ((double)y) / 16.0;
+    xyz[2] = ((double)z) / 16.0;
+    break;
+  case VECTOR_EULER:
+    /* 1 degree = 16 LSB */
+    xyz[0] = ((double)x) / 16.0;
+    xyz[1] = ((double)y) / 16.0;
+    xyz[2] = ((double)z) / 16.0;
+    break;
+  case VECTOR_ACCELEROMETER:
+  case VECTOR_LINEARACCEL:
+  case VECTOR_GRAVITY:
+    /* 1m/s^2 = 100 LSB */
+    xyz[0] = ((double)x) / 100.0;
+    xyz[1] = ((double)y) / 100.0;
+    xyz[2] = ((double)z) / 100.0;
+    break;
   }
 
   return xyz;
@@ -368,12 +375,12 @@ imu::Vector<3> Adafruit_BNO055::getVector(adafruit_vector_type_t vector_type)
 /**************************************************************************/
 /*!
     @brief  Gets a quaternion reading from the specified source
+    @return quaternion reading
 */
 /**************************************************************************/
-imu::Quaternion Adafruit_BNO055::getQuat(void)
-{
+imu::Quaternion Adafruit_BNO055::getQuat() {
   uint8_t buffer[8];
-  memset (buffer, 0, 8);
+  memset(buffer, 0, 8);
 
   int16_t x, y, z, w;
   x = y = z = w = 0;
@@ -386,9 +393,10 @@ imu::Quaternion Adafruit_BNO055::getQuat(void)
   z = (((uint16_t)buffer[7]) << 8) | ((uint16_t)buffer[6]);
 
   /* Assign to Quaternion */
-  /* See http://ae-bst.resource.bosch.com/media/products/dokumente/bno055/BST_BNO055_DS000_12~1.pdf
+  /* See
+     http://ae-bst.resource.bosch.com/media/products/dokumente/bno055/BST_BNO055_DS000_12~1.pdf
      3.6.5.5 Orientation (Quaternion)  */
-  const double scale = (1.0 / (1<<14));
+  const double scale = (1.0 / (1 << 14));
   imu::Quaternion quat(scale * w, scale * x, scale * y, scale * z);
   return quat;
 }
@@ -396,38 +404,39 @@ imu::Quaternion Adafruit_BNO055::getQuat(void)
 /**************************************************************************/
 /*!
     @brief  Provides the sensor_t data for this sensor
+    @param  sensor
 */
 /**************************************************************************/
-void Adafruit_BNO055::getSensor(sensor_t *sensor)
-{
+void Adafruit_BNO055::getSensor(sensor_t *sensor) {
   /* Clear the sensor_t object */
   memset(sensor, 0, sizeof(sensor_t));
 
   /* Insert the sensor name in the fixed length char array */
-  strncpy (sensor->name, "BNO055", sizeof(sensor->name) - 1);
-  sensor->name[sizeof(sensor->name)- 1] = 0;
-  sensor->version     = 1;
-  sensor->sensor_id   = _sensorID;
-  sensor->type        = SENSOR_TYPE_ORIENTATION;
-  sensor->min_delay   = 0;
-  sensor->max_value   = 0.0F;
-  sensor->min_value   = 0.0F;
-  sensor->resolution  = 0.01F;
+  strncpy(sensor->name, "BNO055", sizeof(sensor->name) - 1);
+  sensor->name[sizeof(sensor->name) - 1] = 0;
+  sensor->version = 1;
+  sensor->sensor_id = _sensorID;
+  sensor->type = SENSOR_TYPE_ORIENTATION;
+  sensor->min_delay = 0;
+  sensor->max_value = 0.0F;
+  sensor->min_value = 0.0F;
+  sensor->resolution = 0.01F;
 }
 
 /**************************************************************************/
 /*!
     @brief  Reads the sensor and returns the data as a sensors_event_t
+    @param  event
+    @return always returns true
 */
 /**************************************************************************/
-bool Adafruit_BNO055::getEvent(sensors_event_t *event)
-{
+bool Adafruit_BNO055::getEvent(sensors_event_t *event) {
   /* Clear the event */
   memset(event, 0, sizeof(sensors_event_t));
 
-  event->version   = sizeof(sensors_event_t);
+  event->version = sizeof(sensors_event_t);
   event->sensor_id = _sensorID;
-  event->type      = SENSOR_TYPE_ORIENTATION;
+  event->type = SENSOR_TYPE_ORIENTATION;
   event->timestamp = millis();
 
   /* Get a Euler angle sample for orientation */
@@ -441,183 +450,194 @@ bool Adafruit_BNO055::getEvent(sensors_event_t *event)
 
 /**************************************************************************/
 /*!
-@brief  Reads the sensor's offset registers into a byte array
+    @brief  Reads the sensor's offset registers into a byte array
+    @param  calibData
+    @return true if read is successful
 */
 /**************************************************************************/
-bool Adafruit_BNO055::getSensorOffsets(uint8_t* calibData)
-{
-    if (isFullyCalibrated())
-    {
-        adafruit_bno055_opmode_t lastMode = _mode;
-        setMode(OPERATION_MODE_CONFIG);
+bool Adafruit_BNO055::getSensorOffsets(uint8_t *calibData) {
+  if (isFullyCalibrated()) {
+    adafruit_bno055_opmode_t lastMode = _mode;
+    setMode(OPERATION_MODE_CONFIG);
 
-        readLen(ACCEL_OFFSET_X_LSB_ADDR, calibData, NUM_BNO055_OFFSET_REGISTERS);
+    readLen(ACCEL_OFFSET_X_LSB_ADDR, calibData, NUM_BNO055_OFFSET_REGISTERS);
 
-        setMode(lastMode);
-        return true;
-    }
-    return false;
+    setMode(lastMode);
+    return true;
+  }
+  return false;
 }
 
 /**************************************************************************/
 /*!
-@brief  Reads the sensor's offset registers into an offset struct
+    @brief  Reads the sensor's offset registers into an offset struct
+    @param  offsets_type
+    @return true if read is successful
 */
 /**************************************************************************/
-bool Adafruit_BNO055::getSensorOffsets(adafruit_bno055_offsets_t &offsets_type)
-{
-    if (isFullyCalibrated())
-    {
-        adafruit_bno055_opmode_t lastMode = _mode;
-        setMode(OPERATION_MODE_CONFIG);
-        delay(25);
-
-        /* Accel offset range depends on the G-range:
-           +/-2g  = +/- 2000 mg
-           +/-4g  = +/- 4000 mg
-           +/-8g  = +/- 8000 mg
-           +/-1§g = +/- 16000 mg */
-        offsets_type.accel_offset_x = (read8(ACCEL_OFFSET_X_MSB_ADDR) << 8) | (read8(ACCEL_OFFSET_X_LSB_ADDR));
-        offsets_type.accel_offset_y = (read8(ACCEL_OFFSET_Y_MSB_ADDR) << 8) | (read8(ACCEL_OFFSET_Y_LSB_ADDR));
-        offsets_type.accel_offset_z = (read8(ACCEL_OFFSET_Z_MSB_ADDR) << 8) | (read8(ACCEL_OFFSET_Z_LSB_ADDR));
-
-        /* Magnetometer offset range = +/- 6400 LSB where 1uT = 16 LSB */
-        offsets_type.mag_offset_x = (read8(MAG_OFFSET_X_MSB_ADDR) << 8) | (read8(MAG_OFFSET_X_LSB_ADDR));
-        offsets_type.mag_offset_y = (read8(MAG_OFFSET_Y_MSB_ADDR) << 8) | (read8(MAG_OFFSET_Y_LSB_ADDR));
-        offsets_type.mag_offset_z = (read8(MAG_OFFSET_Z_MSB_ADDR) << 8) | (read8(MAG_OFFSET_Z_LSB_ADDR));
-
-        /* Gyro offset range depends on the DPS range:
-          2000 dps = +/- 32000 LSB
-          1000 dps = +/- 16000 LSB
-           500 dps = +/- 8000 LSB
-           250 dps = +/- 4000 LSB
-           125 dps = +/- 2000 LSB
-           ... where 1 DPS = 16 LSB */
-        offsets_type.gyro_offset_x = (read8(GYRO_OFFSET_X_MSB_ADDR) << 8) | (read8(GYRO_OFFSET_X_LSB_ADDR));
-        offsets_type.gyro_offset_y = (read8(GYRO_OFFSET_Y_MSB_ADDR) << 8) | (read8(GYRO_OFFSET_Y_LSB_ADDR));
-        offsets_type.gyro_offset_z = (read8(GYRO_OFFSET_Z_MSB_ADDR) << 8) | (read8(GYRO_OFFSET_Z_LSB_ADDR));
-
-        /* Accelerometer radius = +/- 1000 LSB */
-        offsets_type.accel_radius = (read8(ACCEL_RADIUS_MSB_ADDR) << 8) | (read8(ACCEL_RADIUS_LSB_ADDR));
-
-        /* Magnetometer radius = +/- 960 LSB */
-        offsets_type.mag_radius = (read8(MAG_RADIUS_MSB_ADDR) << 8) | (read8(MAG_RADIUS_LSB_ADDR));
-
-        setMode(lastMode);
-        return true;
-    }
-    return false;
-}
+bool Adafruit_BNO055::getSensorOffsets(
+    adafruit_bno055_offsets_t &offsets_type) {
+  if (isFullyCalibrated()) {
+    adafruit_bno055_opmode_t lastMode = _mode;
+    setMode(OPERATION_MODE_CONFIG);
+    delay(25);
+
+    /* Accel offset range depends on the G-range:
+       +/-2g  = +/- 2000 mg
+       +/-4g  = +/- 4000 mg
+       +/-8g  = +/- 8000 mg
+       +/-1§g = +/- 16000 mg */
+    offsets_type.accel_offset_x = (read8(ACCEL_OFFSET_X_MSB_ADDR) << 8) |
+                                  (read8(ACCEL_OFFSET_X_LSB_ADDR));
+    offsets_type.accel_offset_y = (read8(ACCEL_OFFSET_Y_MSB_ADDR) << 8) |
+                                  (read8(ACCEL_OFFSET_Y_LSB_ADDR));
+    offsets_type.accel_offset_z = (read8(ACCEL_OFFSET_Z_MSB_ADDR) << 8) |
+                                  (read8(ACCEL_OFFSET_Z_LSB_ADDR));
+
+    /* Magnetometer offset range = +/- 6400 LSB where 1uT = 16 LSB */
+    offsets_type.mag_offset_x =
+        (read8(MAG_OFFSET_X_MSB_ADDR) << 8) | (read8(MAG_OFFSET_X_LSB_ADDR));
+    offsets_type.mag_offset_y =
+        (read8(MAG_OFFSET_Y_MSB_ADDR) << 8) | (read8(MAG_OFFSET_Y_LSB_ADDR));
+    offsets_type.mag_offset_z =
+        (read8(MAG_OFFSET_Z_MSB_ADDR) << 8) | (read8(MAG_OFFSET_Z_LSB_ADDR));
+
+    /* Gyro offset range depends on the DPS range:
+      2000 dps = +/- 32000 LSB
+      1000 dps = +/- 16000 LSB
+       500 dps = +/- 8000 LSB
+       250 dps = +/- 4000 LSB
+       125 dps = +/- 2000 LSB
+       ... where 1 DPS = 16 LSB */
+    offsets_type.gyro_offset_x =
+        (read8(GYRO_OFFSET_X_MSB_ADDR) << 8) | (read8(GYRO_OFFSET_X_LSB_ADDR));
+    offsets_type.gyro_offset_y =
+        (read8(GYRO_OFFSET_Y_MSB_ADDR) << 8) | (read8(GYRO_OFFSET_Y_LSB_ADDR));
+    offsets_type.gyro_offset_z =
+        (read8(GYRO_OFFSET_Z_MSB_ADDR) << 8) | (read8(GYRO_OFFSET_Z_LSB_ADDR));
+
+    /* Accelerometer radius = +/- 1000 LSB */
+    offsets_type.accel_radius =
+        (read8(ACCEL_RADIUS_MSB_ADDR) << 8) | (read8(ACCEL_RADIUS_LSB_ADDR));
+
+    /* Magnetometer radius = +/- 960 LSB */
+    offsets_type.mag_radius =
+        (read8(MAG_RADIUS_MSB_ADDR) << 8) | (read8(MAG_RADIUS_LSB_ADDR));
 
+    setMode(lastMode);
+    return true;
+  }
+  return false;
+}
 
 /**************************************************************************/
 /*!
-@brief  Writes an array of calibration values to the sensor's offset registers
+  @brief  Writes an array of calibration values to the sensor's offset registers
+  @param  calibData
 */
 /**************************************************************************/
-void Adafruit_BNO055::setSensorOffsets(const uint8_t* calibData)
-{
-    adafruit_bno055_opmode_t lastMode = _mode;
-    setMode(OPERATION_MODE_CONFIG);
-    delay(25);
-
-    /* Note: Configuration will take place only when user writes to the last
-       byte of each config data pair (ex. ACCEL_OFFSET_Z_MSB_ADDR, etc.).
-       Therefore the last byte must be written whenever the user wants to
-       changes the configuration. */
-
-    /* A writeLen() would make this much cleaner */
-    write8(ACCEL_OFFSET_X_LSB_ADDR, calibData[0]);
-    write8(ACCEL_OFFSET_X_MSB_ADDR, calibData[1]);
-    write8(ACCEL_OFFSET_Y_LSB_ADDR, calibData[2]);
-    write8(ACCEL_OFFSET_Y_MSB_ADDR, calibData[3]);
-    write8(ACCEL_OFFSET_Z_LSB_ADDR, calibData[4]);
-    write8(ACCEL_OFFSET_Z_MSB_ADDR, calibData[5]);
-
-    write8(MAG_OFFSET_X_LSB_ADDR, calibData[6]);
-    write8(MAG_OFFSET_X_MSB_ADDR, calibData[7]);
-    write8(MAG_OFFSET_Y_LSB_ADDR, calibData[8]);
-    write8(MAG_OFFSET_Y_MSB_ADDR, calibData[9]);
-    write8(MAG_OFFSET_Z_LSB_ADDR, calibData[10]);
-    write8(MAG_OFFSET_Z_MSB_ADDR, calibData[11]);
-
-    write8(GYRO_OFFSET_X_LSB_ADDR, calibData[12]);
-    write8(GYRO_OFFSET_X_MSB_ADDR, calibData[13]);
-    write8(GYRO_OFFSET_Y_LSB_ADDR, calibData[14]);
-    write8(GYRO_OFFSET_Y_MSB_ADDR, calibData[15]);
-    write8(GYRO_OFFSET_Z_LSB_ADDR, calibData[16]);
-    write8(GYRO_OFFSET_Z_MSB_ADDR, calibData[17]);
-
-    write8(ACCEL_RADIUS_LSB_ADDR, calibData[18]);
-    write8(ACCEL_RADIUS_MSB_ADDR, calibData[19]);
-
-    write8(MAG_RADIUS_LSB_ADDR, calibData[20]);
-    write8(MAG_RADIUS_MSB_ADDR, calibData[21]);
+void Adafruit_BNO055::setSensorOffsets(const uint8_t *calibData) {
+  adafruit_bno055_opmode_t lastMode = _mode;
+  setMode(OPERATION_MODE_CONFIG);
+  delay(25);
 
-    setMode(lastMode);
+  /* Note: Configuration will take place only when user writes to the last
+     byte of each config data pair (ex. ACCEL_OFFSET_Z_MSB_ADDR, etc.).
+     Therefore the last byte must be written whenever the user wants to
+     changes the configuration. */
+
+  /* A writeLen() would make this much cleaner */
+  write8(ACCEL_OFFSET_X_LSB_ADDR, calibData[0]);
+  write8(ACCEL_OFFSET_X_MSB_ADDR, calibData[1]);
+  write8(ACCEL_OFFSET_Y_LSB_ADDR, calibData[2]);
+  write8(ACCEL_OFFSET_Y_MSB_ADDR, calibData[3]);
+  write8(ACCEL_OFFSET_Z_LSB_ADDR, calibData[4]);
+  write8(ACCEL_OFFSET_Z_MSB_ADDR, calibData[5]);
+
+  write8(MAG_OFFSET_X_LSB_ADDR, calibData[6]);
+  write8(MAG_OFFSET_X_MSB_ADDR, calibData[7]);
+  write8(MAG_OFFSET_Y_LSB_ADDR, calibData[8]);
+  write8(MAG_OFFSET_Y_MSB_ADDR, calibData[9]);
+  write8(MAG_OFFSET_Z_LSB_ADDR, calibData[10]);
+  write8(MAG_OFFSET_Z_MSB_ADDR, calibData[11]);
+
+  write8(GYRO_OFFSET_X_LSB_ADDR, calibData[12]);
+  write8(GYRO_OFFSET_X_MSB_ADDR, calibData[13]);
+  write8(GYRO_OFFSET_Y_LSB_ADDR, calibData[14]);
+  write8(GYRO_OFFSET_Y_MSB_ADDR, calibData[15]);
+  write8(GYRO_OFFSET_Z_LSB_ADDR, calibData[16]);
+  write8(GYRO_OFFSET_Z_MSB_ADDR, calibData[17]);
+
+  write8(ACCEL_RADIUS_LSB_ADDR, calibData[18]);
+  write8(ACCEL_RADIUS_MSB_ADDR, calibData[19]);
+
+  write8(MAG_RADIUS_LSB_ADDR, calibData[20]);
+  write8(MAG_RADIUS_MSB_ADDR, calibData[21]);
+
+  setMode(lastMode);
 }
 
 /**************************************************************************/
 /*!
 @brief  Writes to the sensor's offset registers from an offset struct
+@param  offsets_type
 */
 /**************************************************************************/
-void Adafruit_BNO055::setSensorOffsets(const adafruit_bno055_offsets_t &offsets_type)
-{
-    adafruit_bno055_opmode_t lastMode = _mode;
-    setMode(OPERATION_MODE_CONFIG);
-    delay(25);
-
-    /* Note: Configuration will take place only when user writes to the last
-       byte of each config data pair (ex. ACCEL_OFFSET_Z_MSB_ADDR, etc.).
-       Therefore the last byte must be written whenever the user wants to
-       changes the configuration. */
-
-    write8(ACCEL_OFFSET_X_LSB_ADDR, (offsets_type.accel_offset_x) & 0x0FF);
-    write8(ACCEL_OFFSET_X_MSB_ADDR, (offsets_type.accel_offset_x >> 8) & 0x0FF);
-    write8(ACCEL_OFFSET_Y_LSB_ADDR, (offsets_type.accel_offset_y) & 0x0FF);
-    write8(ACCEL_OFFSET_Y_MSB_ADDR, (offsets_type.accel_offset_y >> 8) & 0x0FF);
-    write8(ACCEL_OFFSET_Z_LSB_ADDR, (offsets_type.accel_offset_z) & 0x0FF);
-    write8(ACCEL_OFFSET_Z_MSB_ADDR, (offsets_type.accel_offset_z >> 8) & 0x0FF);
-
-    write8(MAG_OFFSET_X_LSB_ADDR, (offsets_type.mag_offset_x) & 0x0FF);
-    write8(MAG_OFFSET_X_MSB_ADDR, (offsets_type.mag_offset_x >> 8) & 0x0FF);
-    write8(MAG_OFFSET_Y_LSB_ADDR, (offsets_type.mag_offset_y) & 0x0FF);
-    write8(MAG_OFFSET_Y_MSB_ADDR, (offsets_type.mag_offset_y >> 8) & 0x0FF);
-    write8(MAG_OFFSET_Z_LSB_ADDR, (offsets_type.mag_offset_z) & 0x0FF);
-    write8(MAG_OFFSET_Z_MSB_ADDR, (offsets_type.mag_offset_z >> 8) & 0x0FF);
-
-    write8(GYRO_OFFSET_X_LSB_ADDR, (offsets_type.gyro_offset_x) & 0x0FF);
-    write8(GYRO_OFFSET_X_MSB_ADDR, (offsets_type.gyro_offset_x >> 8) & 0x0FF);
-    write8(GYRO_OFFSET_Y_LSB_ADDR, (offsets_type.gyro_offset_y) & 0x0FF);
-    write8(GYRO_OFFSET_Y_MSB_ADDR, (offsets_type.gyro_offset_y >> 8) & 0x0FF);
-    write8(GYRO_OFFSET_Z_LSB_ADDR, (offsets_type.gyro_offset_z) & 0x0FF);
-    write8(GYRO_OFFSET_Z_MSB_ADDR, (offsets_type.gyro_offset_z >> 8) & 0x0FF);
-
-    write8(ACCEL_RADIUS_LSB_ADDR, (offsets_type.accel_radius) & 0x0FF);
-    write8(ACCEL_RADIUS_MSB_ADDR, (offsets_type.accel_radius >> 8) & 0x0FF);
-
-    write8(MAG_RADIUS_LSB_ADDR, (offsets_type.mag_radius) & 0x0FF);
-    write8(MAG_RADIUS_MSB_ADDR, (offsets_type.mag_radius >> 8) & 0x0FF);
+void Adafruit_BNO055::setSensorOffsets(
+    const adafruit_bno055_offsets_t &offsets_type) {
+  adafruit_bno055_opmode_t lastMode = _mode;
+  setMode(OPERATION_MODE_CONFIG);
+  delay(25);
 
-    setMode(lastMode);
+  /* Note: Configuration will take place only when user writes to the last
+     byte of each config data pair (ex. ACCEL_OFFSET_Z_MSB_ADDR, etc.).
+     Therefore the last byte must be written whenever the user wants to
+     changes the configuration. */
+
+  write8(ACCEL_OFFSET_X_LSB_ADDR, (offsets_type.accel_offset_x) & 0x0FF);
+  write8(ACCEL_OFFSET_X_MSB_ADDR, (offsets_type.accel_offset_x >> 8) & 0x0FF);
+  write8(ACCEL_OFFSET_Y_LSB_ADDR, (offsets_type.accel_offset_y) & 0x0FF);
+  write8(ACCEL_OFFSET_Y_MSB_ADDR, (offsets_type.accel_offset_y >> 8) & 0x0FF);
+  write8(ACCEL_OFFSET_Z_LSB_ADDR, (offsets_type.accel_offset_z) & 0x0FF);
+  write8(ACCEL_OFFSET_Z_MSB_ADDR, (offsets_type.accel_offset_z >> 8) & 0x0FF);
+
+  write8(MAG_OFFSET_X_LSB_ADDR, (offsets_type.mag_offset_x) & 0x0FF);
+  write8(MAG_OFFSET_X_MSB_ADDR, (offsets_type.mag_offset_x >> 8) & 0x0FF);
+  write8(MAG_OFFSET_Y_LSB_ADDR, (offsets_type.mag_offset_y) & 0x0FF);
+  write8(MAG_OFFSET_Y_MSB_ADDR, (offsets_type.mag_offset_y >> 8) & 0x0FF);
+  write8(MAG_OFFSET_Z_LSB_ADDR, (offsets_type.mag_offset_z) & 0x0FF);
+  write8(MAG_OFFSET_Z_MSB_ADDR, (offsets_type.mag_offset_z >> 8) & 0x0FF);
+
+  write8(GYRO_OFFSET_X_LSB_ADDR, (offsets_type.gyro_offset_x) & 0x0FF);
+  write8(GYRO_OFFSET_X_MSB_ADDR, (offsets_type.gyro_offset_x >> 8) & 0x0FF);
+  write8(GYRO_OFFSET_Y_LSB_ADDR, (offsets_type.gyro_offset_y) & 0x0FF);
+  write8(GYRO_OFFSET_Y_MSB_ADDR, (offsets_type.gyro_offset_y >> 8) & 0x0FF);
+  write8(GYRO_OFFSET_Z_LSB_ADDR, (offsets_type.gyro_offset_z) & 0x0FF);
+  write8(GYRO_OFFSET_Z_MSB_ADDR, (offsets_type.gyro_offset_z >> 8) & 0x0FF);
+
+  write8(ACCEL_RADIUS_LSB_ADDR, (offsets_type.accel_radius) & 0x0FF);
+  write8(ACCEL_RADIUS_MSB_ADDR, (offsets_type.accel_radius >> 8) & 0x0FF);
+
+  write8(MAG_RADIUS_LSB_ADDR, (offsets_type.mag_radius) & 0x0FF);
+  write8(MAG_RADIUS_MSB_ADDR, (offsets_type.mag_radius >> 8) & 0x0FF);
+
+  setMode(lastMode);
 }
 
 /**************************************************************************/
 /*!
     @brief  Checks of all cal status values are set to 3 (fully calibrated)
+    @return status of calibration
 */
 /**************************************************************************/
-bool Adafruit_BNO055::isFullyCalibrated(void)
-{
-    uint8_t system, gyro, accel, mag;
-    getCalibration(&system, &gyro, &accel, &mag);
-    if (system < 3 || gyro < 3 || accel < 3 || mag < 3)
-        return false;
-    return true;
+bool Adafruit_BNO055::isFullyCalibrated() {
+  uint8_t system, gyro, accel, mag;
+  getCalibration(&system, &gyro, &accel, &mag);
+  if (system < 3 || gyro < 3 || accel < 3 || mag < 3)
+    return false;
+  return true;
 }
 
-
 /***************************************************************************
  PRIVATE FUNCTIONS
  ***************************************************************************/
@@ -627,16 +647,15 @@ bool Adafruit_BNO055::isFullyCalibrated(void)
     @brief  Writes an 8 bit value over I2C
 */
 /**************************************************************************/
-bool Adafruit_BNO055::write8(adafruit_bno055_reg_t reg, byte value)
-{
+bool Adafruit_BNO055::write8(adafruit_bno055_reg_t reg, byte value) {
   Wire.beginTransmission(_address);
-  #if ARDUINO >= 100
-    Wire.write((uint8_t)reg);
-    Wire.write((uint8_t)value);
-  #else
-    Wire.send(reg);
-    Wire.send(value);
-  #endif
+#if ARDUINO >= 100
+  Wire.write((uint8_t)reg);
+  Wire.write((uint8_t)value);
+#else
+  Wire.send(reg);
+  Wire.send(value);
+#endif
   Wire.endTransmission();
 
   /* ToDo: Check for error! */
@@ -648,23 +667,22 @@ bool Adafruit_BNO055::write8(adafruit_bno055_reg_t reg, byte value)
     @brief  Reads an 8 bit value over I2C
 */
 /**************************************************************************/
-byte Adafruit_BNO055::read8(adafruit_bno055_reg_t reg )
-{
+byte Adafruit_BNO055::read8(adafruit_bno055_reg_t reg) {
   byte value = 0;
 
   Wire.beginTransmission(_address);
-  #if ARDUINO >= 100
-    Wire.write((uint8_t)reg);
-  #else
-    Wire.send(reg);
-  #endif
+#if ARDUINO >= 100
+  Wire.write((uint8_t)reg);
+#else
+  Wire.send(reg);
+#endif
   Wire.endTransmission();
   Wire.requestFrom(_address, (byte)1);
-  #if ARDUINO >= 100
-    value = Wire.read();
-  #else
-    value = Wire.receive();
-  #endif
+#if ARDUINO >= 100
+  value = Wire.read();
+#else
+  value = Wire.receive();
+#endif
 
   return value;
 }
@@ -674,24 +692,23 @@ byte Adafruit_BNO055::read8(adafruit_bno055_reg_t reg )
     @brief  Reads the specified number of bytes over I2C
 */
 /**************************************************************************/
-bool Adafruit_BNO055::readLen(adafruit_bno055_reg_t reg, byte * buffer, uint8_t len)
-{
+bool Adafruit_BNO055::readLen(adafruit_bno055_reg_t reg, byte *buffer,
+                              uint8_t len) {
   Wire.beginTransmission(_address);
-  #if ARDUINO >= 100
-    Wire.write((uint8_t)reg);
-  #else
-    Wire.send(reg);
-  #endif
+#if ARDUINO >= 100
+  Wire.write((uint8_t)reg);
+#else
+  Wire.send(reg);
+#endif
   Wire.endTransmission();
   Wire.requestFrom(_address, (byte)len);
 
-  for (uint8_t i = 0; i < len; i++)
-  {
-    #if ARDUINO >= 100
-      buffer[i] = Wire.read();
-    #else
-      buffer[i] = Wire.receive();
-    #endif
+  for (uint8_t i = 0; i < len; i++) {
+#if ARDUINO >= 100
+    buffer[i] = Wire.read();
+#else
+    buffer[i] = Wire.receive();
+#endif
   }
 
   /* ToDo: Check for errors! */
