From: Uwe Hermann Date: Wed, 19 Jul 2017 20:40:47 +0000 (+0200) Subject: drivers: Consistently name per-cg options 'devopts_cg_*'. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6b82c3e57aea481a1c9ac949a9d93078e0607292;p=libsigrok.git drivers: Consistently name per-cg options 'devopts_cg_*'. --- diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c index 5f192a84..c3809a92 100644 --- a/src/hardware/hameg-hmo/api.c +++ b/src/hardware/hameg-hmo/api.c @@ -492,7 +492,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t)); } else if (cg_type == CG_ANALOG) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - model->analog_devopts, model->num_analog_devopts, + model->devopts_cg_analog, model->num_devopts_cg_analog, sizeof(uint32_t)); } else { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index 437b5f37..2fa50efb 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -68,7 +68,7 @@ static const uint32_t devopts[] = { SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static const uint32_t analog_devopts[] = { +static const uint32_t devopts_cg_analog[] = { SR_CONF_NUM_VDIV | SR_CONF_GET, SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, @@ -259,8 +259,8 @@ static const struct scope_config scope_models[] = { .devopts = &devopts, .num_devopts = ARRAY_SIZE(devopts), - .analog_devopts = &analog_devopts, - .num_analog_devopts = ARRAY_SIZE(analog_devopts), + .devopts_cg_analog = &devopts_cg_analog, + .num_devopts_cg_analog = ARRAY_SIZE(devopts_cg_analog), .coupling_options = &coupling_options, .trigger_sources = &compact2_trigger_sources, @@ -289,8 +289,8 @@ static const struct scope_config scope_models[] = { .devopts = &devopts, .num_devopts = ARRAY_SIZE(devopts), - .analog_devopts = &analog_devopts, - .num_analog_devopts = ARRAY_SIZE(analog_devopts), + .devopts_cg_analog = &devopts_cg_analog, + .num_devopts_cg_analog = ARRAY_SIZE(devopts_cg_analog), .coupling_options = &coupling_options, .trigger_sources = &compact4_trigger_sources, @@ -319,8 +319,8 @@ static const struct scope_config scope_models[] = { .devopts = &devopts, .num_devopts = ARRAY_SIZE(devopts), - .analog_devopts = &analog_devopts, - .num_analog_devopts = ARRAY_SIZE(analog_devopts), + .devopts_cg_analog = &devopts_cg_analog, + .num_devopts_cg_analog = ARRAY_SIZE(devopts_cg_analog), .coupling_options = &coupling_options, .trigger_sources = &compact4_dig16_trigger_sources, diff --git a/src/hardware/hameg-hmo/protocol.h b/src/hardware/hameg-hmo/protocol.h index 74ef3da9..037b2426 100644 --- a/src/hardware/hameg-hmo/protocol.h +++ b/src/hardware/hameg-hmo/protocol.h @@ -46,8 +46,8 @@ struct scope_config { const uint32_t (*devopts)[]; const uint8_t num_devopts; - const uint32_t (*analog_devopts)[]; - const uint8_t num_analog_devopts; + const uint32_t (*devopts_cg_analog)[]; + const uint8_t num_devopts_cg_analog; const char *(*coupling_options)[]; const uint8_t num_coupling_options; diff --git a/src/hardware/hung-chang-dso-2100/api.c b/src/hardware/hung-chang-dso-2100/api.c index 655b11c8..c98cdbbe 100644 --- a/src/hardware/hung-chang-dso-2100/api.c +++ b/src/hardware/hung-chang-dso-2100/api.c @@ -39,7 +39,7 @@ static const uint32_t devopts[] = { SR_CONF_BUFFERSIZE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static const uint32_t cgopts[] = { +static const uint32_t devopts_cg[] = { SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_PROBE_FACTOR | SR_CONF_GET | SR_CONF_SET, @@ -596,7 +596,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * if (!cg) return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts); *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - cgopts, ARRAY_SIZE(cgopts), sizeof(uint32_t)); + devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(uint32_t)); break; case SR_CONF_SAMPLERATE: g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}")); diff --git a/src/hardware/lecroy-xstream/api.c b/src/hardware/lecroy-xstream/api.c index 140308dc..c00a9e7e 100644 --- a/src/hardware/lecroy-xstream/api.c +++ b/src/hardware/lecroy-xstream/api.c @@ -46,7 +46,7 @@ static const uint32_t devopts[] = { SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static const uint32_t analog_devopts[] = { +static const uint32_t devopts_cg_analog[] = { SR_CONF_NUM_VDIV | SR_CONF_GET, SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, @@ -401,7 +401,7 @@ static int config_list(uint32_t key, GVariant **data, if (!cg) return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts); *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - analog_devopts, ARRAY_SIZE(analog_devopts), + devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t)); break; case SR_CONF_COUPLING: diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 6164e4ac..fb1c177d 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -51,7 +51,7 @@ static const uint32_t devopts[] = { }; /** Hardware capabilities channel 1, 2. */ -static const uint32_t devopts_ch12[] = { +static const uint32_t devopts_cg_ch12[] = { SR_CONF_VOLTAGE | SR_CONF_GET, SR_CONF_VOLTAGE_TARGET | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_CURRENT | SR_CONF_GET, @@ -60,7 +60,7 @@ static const uint32_t devopts_ch12[] = { }; /** Hardware capabilities channel 3 (LPS-304/305 only). */ -static const uint32_t devopts_ch3[] = { +static const uint32_t devopts_cg_ch3[] = { SR_CONF_VOLTAGE | SR_CONF_GET, SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET, }; @@ -685,10 +685,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * case SR_CONF_DEVICE_OPTIONS: if ((ch_idx == 0) || (ch_idx == 1)) /* CH1, CH2 */ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - devopts_ch12, ARRAY_SIZE(devopts_ch12), sizeof(uint32_t)); + devopts_cg_ch12, ARRAY_SIZE(devopts_cg_ch12), sizeof(uint32_t)); else /* Must be CH3 */ *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - devopts_ch3, ARRAY_SIZE(devopts_ch3), sizeof(uint32_t)); + devopts_cg_ch3, ARRAY_SIZE(devopts_cg_ch3), sizeof(uint32_t)); break; case SR_CONF_VOLTAGE_TARGET: g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c index bfb6cd41..384966e7 100644 --- a/src/hardware/rigol-ds/api.c +++ b/src/hardware/rigol-ds/api.c @@ -53,7 +53,7 @@ static const uint32_t devopts[] = { SR_CONF_DATA_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static const uint32_t analog_devopts[] = { +static const uint32_t devopts_cg_analog[] = { SR_CONF_NUM_VDIV | SR_CONF_GET, SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, @@ -860,7 +860,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * for (i = 0; i < devc->model->analog_channels; i++) { if (cg == devc->analog_groups[i]) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - analog_devopts, ARRAY_SIZE(analog_devopts), sizeof(uint32_t)); + devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t)); return SR_OK; } } diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c index e1702956..bc44675e 100644 --- a/src/hardware/yokogawa-dlm/api.c +++ b/src/hardware/yokogawa-dlm/api.c @@ -47,13 +47,13 @@ static const uint32_t devopts[] = { SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static const uint32_t analog_devopts[] = { +static const uint32_t devopts_cg_analog[] = { SR_CONF_NUM_VDIV | SR_CONF_GET, SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; -static const uint32_t digital_devopts[] = { +static const uint32_t devopts_cg_digital[] = { }; enum { @@ -509,10 +509,10 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * case SR_CONF_DEVICE_OPTIONS: if (cg_type == CG_ANALOG) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - analog_devopts, ARRAY_SIZE(analog_devopts), sizeof(uint32_t)); + devopts_cg_analog, ARRAY_SIZE(devopts_cg_analog), sizeof(uint32_t)); } else if (cg_type == CG_DIGITAL) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - digital_devopts, ARRAY_SIZE(digital_devopts), sizeof(uint32_t)); + devopts_cg_digital, ARRAY_SIZE(devopts_cg_digital), sizeof(uint32_t)); } else { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, NULL, 0, sizeof(uint32_t));