]> sigrok.org Git - libsigrok.git/commitdiff
sysclk-lwla: Do not create channels in reverse order
authorDaniel Elstner <redacted>
Wed, 24 Jun 2015 17:16:49 +0000 (19:16 +0200)
committerUwe Hermann <redacted>
Sat, 27 Jun 2015 21:56:37 +0000 (23:56 +0200)
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.

src/hardware/sysclk-lwla/api.c

index 066f914db1016615c9ede8898e192366bdb282c0..1d68ba4ab68a88720c8fea832f61c7062285acc7 100644 (file)
@@ -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;