X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=output%2Foutput_vcd.c;h=94efd2eb4e918bc3f7a0763c8f5832b9331df2b9;hb=83e9d586385097b957774d150a718ebaa7fcc3c9;hp=17505e6a2a1af10f2df1309db12430a38d255912;hpb=54ac5277c5e462f1778300b9bc3fdd4709ecb2dc;p=libsigrok.git diff --git a/output/output_vcd.c b/output/output_vcd.c index 17505e6a..94efd2eb 100644 --- a/output/output_vcd.c +++ b/output/output_vcd.c @@ -36,17 +36,7 @@ struct context { uint64_t samplerate; }; -const char *vcd_header = "\ -$date %s $end\n\ -$version %s $end\n%s\ -$timescale %s $end\n\ -$scope module %s $end\n\ -%s\ -$upscope $end\n\ -$enddefinitions $end\n\ -$dumpvars\n"; - -const char *vcd_header_comment = "\ +static const char *vcd_header_comment = "\ $comment\n Acquisition with %d/%d probes at %s\n$end\n"; static int init(struct sr_output *o) @@ -106,12 +96,12 @@ static int init(struct sr_output *o) /* timescale */ /* VCD can only handle 1/10/100 (s - fs), so scale up first */ - if (ctx->samplerate > MHZ(1)) - ctx->period = GHZ(1); - else if (ctx->samplerate > KHZ(1)) - ctx->period = MHZ(1); + if (ctx->samplerate > SR_MHZ(1)) + ctx->period = SR_GHZ(1); + else if (ctx->samplerate > SR_KHZ(1)) + ctx->period = SR_MHZ(1); else - ctx->period = KHZ(1); + ctx->period = SR_KHZ(1); if (!(frequency_s = sr_period_string(ctx->period))) { g_string_free(ctx->header, TRUE); free(ctx); @@ -223,10 +213,10 @@ static int data(struct sr_output *o, const char *data_in, uint64_t length_in, } struct sr_output_format output_vcd = { - "vcd", - "Value Change Dump (VCD)", - SR_DF_LOGIC, - init, - data, - event, + .id = "vcd", + .description = "Value Change Dump (VCD)", + .df_type = SR_DF_LOGIC, + .init = init, + .data = data, + .event = event, };