serial-dmm: count analog DMM channels starting at 1
Commit 556a926d43
introduced support for multiple displays in
subdrivers of serial-dmm, but also changed user visible channel numbers
to start from 0. Restore the previous behaviour, start counting from 1
which users may perceive as more natural (serial-dmm used to start at P1
in the past, scopes start with CH1 as well).
This commit is contained in:
parent
3ef305b079
commit
48e2992f86
|
@ -137,7 +137,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
||||||
if (dmm->packet_parse == sr_metex14_4packets_parse)
|
if (dmm->packet_parse == sr_metex14_4packets_parse)
|
||||||
dmm->channel_count = 4;
|
dmm->channel_count = 4;
|
||||||
for (ch_idx = 0; ch_idx < dmm->channel_count; ch_idx++) {
|
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);
|
sr_channel_new(sdi, ch_idx, SR_CHANNEL_ANALOG, TRUE, ch_name);
|
||||||
}
|
}
|
||||||
devices = g_slist_append(devices, sdi);
|
devices = g_slist_append(devices, sdi);
|
||||||
|
|
Loading…
Reference in New Issue