summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
f05903e)
Fix the code which registers the name of the second pod for digital
probes. The previous implementation registered the first pod twice, and
lost the reference to the second pod. No harm was done, none of the
supported models declared support for two pods so far.
Factor out a channel to group mapping in the registration of digital
channels, while we are here.
{
char tmp[25];
int model_index;
{
char tmp[25];
int model_index;
+ unsigned int i, j, group;
struct sr_channel *ch;
struct dev_context *devc;
struct sr_channel *ch;
struct dev_context *devc;
devc->digital_groups[i]->name = g_strdup(tmp);
sdi->channel_groups = g_slist_append(sdi->channel_groups,
devc->digital_groups[i]->name = g_strdup(tmp);
sdi->channel_groups = g_slist_append(sdi->channel_groups,
- devc->digital_groups[i < 8 ? 0 : 1]);
+ devc->digital_groups[i]);
}
/* Add digital channels. */
}
/* Add digital channels. */
ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
(*scope_models[model_index].digital_names)[i]);
ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
(*scope_models[model_index].digital_names)[i]);
- devc->digital_groups[i < 8 ? 0 : 1]->channels = g_slist_append(
- devc->digital_groups[i < 8 ? 0 : 1]->channels, ch);
+ group = i / 8;
+ devc->digital_groups[group]->channels = g_slist_append(
+ devc->digital_groups[group]->channels, ch);
}
devc->model_config = &scope_models[model_index];
}
devc->model_config = &scope_models[model_index];