sr: add support for pulse width measurements
This commit is contained in:
parent
f46a36ad80
commit
aa839a5c4f
|
@ -146,6 +146,7 @@ enum {
|
||||||
SR_MQ_FREQUENCY,
|
SR_MQ_FREQUENCY,
|
||||||
SR_MQ_DUTY_CYCLE,
|
SR_MQ_DUTY_CYCLE,
|
||||||
SR_MQ_CONTINUITY,
|
SR_MQ_CONTINUITY,
|
||||||
|
SR_MQ_PULSE_WIDTH,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* sr_datafeed_analog.unit values */
|
/* sr_datafeed_analog.unit values */
|
||||||
|
@ -160,6 +161,7 @@ enum {
|
||||||
SR_UNIT_HERTZ,
|
SR_UNIT_HERTZ,
|
||||||
SR_UNIT_PERCENTAGE,
|
SR_UNIT_PERCENTAGE,
|
||||||
SR_UNIT_BOOLEAN,
|
SR_UNIT_BOOLEAN,
|
||||||
|
SR_UNIT_SECOND,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** sr_datafeed_analog.flags values */
|
/** sr_datafeed_analog.flags values */
|
||||||
|
|
|
@ -125,6 +125,9 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
|
||||||
else
|
else
|
||||||
g_string_append_printf(out, "FALSE");
|
g_string_append_printf(out, "FALSE");
|
||||||
break;
|
break;
|
||||||
|
case SR_UNIT_SECOND:
|
||||||
|
si_printf(value, out, "s");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (mqflags & SR_MQFLAG_AC)
|
if (mqflags & SR_MQFLAG_AC)
|
||||||
g_string_append_printf(out, " AC");
|
g_string_append_printf(out, " AC");
|
||||||
|
|
Loading…
Reference in New Issue