]> sigrok.org Git - libsigrok.git/blobdiff - src/input/protocoldata.c
feed_queue: rename routines for submission of a single sample value
[libsigrok.git] / src / input / protocoldata.c
index 6be96f1863c9d9a432f0f55e23f5db711e127a5d..c1d516f4aad08eefb6bbde29a011fb52cc088da8 100644 (file)
@@ -714,7 +714,8 @@ static int send_idle_capture(struct context *inc)
                return ret;
        count *= inc->curr_opts.samples_per_bit;
        while (count--) {
-               ret = feed_queue_logic_submit(inc->feed_logic, &data, sizeof(data));
+               ret = feed_queue_logic_submit_one(inc->feed_logic,
+                       &data, sizeof(data));
                if (ret != SR_OK)
                        return ret;
        }
@@ -738,7 +739,8 @@ static int send_idle_interframe(struct context *inc)
        if (ret != SR_OK)
                return ret;
        while (count--) {
-               ret = feed_queue_logic_submit(inc->feed_logic, &data, sizeof(data));
+               ret = feed_queue_logic_submit_one(inc->feed_logic,
+                       &data, sizeof(data));
                if (ret != SR_OK)
                        return ret;
        }
@@ -759,7 +761,7 @@ static int send_frame(struct sr_input *in)
                data = inc->sample_levels[index];
                count = inc->sample_widths[index];
                while (count--) {
-                       feed_queue_logic_submit(inc->feed_logic,
+                       feed_queue_logic_submit_one(inc->feed_logic,
                                &data, sizeof(data));
                }
        }
@@ -2411,10 +2413,14 @@ static int i2c_get_idle_interframe(struct context *inc,
        size_t *samplecount, uint8_t *sample)
 {
 
-       /* Describe four bit times, re-use the current pin levels. */
+       /*
+        * The space around regular bytes already is sufficient. We
+        * don't need to generate an inter-frame gap, but the code is
+        * prepared to in case we want to in the future.
+        */
        if (samplecount) {
                *samplecount = inc->curr_opts.samples_per_bit;
-               *samplecount *= 4;
+               *samplecount *= 0;
        }
        if (sample)
                *sample = inc->samples.curr_levels;
@@ -2874,8 +2880,7 @@ static int process_textline(struct sr_input *in, char *line)
        struct context *inc;
        const struct proto_handler_t *handler;
        gboolean is_comm, is_pseudo;
-       char *word;
-       char *endp;
+       char *p, *word, *endp;
        unsigned long value;
        int ret;
 
@@ -2927,11 +2932,16 @@ static int process_textline(struct sr_input *in, char *line)
        /*
         * Non-empty non-comment lines carry protocol values.
         * (Empty lines are handled transparently when they get here.)
+        * Accept comma and semicolon separators for user convenience.
         * Convert text according to previously received instructions.
         * Pass the values to the protocol handler. Flush waveforms
         * when handlers state that their construction has completed.
         */
        sr_spew("got values line: %s", line);
+       for (p = line; *p; p++) {
+               if (*p == ',' || *p == ';')
+                       *p = ' ';
+       }
        while (line) {
                word = sr_text_next_word(line, &line);
                if (!word)