]> sigrok.org Git - libsigrok.git/commitdiff
Input/vcd: Add reset() function
authorSoeren Apel <redacted>
Mon, 2 May 2016 16:16:38 +0000 (18:16 +0200)
committerUwe Hermann <redacted>
Mon, 9 May 2016 11:02:47 +0000 (13:02 +0200)
src/input/vcd.c

index 253e76f67d25a78a5b381a08e2cd841ca8bdc723..39a92d32509cf510b59c624bcde2e4f55689584f 100644 (file)
@@ -613,6 +613,17 @@ static void cleanup(struct sr_input *in)
        inc->current_levels = NULL;
 }
 
+static int reset(struct sr_input *in)
+{
+       struct context *inc = in->priv;
+
+       cleanup(in);
+       inc->started = FALSE;
+       g_string_truncate(in->buf, 0);
+
+       return SR_OK;
+}
+
 static struct sr_option options[] = {
        { "numchannels", "Number of channels", "Number of channels", NULL, NULL },
        { "skip", "Skip", "Skip until timestamp", NULL, NULL },
@@ -645,4 +656,5 @@ SR_PRIV struct sr_input_module input_vcd = {
        .receive = receive,
        .end = end,
        .cleanup = cleanup,
+       .reset = reset,
 };