/* Enables ODR CHANGE virtual sensor to be batched in FIFO..  */
int32_t lsm6dso_fifo_virtual_sens_odr_chg_set(stmdev_ctx_t *ctx, uint8_t val)
/* Enables ODR CHANGE virtual sensor to be batched in FIFO..  */
int32_t lsm6dso_fifo_virtual_sens_odr_chg_set(stmdev_ctx_t *ctx, uint8_t val)
{
  lsm6dso_fifo_ctrl2_t reg;
  int32_t ret;
  ret = lsm6dso_read_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)&reg, 1);
  if (ret == 0) {
    reg.odrchg_en = val;
    ret = lsm6dso_write_reg(ctx, LSM6DSO_FIFO_CTRL2, (uint8_t *)&reg, 1);
  }
  return ret;
}