From: Bert Vermeulen Date: Mon, 10 Jan 2011 04:27:22 +0000 (+0100) Subject: output_analog: allow samples per line arg (default analog10) X-Git-Tag: libsigrok-0.1.0~453^2~4 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=9b36e360f3c23c3287e6e10acb0b57479c5d19ad;p=libsigrok.git output_analog: allow samples per line arg (default analog10) --- diff --git a/output/output_analog.c b/output/output_analog.c index 173ec5a2..4a6585bf 100644 --- a/output/output_analog.c +++ b/output/output_analog.c @@ -24,6 +24,7 @@ #include +#define DEFAULT_SAMPLES_PER_LINE 10 /* -10.25 */ #define VALUE_LEN 6 @@ -89,9 +90,15 @@ static int init(struct output *o) } o->internal = ctx; - ctx->samples_per_line = 5; ctx->num_enabled_probes = 0; ctx->mark_trigger = -1; + if (o->param && o->param[0]) { + ctx->samples_per_line = strtoul(o->param, NULL, 10); + if (ctx->samples_per_line < 1) + return SIGROK_ERR; + } else + ctx->samples_per_line = DEFAULT_SAMPLES_PER_LINE; + for (l = o->device->probes; l; l = l->next) { probe = l->data; if (!probe->enabled)