From: Daniel Elstner Date: Wed, 24 Jun 2015 17:16:49 +0000 (+0200) Subject: sysclk-lwla: Do not create channels in reverse order X-Git-Tag: libsigrok-0.4.0~475 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=fe473123ba836445d477149f2e2c0ae372fc0c4c;p=libsigrok.git sysclk-lwla: Do not create channels in reverse order This was originally done as an optimization in combination with a list reversal which has since been removed from the code. Thus, un-reverse the channels so that the UI lists them in the correct order again. --- diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c index 066f914d..1d68ba4a 100644 --- a/src/hardware/sysclk-lwla/api.c +++ b/src/hardware/sysclk-lwla/api.c @@ -100,10 +100,10 @@ static struct sr_dev_inst *dev_inst_new(void) devc->samplerate = DEFAULT_SAMPLERATE; sdi->priv = devc; - for (i = NUM_CHANNELS; i > 0; --i) { + for (i = 0; i < NUM_CHANNELS; ++i) { /* The LWLA series simply number channels from CH1 to CHxx. */ - g_snprintf(name, sizeof(name), "CH%d", i); - sr_channel_new(sdi, i - 1, SR_CHANNEL_LOGIC, TRUE, name); + g_snprintf(name, sizeof(name), "CH%d", i + 1); + sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, name); } return sdi;