From: Bert Vermeulen Date: Tue, 25 Sep 2012 16:33:42 +0000 (+0200) Subject: sr: add support for pulse width measurements X-Git-Tag: dsupstream~681 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=aa839a5c4fb3d994c7254da403eef8beab2880ba;p=libsigrok.git sr: add support for pulse width measurements --- diff --git a/libsigrok.h b/libsigrok.h index 2a88a7d0..5aacf2a6 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -146,6 +146,7 @@ enum { SR_MQ_FREQUENCY, SR_MQ_DUTY_CYCLE, SR_MQ_CONTINUITY, + SR_MQ_PULSE_WIDTH, }; /* sr_datafeed_analog.unit values */ @@ -160,6 +161,7 @@ enum { SR_UNIT_HERTZ, SR_UNIT_PERCENTAGE, SR_UNIT_BOOLEAN, + SR_UNIT_SECOND, }; /** sr_datafeed_analog.flags values */ diff --git a/output/analog.c b/output/analog.c index 4ae8550f..7c1b1007 100644 --- a/output/analog.c +++ b/output/analog.c @@ -125,6 +125,9 @@ static void fancyprint(int unit, int mqflags, float value, GString *out) else g_string_append_printf(out, "FALSE"); break; + case SR_UNIT_SECOND: + si_printf(value, out, "s"); + break; } if (mqflags & SR_MQFLAG_AC) g_string_append_printf(out, " AC");