/* This internal API sets the filter and/or standby duration settings in the sensor according to the settings selected by the user.  */
static int8_t set_filter_standby_settings(uint8_t desired_settings, const struct bme280_settings *settings, struct bme280_dev *dev)
/* This internal API sets the filter and/or standby duration settings in the sensor according to the settings selected by the user.  */
static int8_t set_filter_standby_settings(uint8_t desired_settings, const struct bme280_settings *settings, struct bme280_dev *dev)
{
    int8_t rslt;
    uint8_t reg_addr = BME280_CONFIG_ADDR;
    uint8_t reg_data;
    rslt = bme280_get_regs(reg_addr, &reg_data, 1, dev);
    if (rslt == BME280_OK)
    {
        if (desired_settings & BME280_FILTER_SEL)
        {
            fill_filter_settings(&reg_data, settings);
        }
        if (desired_settings & BME280_STANDBY_SEL)
        {
            fill_standby_settings(&reg_data, settings);
        }
        rslt = bme280_set_regs(&reg_addr, &reg_data, 1, dev);
    }
    return rslt;
}