/* This API computes the number of bytes of Mag FIFO data which is to be parsed in header-less mode.  */
static void get_mag_len_to_parse(uint16_t *start_idx, uint16_t *len, const uint16_t *mag_count, const struct bma4_dev *dev)
/* This API computes the number of bytes of Mag FIFO data which is to be parsed in header-less mode.  */
static void get_mag_len_to_parse(uint16_t *start_idx, uint16_t *len, const uint16_t *mag_count, const struct bma4_dev *dev)
{
    uint8_t dummy_byte_spi = 0;
    if (dev->fifo->mag_byte_start_idx == 0)
        dummy_byte_spi = dev->dummy_byte;
    *start_idx = dev->fifo->mag_byte_start_idx + dummy_byte_spi;
    if (dev->fifo->fifo_data_enable == BMA4_FIFO_M_ENABLE) {
        *len = (uint16_t)(((*mag_count) * BMA4_FIFO_M_LENGTH) + dummy_byte_spi);
    } else if (dev->fifo->fifo_data_enable == BMA4_FIFO_M_A_ENABLE) {
        *len = (uint16_t)(((*mag_count) * BMA4_FIFO_MA_LENGTH) + dummy_byte_spi);
    } else {
        *start_idx = dev->fifo->length;
    }
    if ((*len) > dev->fifo->length) {
        *len = dev->fifo->length;
    }
}