]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/rdtech-tc/protocol.c
rdtech-tc: avoid mixing several iterations in the same for loop
[libsigrok.git] / src / hardware / rdtech-tc / protocol.c
index 39d52ba5c3ea6935e127f6f48e68a1a992b79f67..e1cff006770813bfa9b4757c940ce545deebe5b3 100644 (file)
@@ -193,9 +193,11 @@ static void handle_poll_data(const struct sr_dev_inst *sdi)
                return;
        }
 
-       for (ch = sdi->channels, i = 0; ch; ch = g_slist_next(ch), i++) {
+       i = 0;
+       for (ch = sdi->channels; ch; ch = g_slist_next(ch)) {
                bv_send_analog_channel(sdi, ch->data,
                        &devc->channels[i], poll_pkt, TC_POLL_LEN);
+               i++;
        }
 
        sr_sw_limits_update_samples_read(&devc->limits, 1);