From: Soeren Apel Date: Mon, 2 May 2016 16:16:09 +0000 (+0200) Subject: Input/raw_analog: Add reset() function X-Git-Tag: libsigrok-0.5.0~433 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4c55ea47a7047fe25717aa8b19f64ed8b33ddb8c;p=libsigrok.git Input/raw_analog: Add reset() function --- diff --git a/src/input/raw_analog.c b/src/input/raw_analog.c index f05ca5b8..5241e74c 100644 --- a/src/input/raw_analog.c +++ b/src/input/raw_analog.c @@ -267,6 +267,17 @@ static void cleanup(struct sr_input *in) in->priv = 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; +} + SR_PRIV struct sr_input_module input_raw_analog = { .id = "raw_analog", .name = "RAW analog", @@ -277,4 +288,5 @@ SR_PRIV struct sr_input_module input_raw_analog = { .receive = receive, .end = end, .cleanup = cleanup, + .reset = reset, };