]> sigrok.org Git - libsigrok.git/blobdiff - hardware/saleae-logic16/api.c
saleae-logic16: Minor whitespace fixes, cosmetics.
[libsigrok.git] / hardware / saleae-logic16 / api.c
index 438d91a4501137067d9c5f4d8250e8210522818e..388d95a53c20b5f3c05313ae923351425e97543b 100644 (file)
@@ -195,7 +195,7 @@ static GSList *scan(GSList *options)
                sdi->driver = di;
 
                for (j = 0; channel_names[j]; j++) {
-                       if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
+                       if (!(ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
                                                   channel_names[j])))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
@@ -627,6 +627,9 @@ static int configure_channels(const struct sr_dev_inst *sdi)
        struct sr_channel *ch;
        GSList *l;
        uint16_t channel_bit;
+#ifdef WORDS_BIGENDIAN
+       int i;
+#endif
 
        devc = sdi->priv;
 
@@ -653,6 +656,16 @@ static int configure_channels(const struct sr_dev_inst *sdi)
                devc->channel_masks[devc->num_channels++] = channel_bit;
        }
 
+       if (devc->cur_channels & ~0xff) {
+               devc->unitsize = 2;
+       } else {
+#ifdef WORDS_BIGENDIAN
+               for (i = 0; i < devc->num_channels; i++)
+                       devc->channel_masks[i] >>= 8;
+#endif
+               devc->unitsize = 1;
+       }
+
        return SR_OK;
 }