int num_logic_channels, num_analog_channels, pattern, i;
char channel_name[16];
- drvc = di->priv;
+ drvc = di->context;
num_logic_channels = DEFAULT_NUM_LOGIC_CHANNELS;
num_analog_channels = DEFAULT_NUM_ANALOG_CHANNELS;
static GSList *dev_list(const struct sr_dev_driver *di)
{
- return ((struct drv_context *)(di->priv))->instances;
+ return ((struct drv_context *)(di->context))->instances;
}
static int dev_open(struct sr_dev_inst *sdi)
expected_samplenum = MIN(expected_samplenum, devc->limit_samples);
/* Of those, how many do we still have to send? */
- if (devc->num_logic_channels)
+ if (devc->num_logic_channels && (devc->logic_counter < devc->limit_samples))
logic_todo = expected_samplenum - devc->logic_counter;
- if (devc->num_analog_channels)
+ if (devc->num_analog_channels && (devc->analog_counter < devc->limit_samples))
analog_todo = expected_samplenum - devc->analog_counter;
while (logic_todo || analog_todo) {
g_io_channel_shutdown(devc->channel, FALSE, NULL);
g_io_channel_unref(devc->channel);
devc->channel = NULL;
+ close(devc->pipe_fds[0]);
+ close(devc->pipe_fds[1]);
/* Send last packet. */
packet.type = SR_DF_END;
.dev_close = dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
- .priv = NULL,
+ .context = NULL,
};