X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Flink-mso19%2Fapi.c;fp=hardware%2Flink-mso19%2Fapi.c;h=654f876ed853ec454376be525cff2f58f8bfa507;hb=ca9b9f4834f106ba8387cf962a216425e0476de5;hp=e283a2cb7fb9cacf94ef2409c18da3c6124eba04;hpb=fe90fbb7829ac745d59be37e61fa55e45b251a4e;p=libsigrok.git diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index e283a2cb..654f876e 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -302,7 +302,8 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, { int ret; struct dev_context *devc; - uint64_t num_samples, slope; + uint64_t num_samples; + const char *slope; int trigger_pos; double pos; @@ -334,12 +335,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, ret = SR_OK; break; case SR_CONF_TRIGGER_SLOPE: - slope = g_variant_get_uint64(data); - if (slope != SLOPE_NEGATIVE && slope != SLOPE_POSITIVE) { + slope = g_variant_get_string(data, NULL); + + if (!slope || !(slope[0] == 'f' || slope[0] == 'r')) sr_err("Invalid trigger slope"); ret = SR_ERR_ARG; } else { - devc->trigger_slope = slope; + devc->trigger_slope = (slope[0] == 'r') + ? SLOPE_POSITIVE : SLOPE_NEGATIVE; ret = SR_OK; } break;