]> sigrok.org Git - libsigrok.git/commitdiff
lcr/es51919: minor style nits in the ES51919 packet parser
authorGerhard Sittig <redacted>
Mon, 17 Jun 2019 20:44:44 +0000 (22:44 +0200)
committerGerhard Sittig <redacted>
Thu, 20 Jun 2019 14:45:36 +0000 (16:45 +0200)
Use macros for frequency constants. They hopfully are more readable than
large number literals with their magnitude being not as apparent.

src/lcr/es51919.c

index 0695de49dd6d3334d342685fc125611f99cc8efe..fc2e3a7b6bf50289e1be3baa85254d8db50a1e9f 100644 (file)
  */
 
 static const double frequencies[] = {
-       0, 100, 120, 1000, 10000, 100000,
+       SR_HZ(0), SR_HZ(100), SR_HZ(120),
+       SR_KHZ(1), SR_KHZ(10), SR_KHZ(100),
 };
 
 static const size_t freq_code_map[] = {
@@ -354,7 +355,7 @@ SR_PRIV int es51919_config_list(uint32_t key, GVariant **data,
        switch (key) {
        case SR_CONF_OUTPUT_FREQUENCY:
                *data = g_variant_new_fixed_array(G_VARIANT_TYPE_DOUBLE,
-                       ARRAY_AND_SIZE(frequencies), sizeof(double));
+                       ARRAY_AND_SIZE(frequencies), sizeof(frequencies[0]));
                return SR_OK;
        case SR_CONF_EQUIV_CIRCUIT_MODEL:
                *data = g_variant_new_strv(ARRAY_AND_SIZE(circuit_models));