};
#endif
+static void clear_helper(void *priv)
+{
+ struct dev_context *devc;
+
+ devc = priv;
+
+ ftdi_deinit(&devc->ftdic);
+}
+
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, sigma_clear_helper);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
return SR_OK;
}
-SR_PRIV void sigma_clear_helper(void *priv)
-{
- struct dev_context *devc;
-
- devc = priv;
-
- ftdi_deinit(&devc->ftdic);
-}
-
/*
* Configure the FPGA for bitbang mode.
* This sequence is documented in section 2. of the ASIX Sigma programming
struct dev_context *devc);
SR_PRIV int sigma_set_register(uint8_t reg, uint8_t value, struct dev_context *devc);
SR_PRIV int sigma_write_trigger_lut(struct triggerlut *lut, struct dev_context *devc);
-SR_PRIV void sigma_clear_helper(void *priv);
SR_PRIV uint64_t sigma_limit_samples_to_msec(const struct dev_context *devc,
uint64_t limit_samples);
SR_PRIV int sigma_set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate);
return std_scan_complete(di, devices);
}
-static void clear_dev_context(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc;
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, clear_dev_context);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static int dev_open(struct sr_dev_inst *sdi)
return std_scan_complete(di, devices);
}
-static void clear_dev_context(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc;
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, clear_dev_context);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static int dev_open(struct sr_dev_inst *sdi)
return SR_OK;
}
-static void clear_dev_context(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc;
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, clear_dev_context);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
return SR_OK;
}
-static void clear_dev_context(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc;
devc = priv;
g_free(devc->triggersource);
g_slist_free(devc->enabled_channels);
-
}
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, clear_dev_context);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
return std_scan_complete(di, devices);
}
-static void clear_private(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc = priv;
}
}
- return std_dev_clear_with_callback(di, clear_private);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static int dev_open(struct sr_dev_inst *sdi)
return std_scan_complete(di, devices);
}
-static void clear_dev_context(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc;
devc = priv;
- sr_dbg("Device context cleared.");
-
libusb_free_transfer(devc->xfer_in);
libusb_free_transfer(devc->xfer_out);
g_free(devc);
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, &clear_dev_context);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static int dev_open(struct sr_dev_inst *sdi)
return do_scan(LPS_301, di, options);
}
-static void dev_clear_private(struct dev_context *devc)
+static void clear_helper(struct dev_context *devc)
{
int ch_idx;
g_slist_free(devc->channel_status[ch_idx].info);
}
-static int dev_clear_lps301(const struct sr_dev_driver *di)
+static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, (std_dev_clear_callback)dev_clear_private);
+ return std_dev_clear_with_callback(di, (std_dev_clear_callback)clear_helper);
}
static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
.cleanup = std_cleanup,
.scan = scan_lps301,
.dev_list = std_dev_list,
- .dev_clear = dev_clear_lps301,
+ .dev_clear = dev_clear,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list,
return std_scan_complete(di, devices);
}
-/* Destroy the private device context.
- */
-static void clear_dev_context(void *priv)
+static void clear_helper(void *priv)
{
struct dev_context *devc;
sr_err("Cannot clear device context during acquisition!");
return; /* Leak and pray. */
}
- sr_dbg("Device context cleared.");
g_free(devc);
}
-/* Destroy all device instances.
- */
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear_with_callback(di, &clear_dev_context);
+ return std_dev_clear_with_callback(di, clear_helper);
}
/* Drain any pending data from the USB transfer buffers on the device.