From: Bert Vermeulen Date: Sun, 8 Jul 2012 17:06:23 +0000 (+0200) Subject: fx2lafw: use new instance-based probe list X-Git-Tag: dsupstream~840 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=06717a8a605d03eb87e768119758ba8e9e47cb0b;p=libsigrok.git fx2lafw: use new instance-based probe list --- diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 5bc5e262..1f474bd0 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -92,9 +92,6 @@ static const int hwcaps[] = { 0, }; -/* - * TODO: Different probe_names[] for each supported device. - */ static const char *probe_names[] = { "0", "1", @@ -435,6 +432,15 @@ static GSList *hw_scan(GSList *options) if (!sdi) return 0; + /* Fill in probelist according to this device's profile. */ + num_logic_probes = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8; + for (j = 0; i < num_logic_probes; j++) { + if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE, + probe_names[j]))) + return 0; + sdi->probes = g_slist_append(sdi->probes, probe); + } + ctx = fx2lafw_dev_new(); ctx->profile = prof; sdi->priv = ctx;