]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/kingst-la2016/api.c
kingst-la2016: rename logic channels to match product's labels
[libsigrok.git] / src / hardware / kingst-la2016 / api.c
index af3a57a658d29f887518c9385586c88772c85311..45262c1eb48bae88475e352df40499da9a7f26d6 100644 (file)
@@ -61,8 +61,8 @@ static const int32_t trigger_matches[] = {
 };
 
 static const char *channel_names[] = {
-       "0", "1", "2", "3", "4", "5", "6", "7",
-       "8", "9", "10", "11", "12", "13", "14", "15",
+       "CH0", "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7",
+       "CH8", "CH9", "CH10", "CH11", "CH12", "CH13", "CH14", "CH15",
 };
 
 static const uint64_t samplerates_la2016[] = {
@@ -574,14 +574,17 @@ static int config_list(uint32_t key, GVariant **data,
 static int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
+       GSList *l;
+       struct sr_channel *ch;
 
        devc = sdi->priv;
+
        devc->cur_channels = 0;
-       for (GSList *l = sdi->channels; l; l = l->next) {
-               struct sr_channel *ch = (struct sr_channel*)l->data;
-               if (ch->enabled == FALSE)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (!ch->enabled)
                        continue;
-               devc->cur_channels |= 1 << ch->index;
+               devc->cur_channels |= 1UL << ch->index;
        }
 
        return SR_OK;