X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=input%2Fchronovu_la8.c;h=43004401e697c5a6b2073cc26e0ed1342bd06d30;hb=ba7dd8bbb8168cba432a844259a3e239aa5f36d7;hp=620b5aa3e1301bd841ad7fe0784484cfca803ad3;hpb=91aea754aaed0f0f2a6fc4b2b875f0d0b7c01f8e;p=libsigrok.git diff --git a/input/chronovu_la8.c b/input/chronovu_la8.c index 620b5aa3..43004401 100644 --- a/input/chronovu_la8.c +++ b/input/chronovu_la8.c @@ -96,20 +96,20 @@ static int format_match(const char *filename) static int init(struct sr_input *in, const char *filename) { - struct sr_channel *probe; - int num_probes, i; + struct sr_channel *ch; + int num_channels, i; char name[SR_MAX_PROBENAME_LEN + 1]; char *param; (void)filename; - num_probes = DEFAULT_NUM_PROBES; + num_channels = DEFAULT_NUM_PROBES; if (in->param) { - param = g_hash_table_lookup(in->param, "numprobes"); + param = g_hash_table_lookup(in->param, "numchannels"); if (param) { - num_probes = strtoul(param, NULL, 10); - if (num_probes < 1) { + num_channels = strtoul(param, NULL, 10); + if (num_channels < 1) { sr_err("%s: strtoul failed", __func__); return SR_ERR; } @@ -119,12 +119,12 @@ static int init(struct sr_input *in, const char *filename) /* Create a virtual device. */ in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL); - for (i = 0; i < num_probes; i++) { + for (i = 0; i < num_channels; i++) { snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i); /* TODO: Check return value. */ - if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) + if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) return SR_ERR; - in->sdi->probes = g_slist_append(in->sdi->probes, probe); + in->sdi->channels = g_slist_append(in->sdi->channels, ch); } return SR_OK; @@ -137,7 +137,7 @@ static int loadfile(struct sr_input *in, const char *filename) struct sr_datafeed_logic logic; struct sr_config *src; uint8_t buf[PACKET_SIZE], divcount; - int i, fd, size, num_probes; + int i, fd, size, num_channels; uint64_t samplerate; /* TODO: Use glib functions! GIOChannel, g_fopen, etc. */ @@ -146,7 +146,7 @@ static int loadfile(struct sr_input *in, const char *filename) return SR_ERR; } - num_probes = g_slist_length(in->sdi->probes); + num_channels = g_slist_length(in->sdi->channels); /* Seek to the end of the file, and read the divcount byte. */ divcount = 0x00; /* TODO: Don't hardcode! */ @@ -176,7 +176,7 @@ static int loadfile(struct sr_input *in, const char *filename) sr_dbg("%s: sending SR_DF_LOGIC data packets", __func__); packet.type = SR_DF_LOGIC; packet.payload = &logic; - logic.unitsize = (num_probes + 7) / 8; + logic.unitsize = (num_channels + 7) / 8; logic.data = buf; /* Send 8MB of total data to the session bus in small chunks. */