X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-dso%2Fapi.c;h=e2d091424ac8821c520f20d23b34f1091c3c6048;hb=5e23fcab889c62864b92aa3ad6902ce3e9f5be49;hp=7bf0c5293b7927d0b042ba617316e0ba97c47c3d;hpb=5ecd9049e53112e75526c2887d3f57165b688c3f;p=libsigrok.git diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 7bf0c529..e2d09142 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -57,7 +57,7 @@ static const uint32_t devopts[] = { SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET, SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_GET | SR_CONF_SET, - SR_CONF_NUM_TIMEBASE | SR_CONF_GET, + SR_CONF_NUM_HDIV | SR_CONF_GET, SR_CONF_NUM_VDIV | SR_CONF_GET, }; @@ -172,7 +172,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) struct dev_context *devc; int i; - sdi = sr_dev_inst_new(); + sdi = g_malloc0(sizeof(struct sr_dev_inst)); sdi->status = SR_ST_INITIALIZING; sdi->vendor = g_strdup(prof->vendor); sdi->model = g_strdup(prof->model); @@ -183,8 +183,7 @@ static struct sr_dev_inst *dso_dev_new(const struct dso_profile *prof) * a trigger source internal to the device. */ for (i = 0; channel_names[i]; i++) { - ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]); - sdi->channels = g_slist_append(sdi->channels, ch); + ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel_names[i]); cg = g_malloc0(sizeof(struct sr_channel_group)); cg->name = g_strdup(channel_names[i]); cg->channels = g_slist_append(cg->channels, ch); @@ -439,7 +438,7 @@ static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *s (void)cg; switch (key) { - case SR_CONF_NUM_TIMEBASE: + case SR_CONF_NUM_HDIV: *data = g_variant_new_int32(NUM_TIMEBASE); break; case SR_CONF_NUM_VDIV: