]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/serial-dmm/api.c
serial-dmm: count analog DMM channels starting at 1
[libsigrok.git] / src / hardware / serial-dmm / api.c
index 040531815cc79f60f374fc2563a8defaf0679560..88e3b88aef6b8974208a473313b558d8cc5b53e5 100644 (file)
@@ -137,7 +137,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        if (dmm->packet_parse == sr_metex14_4packets_parse)
                dmm->channel_count = 4;
        for (ch_idx = 0; ch_idx < dmm->channel_count; ch_idx++) {
-               snprintf(ch_name, sizeof(ch_name), "P%zu", ch_idx);
+               size_t ch_num;
+               ch_num = ch_idx + 1;
+               snprintf(ch_name, sizeof(ch_name), "P%zu", ch_num);
                sr_channel_new(sdi, ch_idx, SR_CHANNEL_ANALOG, TRUE, ch_name);
        }
        devices = g_slist_append(devices, sdi);