/* Gets a whole set of compass data including data, accuracy and timestamp.  */
void inv_get_compass_set(long *data, int8_t *accuracy, inv_time_t *timestamp)
/* Gets a whole set of compass data including data, accuracy and timestamp.  */
void inv_get_compass_set(long *data, int8_t *accuracy, inv_time_t *timestamp)
{
    memcpy(data, sensors.compass.calibrated, sizeof(sensors.compass.calibrated));
    if (timestamp != NULL) {
        *timestamp = sensors.compass.timestamp;
    }
    if (accuracy != NULL) {
        if (inv_data_builder.compass_disturbance)
            *accuracy = 0;
        else
            *accuracy = sensors.compass.accuracy;
    }
}