Input/vcd: Add reset() function

This commit is contained in:
Soeren Apel 2016-05-02 18:16:38 +02:00 committed by Uwe Hermann
parent 87616181f9
commit f4b4725bce
1 changed files with 12 additions and 0 deletions

View 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,
};