{ 2, 1 },
{ 5, 1 },
{ 10, 1 },
+ { 20, 1 },
+ { 50, 1 },
};
+/*
+ * It feels a little hacky to use a single table yet use different item
+ * count values here. But it simplifies maintenance, reduces redundancy
+ * by avoiding several vdivs[] table versions of mostly identical content,
+ * still references which declare models' capabilities remain readable.
+ */
+#define VDIVS_COUNT_UPTO_10V (ARRAY_SIZE(vdivs) - 2)
+#define VDIVS_COUNT_UPTO_50V (ARRAY_SIZE(vdivs))
static const char *scope_analog_channel_names[] = {
"CH1", "CH2", "CH3", "CH4",
.num_timebases = ARRAY_SIZE(timebases_hmo_compact),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases_hmo_compact),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_50V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_50V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
.num_timebases = ARRAY_SIZE(timebases),
.vdivs = &vdivs,
- .num_vdivs = ARRAY_SIZE(vdivs),
+ .num_vdivs = VDIVS_COUNT_UPTO_10V,
.num_ydivs = 8,
if (sr_scpi_get_string(scpi, command, &tmp_str) != SR_OK)
return SR_ERR;
- if (array_float_get(tmp_str, ARRAY_AND_SIZE(vdivs), &j) != SR_OK) {
+ if (array_float_get(tmp_str, *(config->vdivs), config->num_vdivs, &j) != SR_OK) {
g_free(tmp_str);
sr_err("Could not determine array index for vertical div scale.");
return SR_ERR;