#define NUM_PROBES 16
SR_PRIV struct sr_dev_driver asix_sigma_driver_info;
-static struct sr_dev_driver *adi = &asix_sigma_driver_info;
+static struct sr_dev_driver *di = &asix_sigma_driver_info;
static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
static const uint64_t supported_samplerates[] = {
struct drv_context *drvc;
struct dev_context *devc;
- drvc = adi->priv;
+ drvc = di->priv;
/* Properly close all devices. */
for (l = drvc->instances; l; l = l->next) {
return SR_OK;
}
-static int hw_init(void)
+static int hw_init(struct sr_context *sr_ctx)
{
struct drv_context *drvc;
sr_err("Driver context malloc failed.");
return SR_ERR_MALLOC;
}
- adi->priv = drvc;
+ drvc->sr_ctx = sr_ctx;
+ di->priv = drvc;
return SR_OK;
}
int ret, i;
(void)options;
- drvc = adi->priv;
+
+ drvc = di->priv;
devices = NULL;
clear_instances();
sr_err("%s: sdi was NULL", __func__);
goto free;
}
- sdi->driver = adi;
+ sdi->driver = di;
for (i = 0; probe_names[i]; i++) {
- if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
+ if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
probe_names[i])))
return NULL;
sdi->probes = g_slist_append(sdi->probes, probe);
{
struct drv_context *drvc;
- drvc = adi->priv;
+ drvc = di->priv;
return drvc->instances;
}
static int hw_cleanup(void)
{
- if (!adi->priv)
+ if (!di->priv)
return SR_OK;
clear_instances();
else
hw_dev_acquisition_stop(sdi, sdi);
- } else if (devc->state.state == SIGMA_DOWNLOAD) {
+ }
+
+ if (devc->state.state == SIGMA_DOWNLOAD) {
if (devc->state.chunks_downloaded >= numchunks) {
/* End of samples. */
packet.type = SR_DF_END;
struct dev_context *devc;
uint8_t modestatus;
- /* Avoid compiler warnings. */
(void)cb_data;
sr_source_remove(0);