]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/api.c
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / hardware / atten-pps3xxx / api.c
index b82b9fb333cf9fd460764d638ce325f3e607caaf..28b22015d3fd13f449c0379cf7f84d92b5e8363b 100644 (file)
@@ -113,8 +113,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid)
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       serial_flush(serial);
-
        /* This is how the vendor software scans for hardware. */
        memset(packet, 0, PACKET_SIZE);
        packet[0] = 0xaa;
@@ -159,11 +157,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid)
        for (i = 0; i < MAX_CHANNELS; i++) {
                snprintf(channel, 10, "CH%d", i + 1);
                ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel);
-               cg = g_malloc(sizeof(struct sr_channel_group));
-               cg->name = g_strdup(channel);
+               cg = sr_channel_group_new(sdi, channel, NULL);
                cg->channels = g_slist_append(NULL, ch);
-               cg->priv = NULL;
-               sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
        }
 
        devc = g_malloc0(sizeof(struct dev_context));