X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fatten-pps3xxx%2Fapi.c;h=28b22015d3fd13f449c0379cf7f84d92b5e8363b;hb=e26a443aadd8ad75dc45d58ffa51e8e86fbb804f;hp=b82b9fb333cf9fd460764d638ce325f3e607caaf;hpb=f6c685e4d340b52962c2ae983974936071578156;p=libsigrok.git diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c index b82b9fb3..28b22015 100644 --- a/src/hardware/atten-pps3xxx/api.c +++ b/src/hardware/atten-pps3xxx/api.c @@ -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));