static void clear_helper(void *priv)
{
struct dev_context *devc;
-
+
devc = priv;
ftdi_deinit(&devc->ftdic);
}
-static int clear_instances(void)
+static int dev_clear(void)
{
return std_dev_clear(di, clear_helper);
}
static int init(struct sr_context *sr_ctx)
{
- return std_hw_init(sr_ctx, di, LOG_PREFIX);
+ return std_init(sr_ctx, di, LOG_PREFIX);
}
static GSList *scan(GSList *options)
{
struct sr_dev_inst *sdi;
- struct sr_probe *probe;
+ struct sr_channel *probe;
struct drv_context *drvc;
struct dev_context *devc;
GSList *devices;
static int configure_probes(const struct sr_dev_inst *sdi)
{
struct dev_context *devc = sdi->priv;
- const struct sr_probe *probe;
+ const struct sr_channel *probe;
const GSList *l;
int trigger_set = 0;
int probebit;
memset(&devc->trigger, 0, sizeof(struct sigma_trigger));
for (l = sdi->probes; l; l = l->next) {
- probe = (struct sr_probe *)l->data;
+ probe = (struct sr_channel *)l->data;
probebit = 1 << (probe->index);
if (!probe->enabled || !probe->trigger)
static int cleanup(void)
{
- return clear_instances();
+ return dev_clear();
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *cg)
{
struct dev_context *devc;
+ (void)cg;
+
switch (id) {
case SR_CONF_SAMPLERATE:
if (sdi) {
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *cg)
{
struct dev_context *devc;
int ret;
+ (void)cg;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *cg)
{
GVariant *gvar;
GVariantBuilder gvb;
(void)sdi;
+ (void)cg;
switch (key) {
case SR_CONF_DEVICE_OPTIONS:
/* Find first ts. */
if (devc->state.chunks_downloaded == 0) {
- devc->state.lastts = *(uint16_t *) buf - 1;
+ devc->state.lastts = RL16(buf) - 1;
devc->state.lastsample = 0;
}
.cleanup = cleanup,
.scan = scan,
.dev_list = dev_list,
- .dev_clear = clear_instances,
+ .dev_clear = dev_clear,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list,