]> sigrok.org Git - libsigrok.git/commitdiff
analog: add pretty-printer for dBu and dBV
authorBert Vermeulen <redacted>
Tue, 16 Oct 2012 21:31:18 +0000 (23:31 +0200)
committerBert Vermeulen <redacted>
Tue, 16 Oct 2012 21:33:54 +0000 (23:33 +0200)
output/analog.c

index d1fd7be6b17b2924ab72f49d761019d3f52f83ef..05194daba4b9a2d868bf26537cff198eda13d524 100644 (file)
@@ -137,6 +137,12 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
                case SR_UNIT_SIEMENS:
                        si_printf(value, out, "S");
                        break;
+               case SR_UNIT_DECIBEL_MW:
+                       si_printf(value, out, "dBu");
+                       break;
+               case SR_UNIT_DECIBEL_VOLT:
+                       si_printf(value, out, "dBV");
+                       break;
        }
        if ((mqflags & (SR_MQFLAG_AC | SR_MQFLAG_DC)) == (SR_MQFLAG_AC | SR_MQFLAG_DC))
                g_string_append_printf(out, " AC+DC");
@@ -156,6 +162,7 @@ static GString *receive(struct sr_output *o, const struct sr_dev_inst *sdi,
        float *fdata;
        int i, j;
 
+       (void)sdi;
        if (!o || !o->sdi)
                return NULL;
        ctx = o->internal;