From: Bert Vermeulen Date: Tue, 16 Oct 2012 21:31:18 +0000 (+0200) Subject: analog: add pretty-printer for dBu and dBV X-Git-Tag: dsupstream~660 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=796a79eb75e35fe47becfbf62a840464efbbe96a;p=libsigrok.git analog: add pretty-printer for dBu and dBV --- diff --git a/output/analog.c b/output/analog.c index d1fd7be6..05194dab 100644 --- a/output/analog.c +++ b/output/analog.c @@ -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;