]> sigrok.org Git - libsigrok.git/commitdiff
chronovu-la8: Fix incorrect 0Hz samplerate being reported.
authorUwe Hermann <redacted>
Tue, 16 Apr 2013 13:42:45 +0000 (15:42 +0200)
committerUwe Hermann <redacted>
Tue, 16 Apr 2013 20:35:17 +0000 (22:35 +0200)
This closes bug #93.

hardware/chronovu-la8/api.c
hardware/chronovu-la8/protocol.c

index 53acf0b809386654184717fc35116240ae6edf7f..08e06c32afe717823493a3b5e2b309f8a5b7de9f 100644 (file)
 SR_PRIV struct sr_dev_driver chronovu_la8_driver_info;
 static struct sr_dev_driver *di = &chronovu_la8_driver_info;
 
-/* This will be initialized via config_list()/SR_CONF_SAMPLERATE.
+/*
+ * This will be initialized via config_list()/SR_CONF_SAMPLERATE.
  *
  * Min: 1 sample per 0.01us -> sample time is 0.084s, samplerate 100MHz
  * Max: 1 sample per 2.55us -> sample time is 21.391s, samplerate 392.15kHz
  */
-SR_PRIV uint64_t chronovu_la8_samplerates[255 + 1] = { 0 };
+SR_PRIV uint64_t chronovu_la8_samplerates[255] = { 0 };
 
 /* Note: Continuous sampling is not supported by the hardware. */
 SR_PRIV const int32_t chronovu_la8_hwcaps[] = {
@@ -353,14 +354,16 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                               chronovu_la8_hwcaps, ARRAY_SIZE(chronovu_la8_hwcaps),
+                               chronovu_la8_hwcaps,
+                               ARRAY_SIZE(chronovu_la8_hwcaps),
                                sizeof(int32_t));
                break;
        case SR_CONF_SAMPLERATE:
                fill_supported_samplerates_if_needed();
                g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));
                gvar = g_variant_new_fixed_array(G_VARIANT_TYPE("t"),
-                               chronovu_la8_samplerates, ARRAY_SIZE(chronovu_la8_samplerates),
+                               chronovu_la8_samplerates,
+                               ARRAY_SIZE(chronovu_la8_samplerates),
                                sizeof(uint64_t));
                g_variant_builder_add(&gvb, "{sv}", "samplerates", gvar);
                *data = g_variant_builder_end(&gvb);
index d106b3361653720ecc26c491d8cdb0ca4059f81b..b4a9138db26e3579c281d5f503070cea7d77ca97 100644 (file)
@@ -39,7 +39,6 @@ SR_PRIV void fill_supported_samplerates_if_needed(void)
 
        for (i = 0; i < 255; i++)
                chronovu_la8_samplerates[254 - i] = SR_MHZ(100) / (i + 1);
-       chronovu_la8_samplerates[255] = 0;
 }
 
 /**