]> sigrok.org Git - libsigrokdecode.git/commitdiff
Decoder_put(): Add more info to OTUPUT_PYTHON log messages.
authorUwe Hermann <redacted>
Fri, 12 Oct 2018 22:49:06 +0000 (00:49 +0200)
committerUwe Hermann <redacted>
Fri, 12 Oct 2018 22:49:06 +0000 (00:49 +0200)
type_decoder.c

index 314251102da0b8e83836d4eee65bcefaba9f3350..b90bdea04686219355fe382ba7796ff8867d6ea5 100644 (file)
@@ -353,9 +353,12 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args)
        }
        pdo = l->data;
 
        }
        pdo = l->data;
 
-       srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s on oid %d.",
-                di->inst_id, start_sample, end_sample,
-                output_type_name(pdo->output_type), output_id);
+       /* Upon SRD_OUTPUT_PYTHON for stacked PDs, we have a nicer log message later. */
+       if (pdo->output_type != SRD_OUTPUT_PYTHON && di->next_di != NULL) {
+               srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s on oid %d.",
+                        di->inst_id, start_sample, end_sample,
+                        output_type_name(pdo->output_type), output_id);
+       }
 
        pdata.start_sample = start_sample;
        pdata.end_sample = end_sample;
 
        pdata.start_sample = start_sample;
        pdata.end_sample = end_sample;
@@ -381,8 +384,10 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args)
        case SRD_OUTPUT_PYTHON:
                for (l = di->next_di; l; l = l->next) {
                        next_di = l->data;
        case SRD_OUTPUT_PYTHON:
                for (l = di->next_di; l; l = l->next) {
                        next_di = l->data;
-                       srd_spew("Sending %" PRIu64 "-%" PRIu64 " to instance %s",
-                                start_sample, end_sample, next_di->inst_id);
+                       srd_spew("Instance %s put %" PRIu64 "-%" PRIu64 " %s on "
+                                "oid %d to instance %s.", di->inst_id, start_sample,
+                                end_sample, output_type_name(pdo->output_type),
+                                output_id, next_di->inst_id);
                        if (!(py_res = PyObject_CallMethod(
                                next_di->py_inst, "decode", "KKO", start_sample,
                                end_sample, py_data))) {
                        if (!(py_res = PyObject_CallMethod(
                                next_di->py_inst, "decode", "KKO", start_sample,
                                end_sample, py_data))) {