/* This API is used to parse and store the sensor time from the FIFO data in the structure instance dev.  */
static void unpack_sensortime_frame(uint16_t *data_index, const struct bmi160_dev *dev)
/* This API is used to parse and store the sensor time from the FIFO data in the structure instance dev.  */
static void unpack_sensortime_frame(uint16_t *data_index, const struct bmi160_dev *dev)
{
    uint32_t sensor_time_byte3 = 0;
    uint16_t sensor_time_byte2 = 0;
    uint8_t sensor_time_byte1 = 0;
    if ((*data_index + BMI160_SENSOR_TIME_LENGTH) > dev->fifo->length)
    {
        *data_index = dev->fifo->length;
    }
    else
    {
        sensor_time_byte3 = dev->fifo->data[(*data_index) + BMI160_SENSOR_TIME_MSB_BYTE] << 16;
        sensor_time_byte2 = dev->fifo->data[(*data_index) + BMI160_SENSOR_TIME_XLSB_BYTE] << 8;
        sensor_time_byte1 = dev->fifo->data[(*data_index)];
        dev->fifo->sensor_time = (uint32_t)(sensor_time_byte3 | sensor_time_byte2 | sensor_time_byte1);
        *data_index = (*data_index) + BMI160_SENSOR_TIME_LENGTH;
    }
}