X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Foutput_analog.c;h=b9c3c7c2ecf5349a73aa39cfb1475ea946bb2e39;hb=d4f228d094d53c95bdf4dd42525a271db716928d;hp=173ec5a2367480ceee91d8e26e7735ef373d1a00;hpb=1437e8934bd01167f2126616c7e8b44ca342cd27;p=libsigrok.git diff --git a/output/output_analog.c b/output/output_analog.c index 173ec5a2..b9c3c7c2 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) @@ -209,7 +216,7 @@ static int event(struct output *o, int event_type, char **data_out, struct output_format output_analog = { "analog", - "Analog data", + "Analog data (takes argument, default 10)", DF_ANALOG, init, data,