]> sigrok.org Git - libsigrok.git/commitdiff
sr: add support for pulse width measurements
authorBert Vermeulen <redacted>
Tue, 25 Sep 2012 16:33:42 +0000 (18:33 +0200)
committerBert Vermeulen <redacted>
Tue, 25 Sep 2012 17:53:05 +0000 (19:53 +0200)
libsigrok.h
output/analog.c

index 2a88a7d03bc891602b404221ba661f9f918f4dd3..5aacf2a6395e4fe5620d80a30d4903162c065dc5 100644 (file)
@@ -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 */
index 4ae8550fb112265b6e59f315e7f1efee4849b0e1..7c1b1007b99f0d5d177bf0314e871c5d83e24cfa 100644 (file)
@@ -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");