static int dev_acquisition_start(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
+ GSList *l;
+ struct sr_channel *ch;
GHashTableIter iter;
void *value;
devc = sdi->priv;
devc->sent_samples = 0;
+ devc->enabled_logic_channels = 0;
+ devc->enabled_analog_channels = 0;
+ for (l = sdi->channels; l; l = l->next) {
+ ch = l->data;
+ if (!ch->enabled)
+ continue;
+ if (ch->type == SR_CHANNEL_ANALOG) {
+ devc->enabled_analog_channels++;
+ continue;
+ }
+ if (ch->type == SR_CHANNEL_LOGIC) {
+ devc->enabled_logic_channels++;
+ continue;
+ }
+ }
+
g_hash_table_iter_init(&iter, devc->ch_ag);
while (g_hash_table_iter_next(&iter, NULL, &value))
demo_generate_analog_pattern(value, devc->cur_samplerate);
todo_us = samples_todo * G_USEC_PER_SEC / devc->cur_samplerate;
logic_done = devc->num_logic_channels > 0 ? 0 : samples_todo;
+ if (!devc->enabled_logic_channels)
+ logic_done = samples_todo;
analog_done = devc->num_analog_channels > 0 ? 0 : samples_todo;
+ if (!devc->enabled_analog_channels)
+ analog_done = samples_todo;
while (logic_done < samples_todo || analog_done < samples_todo) {
/* Logic */
GHashTable *ch_ag;
gboolean avg; /* True if averaging is enabled */
uint64_t avg_samples;
+ size_t enabled_logic_channels;
+ size_t enabled_analog_channels;
};
/* Logic patterns we can generate. */