};
static const char *dc_coupling[] = {
- "DC", "DC",
+ "DC",
};
static const char *acdc_coupling[] = {
static int read_channel(const struct sr_dev_inst *sdi, uint32_t amount);
-static int dev_acquisition_stop(struct sr_dev_inst *sdi);
-
static struct sr_dev_inst *hantek_6xxx_dev_new(const struct hantek_6xxx_profile *prof)
{
struct sr_dev_inst *sdi;
*data = g_variant_new("(tt)", vdiv[0], vdiv[1]);
break;
case SR_CONF_COUPLING:
- *data = g_variant_new_string(devc->coupling_vals[devc->coupling[ch_idx]]);
+ *data = g_variant_new_string((devc->coupling[ch_idx] \
+ == COUPLING_DC) ? "DC" : "AC");
break;
}
}
PRIu64 " <= %" PRIu64, devc->limit_samples,
devc->samp_received);
send_data(sdi, devc->sample_buf, devc->limit_samples);
- sdi->driver->dev_acquisition_stop(sdi);
+ sr_dev_acquisition_stop(sdi);
} else if (devc->limit_msec && (g_get_monotonic_time() -
devc->aq_started) / 1000 >= devc->limit_msec) {
sr_info("Requested time limit reached, stopping. %d <= %d",
send_data(sdi, devc->sample_buf, devc->samp_received);
g_free(devc->sample_buf);
devc->sample_buf = NULL;
- sdi->driver->dev_acquisition_stop(sdi);
+ sr_dev_acquisition_stop(sdi);
} else {
read_channel(sdi, data_amount(sdi));
}
struct sr_dev_driver *di = sdi->driver;
struct drv_context *drvc = di->context;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
if (configure_channels(sdi) != SR_OK) {
{
struct dev_context *devc;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR;
-
devc = sdi->priv;
devc->dev_state = STOPPING;
- g_free(devc->sample_buf); devc->sample_buf = NULL;
+ g_free(devc->sample_buf);
+ devc->sample_buf = NULL;
return SR_OK;
}