]> sigrok.org Git - libsigrok.git/commitdiff
sysclk-lwla: Do not reset drv_context.instances on scan.
authorDaniel Elstner <redacted>
Thu, 23 Jan 2014 00:24:29 +0000 (01:24 +0100)
committerDaniel Elstner <redacted>
Thu, 23 Jan 2014 01:36:13 +0000 (02:36 +0100)
Apparently, frontends may call scan() more than once to accumulate
multiple devices, so do not reset the instance list pointer at the
start of each scan.  Also, number devices continuously across scans.

hardware/sysclk-lwla/api.c

index 5bae5d5499225e9b1d39c60641ba7b3e66a353a1..8b15b6961589efc6559a17d1f002fef2280163b1 100644 (file)
@@ -91,7 +91,6 @@ static GSList *scan(GSList *options)
        int device_index;
 
        drvc = di->priv;
-       drvc->instances = NULL;
        conn = USB_VID_PID;
 
        for (node = options; node != NULL; node = node->next) {
@@ -103,7 +102,7 @@ static GSList *scan(GSList *options)
        }
        usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, conn);
        devices = NULL;
-       device_index = 0;
+       device_index = g_slist_length(drvc->instances);
 
        for (node = usb_devices; node != NULL; node = node->next) {
                usb = node->data;