- ctx->probelist[ctx->num_enabled_probes] = probe->name;
- ctx->probeindices[ctx->num_enabled_probes] = probe->index;
+ ctx->probeindices = g_array_append_val(
+ ctx->probeindices, probe->index);
g_string_append_printf(ctx->header, "$version %s %s $end\n",
PACKAGE, PACKAGE_VERSION);
g_string_append_printf(ctx->header, "$version %s %s $end\n",
PACKAGE, PACKAGE_VERSION);
- if (o->sdi->driver && sr_dev_has_option(o->sdi, SR_CONF_SAMPLERATE)) {
- o->sdi->driver->config_get(SR_CONF_SAMPLERATE, &gvar, o->sdi);
+ if (sr_config_get(o->sdi->driver, SR_CONF_SAMPLERATE, &gvar,
+ o->sdi) == SR_OK) {
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
g_string_free(ctx->header, TRUE);
g_free(ctx);
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
g_string_free(ctx->header, TRUE);
g_free(ctx);
return SR_ERR;
}
g_string_append_printf(ctx->header, vcd_header_comment,
ctx->num_enabled_probes, num_probes, samplerate_s);
g_free(samplerate_s);
return SR_ERR;
}
g_string_append_printf(ctx->header, vcd_header_comment,
ctx->num_enabled_probes, num_probes, samplerate_s);
g_free(samplerate_s);
-static GString *receive(struct sr_output *o, const struct sr_dev_inst *sdi,
- const struct sr_datafeed_packet *packet)
+static int receive(struct sr_output *o, const struct sr_dev_inst *sdi,
+ const struct sr_datafeed_packet *packet, GString **out)
unsigned int i;
int p, curbit, prevbit, index;
uint8_t *sample;
unsigned int i;
int p, curbit, prevbit, index;
uint8_t *sample;
curbit = (sample[p / 8] & (((uint8_t) 1) << index)) >> index;
prevbit = (ctx->prevsample[p / 8] & (((uint64_t) 1) << index)) >> index;
curbit = (sample[p / 8] & (((uint8_t) 1) << index)) >> index;
prevbit = (ctx->prevsample[p / 8] & (((uint64_t) 1) << index)) >> index;
(uint64_t)(((float)samplecount / ctx->samplerate)
* ctx->period), curbit, (char)('!' + p));
}
(uint64_t)(((float)samplecount / ctx->samplerate)
* ctx->period), curbit, (char)('!' + p));
}