X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsaleae-logic16%2Fapi.c;h=6ca0f594bd9923bfb55f56d58ada1555bf7be6d8;hb=94e64a0b89c4ad297c122e5ece815fc228e27ee6;hp=00a4c1bc9b87d0d045ef887a0a5bf35e301ea985;hpb=87dc5410273abf9307dc25a2528a6aa98a8ae44b;p=libsigrok.git diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c index 00a4c1bc..6ca0f594 100644 --- a/src/hardware/saleae-logic16/api.c +++ b/src/hardware/saleae-logic16/api.c @@ -77,7 +77,7 @@ static const struct { { VOLTAGE_RANGE_5_V, }, }; -static const struct voltage_threshold volt_thresholds[] = { +static const double volt_thresholds[][2] = { { 0.7, 1.4 }, { 1.4, 3.6 }, }; @@ -441,7 +441,7 @@ static int config_get(uint32_t key, GVariant **data, if (devc->selected_voltage_range != volt_thresholds_ranges[i].range) continue; - *data = std_gvar_tuple_double(volt_thresholds[i].low, volt_thresholds[i].high); + *data = std_gvar_tuple_double(volt_thresholds[i][0], volt_thresholds[i][1]); ret = SR_OK; break; } @@ -481,8 +481,8 @@ static int config_set(uint32_t key, GVariant *data, g_variant_get(data, "(dd)", &low, &high); ret = SR_ERR_ARG; for (i = 0; i < ARRAY_SIZE(volt_thresholds); i++) { - if (fabs(volt_thresholds[i].low - low) < 0.1 && - fabs(volt_thresholds[i].high - high) < 0.1) { + if (fabs(volt_thresholds[i][0] - low) < 0.1 && + fabs(volt_thresholds[i][1] - high) < 0.1) { devc->selected_voltage_range = volt_thresholds_ranges[i].range; ret = SR_OK;