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

index f05ca5b8c50116a85e48f081263e7640634593f3..5241e74ca5261c005861ac3eca15f2d198523710 100644 (file)
@@ -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,
 };