info->is_beep = (buf[9] & (1 << 3)) != 0;
info->is_diode = (buf[9] & (1 << 2)) != 0;
info->is_percent = (buf[9] & (1 << 1)) != 0;
- info->is_z4 = (buf[8] & (1 << 0)) != 0; /* User symbol 4 */
+ info->is_z4 = (buf[9] & (1 << 0)) != 0; /* User symbol 4 */
/* Byte 10 */
info->is_volt = (buf[10] & (1 << 7)) != 0;
analog->mqflags |= SR_MQFLAG_DC;
if (info->is_auto)
analog->mqflags |= SR_MQFLAG_AUTORANGE;
+ if (info->is_diode)
+ analog->mqflags |= SR_MQFLAG_DIODE;
if (info->is_hold)
analog->mqflags |= SR_MQFLAG_HOLD;
if (info->is_max)
return SR_OK;
}
+
+SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog *analog, void *info)
+{
+ struct fs9922_info *info_local;
+
+ info_local = (struct fs9922_info *)info;
+
+ /* User-defined z1 flag means "diode mode". */
+ if (info_local->is_z1) {
+ analog->mq = SR_MQ_VOLTAGE;
+ analog->unit = SR_UNIT_VOLT;
+ analog->mqflags |= SR_MQFLAG_DIODE;
+ }
+}