]> sigrok.org Git - libsigrok.git/commitdiff
Merge branch 'master' of git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok
authorDaniel Ribeiro <redacted>
Mon, 10 Jan 2011 04:28:59 +0000 (02:28 -0200)
committerDaniel Ribeiro <redacted>
Mon, 10 Jan 2011 04:28:59 +0000 (02:28 -0200)
output/output_analog.c

index 173ec5a2367480ceee91d8e26e7735ef373d1a00..4a6585bf19f1bfc9f5593a121fa64567a4b91e99 100644 (file)
@@ -24,6 +24,7 @@
 #include <config.h>
 
 
+#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)