devc->id.serno = serno_num;
devc->id.prefix = serno_pre;
devc->id.type = dev_type;
- sr_sw_limits_init(&devc->cfg_limits);
+ sr_sw_limits_init(&devc->limit.config);
devc->capture_ratio = 50;
devc->use_triggers = FALSE;
break;
case SR_CONF_LIMIT_MSEC:
case SR_CONF_LIMIT_SAMPLES:
- return sr_sw_limits_config_get(&devc->cfg_limits, key, data);
+ return sr_sw_limits_config_get(&devc->limit.config, key, data);
#if ASIX_SIGMA_WITH_TRIGGER
case SR_CONF_CAPTURE_RATIO:
*data = g_variant_new_uint64(devc->capture_ratio);
break;
case SR_CONF_LIMIT_MSEC:
case SR_CONF_LIMIT_SAMPLES:
- return sr_sw_limits_config_set(&devc->cfg_limits, key, data);
+ return sr_sw_limits_config_set(&devc->limit.config, key, data);
#if ASIX_SIGMA_WITH_TRIGGER
case SR_CONF_CAPTURE_RATIO:
devc->capture_ratio = g_variant_get_uint64(data);
uint64_t worst_cluster_time_ms;
uint64_t count_msecs, acquire_msecs;
- sr_sw_limits_init(&devc->acq_limits);
+ sr_sw_limits_init(&devc->limit.acquire);
/* Get sample count limit, convert to msecs. */
- ret = sr_sw_limits_config_get(&devc->cfg_limits,
+ ret = sr_sw_limits_config_get(&devc->limit.config,
SR_CONF_LIMIT_SAMPLES, &data);
if (ret != SR_OK)
return ret;
count_msecs = 1000 * user_count / devc->clock.samplerate + 1;
/* Get time limit, which is in msecs. */
- ret = sr_sw_limits_config_get(&devc->cfg_limits,
+ ret = sr_sw_limits_config_get(&devc->limit.config,
SR_CONF_LIMIT_MSEC, &data);
if (ret != SR_OK)
return ret;
worst_cluster_time_ms = 1000 * 65536 / devc->clock.samplerate;
acquire_msecs += 2 * worst_cluster_time_ms;
data = g_variant_new_uint64(acquire_msecs);
- ret = sr_sw_limits_config_set(&devc->acq_limits,
+ ret = sr_sw_limits_config_set(&devc->limit.acquire,
SR_CONF_LIMIT_MSEC, data);
g_variant_unref(data);
if (ret != SR_OK)
return ret;
- sr_sw_limits_acquisition_start(&devc->acq_limits);
+ sr_sw_limits_acquisition_start(&devc->limit.acquire);
return SR_OK;
}
if (!buffer->sample_data)
return SR_ERR_MALLOC;
buffer->write_pointer = buffer->sample_data;
- sr_sw_limits_init(&devc->feed_limits);
+ sr_sw_limits_init(&devc->limit.submit);
buffer->sdi = sdi;
memset(&buffer->logic, 0, sizeof(buffer->logic));
GVariant *data;
uint64_t total;
- limits = &devc->feed_limits;
+ limits = &devc->limit.submit;
- ret = sr_sw_limits_config_get(&devc->cfg_limits,
+ ret = sr_sw_limits_config_get(&devc->limit.config,
SR_CONF_LIMIT_SAMPLES, &data);
if (ret != SR_OK)
return ret;
int ret;
buffer = devc->buffer;
- limits = &devc->feed_limits;
+ limits = &devc->limit.submit;
if (sr_sw_limits_check(limits))
count = 0;
struct dev_context *devc;
devc = sdi->priv;
- if (sr_sw_limits_check(&devc->acq_limits))
+ if (sr_sw_limits_check(&devc->limit.acquire))
return download_capture(sdi);
return TRUE;
size_t clock_pin;
enum ext_clock_edge_t clock_edge;
} clock;
- struct sr_sw_limits cfg_limits; /* Configured limits (user specified). */
- struct sr_sw_limits acq_limits; /* Acquisition limits (internal use). */
- struct sr_sw_limits feed_limits; /* Datafeed limits (internal use). */
+ struct {
+ /*
+ * User specified configuration values, in contrast to
+ * internal arrangement of acquisition, and submission
+ * to the session feed.
+ */
+ struct sr_sw_limits config;
+ struct sr_sw_limits acquire;
+ struct sr_sw_limits submit;
+ } limit;
enum sigma_firmware_idx firmware_idx;
size_t num_channels;
size_t samples_per_event;