/* DreamSourceLab DSLogic (before FW upload) */
{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
"dreamsourcelab-dslogic-fx2.fw",
- DEV_CAPS_16BIT, NULL, NULL},
+ DEV_CAPS_16BIT | DEV_CAPS_DSLOGIC_FW, NULL, NULL},
/* DreamSourceLab DSLogic (after FW upload) */
{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
"dreamsourcelab-dslogic-fx2.fw",
- DEV_CAPS_16BIT, "DreamSourceLab", "DSLogic"},
+ DEV_CAPS_16BIT | DEV_CAPS_DSLOGIC_FW, "DreamSourceLab", "DSLogic"},
/* DreamSourceLab DSCope (before FW upload) */
{ 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
"dreamsourcelab-dscope-fx2.fw",
- DEV_CAPS_16BIT, NULL, NULL},
+ DEV_CAPS_16BIT | DEV_CAPS_DSLOGIC_FW, NULL, NULL},
/* DreamSourceLab DSCope (after FW upload) */
{ 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
"dreamsourcelab-dscope-fx2.fw",
- DEV_CAPS_16BIT, "DreamSourceLab", "DSCope"},
+ DEV_CAPS_16BIT | DEV_CAPS_DSLOGIC_FW, "DreamSourceLab", "DSCope"},
/* DreamSourceLab DSLogic Pro (before FW upload) */
{ 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
"dreamsourcelab-dslogic-pro-fx2.fw",
- DEV_CAPS_16BIT, NULL, NULL},
+ DEV_CAPS_16BIT | DEV_CAPS_DSLOGIC_FW, NULL, NULL},
/* DreamSourceLab DSLogic Pro (after FW upload) */
{ 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
"dreamsourcelab-dslogic-pro-fx2.fw",
- DEV_CAPS_16BIT, "DreamSourceLab", "DSLogic"},
+ DEV_CAPS_16BIT | DEV_CAPS_DSLOGIC_FW, "DreamSourceLab", "DSLogic"},
/*
* Saleae Logic
devc = fx2lafw_dev_new();
devc->profile = prof;
- if ((prof->dev_caps & DEV_CAPS_16BIT) || (prof->dev_caps & DEV_CAPS_AX_ANALOG))
- devc->sample_wide = TRUE;
sdi->priv = devc;
devices = g_slist_append(devices, sdi);
devc->submitted_transfers++;
}
- if (devc->profile->dev_caps & DEV_CAPS_AX_ANALOG)
+ /*
+ * If this device has analog channels and at least one of them is
+ * enabled, use mso_send_data_proc() to properly handle the analog
+ * data. Otherwise use la_send_data_proc().
+ */
+ if (g_slist_length(devc->enabled_analog_channels) > 0)
devc->send_data_proc = mso_send_data_proc;
else
devc->send_data_proc = la_send_data_proc;
const GSList *l;
int p;
struct sr_channel *ch;
+ uint32_t channel_mask = 0, num_analog = 0;
devc = sdi->priv;
g_slist_free(devc->enabled_analog_channels);
devc->enabled_analog_channels = NULL;
- memset(devc->ch_enabled, 0, sizeof(devc->ch_enabled));
for (l = sdi->channels, p = 0; l; l = l->next, p++) {
ch = l->data;
- if ((p <= NUM_CHANNELS) && (ch->type == SR_CHANNEL_ANALOG)) {
- devc->ch_enabled[p] = ch->enabled;
+ if ((p <= NUM_CHANNELS) && (ch->type == SR_CHANNEL_ANALOG)
+ && (ch->enabled)) {
+ num_analog++;
devc->enabled_analog_channels =
g_slist_append(devc->enabled_analog_channels, ch);
+ } else {
+ channel_mask |= ch->enabled << p;
}
}
+ /*
+ * Use wide sampling if either any of the LA channels 8..15 is enabled,
+ * and/or at least one analog channel is enabled, and/or the device
+ * is running DSLogic firmware (not fx2lafw).
+ */
+ devc->sample_wide = (channel_mask > 0xff
+ || num_analog > 0
+ || (devc->profile->dev_caps & DEV_CAPS_DSLOGIC_FW));
+
return SR_OK;
}
} else {
size = fx2lafw_get_buffer_size(devc);
/* Prepare for analog sampling. */
- if (devc->profile->dev_caps & DEV_CAPS_AX_ANALOG) {
+ if (g_slist_length(devc->enabled_analog_channels) > 0) {
/* We need a buffer half the size of a transfer. */
devc->logic_buffer = g_try_malloc(size / 2);
devc->analog_buffer = g_try_malloc(