sr_sw_limits_init(&devc->sw_limits);
devc->sw_limits.limit_samples = 0;
devc->capture_ratio = 50;
- devc->cur_samplerate = devc->model->samplerate;
+ devc->samplerate = devc->model->samplerate;
devc->threshold_voltage_idx = LOGIC_THRESHOLD_IDX_DFLT;
if (ARRAY_SIZE(devc->pwm_setting) >= 1) {
devc->pwm_setting[0].enabled = FALSE;
*data = g_variant_new_printf("%d.%d", usb->bus, usb->address);
break;
case SR_CONF_SAMPLERATE:
- *data = g_variant_new_uint64(devc->cur_samplerate);
+ *data = g_variant_new_uint64(devc->samplerate);
break;
case SR_CONF_LIMIT_SAMPLES:
case SR_CONF_LIMIT_MSEC:
switch (key) {
case SR_CONF_SAMPLERATE:
- devc->cur_samplerate = g_variant_get_uint64(data);
+ devc->samplerate = g_variant_get_uint64(data);
break;
case SR_CONF_LIMIT_SAMPLES:
case SR_CONF_LIMIT_MSEC:
devc = sdi->priv;
- if (devc->cur_samplerate > devc->model->samplerate) {
+ if (devc->samplerate > devc->model->samplerate) {
sr_err("Too high a sample rate: %" PRIu64 ".",
- devc->cur_samplerate);
+ devc->samplerate);
return SR_ERR_ARG;
}
min_samplerate = devc->model->samplerate;
min_samplerate /= 65536;
- if (devc->cur_samplerate < min_samplerate) {
+ if (devc->samplerate < min_samplerate) {
sr_err("Too low a sample rate: %" PRIu64 ".",
- devc->cur_samplerate);
+ devc->samplerate);
return SR_ERR_ARG;
}
- divider_u16 = devc->model->samplerate / devc->cur_samplerate;
+ divider_u16 = devc->model->samplerate / devc->samplerate;
eff_samplerate = devc->model->samplerate / divider_u16;
ret = sr_sw_limits_get_remain(&devc->sw_limits,
devc->trigger_marked = TRUE;
sr_dbg("Trigger position after %" PRIu64 " samples, %.6fms.",
devc->total_samples,
- (double)devc->total_samples / devc->cur_samplerate * 1e3);
+ (double)devc->total_samples / devc->samplerate * 1e3);
}
}
}
float duty;
} pwm_setting[LA2016_NUM_PWMCH_MAX];
size_t threshold_voltage_idx;
- uint64_t cur_samplerate;
+ uint64_t samplerate;
struct sr_sw_limits sw_limits;
uint64_t capture_ratio;