lcr/es51919: minor style nits in the ES51919 packet parser
Use macros for frequency constants. They hopfully are more readable than large number literals with their magnitude being not as apparent.
This commit is contained in:
parent
8556703a6c
commit
238b874e44
|
@ -124,7 +124,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const double frequencies[] = {
|
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[] = {
|
static const size_t freq_code_map[] = {
|
||||||
|
@ -354,7 +355,7 @@ SR_PRIV int es51919_config_list(uint32_t key, GVariant **data,
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case SR_CONF_OUTPUT_FREQUENCY:
|
case SR_CONF_OUTPUT_FREQUENCY:
|
||||||
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_DOUBLE,
|
*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;
|
return SR_OK;
|
||||||
case SR_CONF_EQUIV_CIRCUIT_MODEL:
|
case SR_CONF_EQUIV_CIRCUIT_MODEL:
|
||||||
*data = g_variant_new_strv(ARRAY_AND_SIZE(circuit_models));
|
*data = g_variant_new_strv(ARRAY_AND_SIZE(circuit_models));
|
||||||
|
|
Loading…
Reference in New Issue