]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: use new instance-based probe list
authorBert Vermeulen <redacted>
Sun, 8 Jul 2012 17:06:23 +0000 (19:06 +0200)
committerBert Vermeulen <redacted>
Fri, 3 Aug 2012 08:27:37 +0000 (10:27 +0200)
hardware/fx2lafw/fx2lafw.c

index 5bc5e262be173c5b0fc90eef408bd98b63f2ee2b..1f474bd05077784e7306a07cefa95529375f6b32 100644 (file)
@@ -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;