]> sigrok.org Git - libsigrok.git/blobdiff - output/text/ascii.c
demo: Rename GENMODE_DEFAULT to GENMODE_SIGROK.
[libsigrok.git] / output / text / ascii.c
index 04d39ea37565f297ddd045e9c2e51d1f3d4df5f3..2d0c1c36c24f9ab03210486289c2495516e0d6ad 100644 (file)
@@ -22,9 +22,9 @@
 #include <string.h>
 #include <glib.h>
 #include <sigrok.h>
+#include <sigrok-internal.h>
 #include "text.h"
 
-
 int init_ascii(struct sr_output *o)
 {
        return init(o, DEFAULT_BPL_ASCII, MODE_ASCII);
@@ -105,7 +105,7 @@ int data_ascii(struct sr_output *o, const char *data_in, uint64_t length_in,
                        ctx->prevsample = sample;
                }
        } else {
-               g_message("short buffer (length_in=%" PRIu64 ")", length_in);
+               sr_info("short buffer (length_in=%" PRIu64 ")", length_in);
        }
 
        *data_out = outbuf;
@@ -114,13 +114,11 @@ int data_ascii(struct sr_output *o, const char *data_in, uint64_t length_in,
        return SR_OK;
 }
 
-
 struct sr_output_format output_text_ascii = {
-       "ascii",
-       "ASCII (takes argument, default 74)",
-       SR_DF_LOGIC,
-       init_ascii,
-       data_ascii,
-       event,
+       .id = "ascii",
+       .description = "ASCII (takes argument, default 74)",
+       .df_type = SR_DF_LOGIC,
+       .init = init_ascii,
+       .data = data_ascii,
+       .event = event,
 };
-