/* This API is used to move the data index ahead of the current_frame_length parameter when unnecessary FIFO data appears while extracting the user specified data.  */
static void move_next_frame(uint16_t *data_index, uint8_t current_frame_length, const struct bma4_dev *dev)
/* This API is used to move the data index ahead of the current_frame_length parameter when unnecessary FIFO data appears while extracting the user specified data.  */
static void move_next_frame(uint16_t *data_index, uint8_t current_frame_length, const struct bma4_dev *dev)
{
    if ((*data_index + current_frame_length) > dev->fifo->length) {
        *data_index = dev->fifo->length;
    } else {
        *data_index = *data_index + current_frame_length;
    }
}